element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum Self-Destructing arduino code
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 29 replies
  • Answers 1 answer
  • Subscribers 396 subscribers
  • Views 3174 views
  • Users 0 members are here
  • self.destructing.arduino.code
Related

Self-Destructing arduino code

dirtdiver
dirtdiver over 12 years ago

Hi everyone,

   so I've been wondering if there is a way to make a hidden button on a device (device wokring with ardunino) that will (once pressed) render the code useless - for example to delete values (val1, val2 ...) or in any way destroy the program that runs that device.

Any ideas?

Thanks,

Lubo (Bo)

  • Sign in to reply
  • Cancel

Top Replies

  • Former Member
    Former Member over 12 years ago in reply to dirtdiver +2
    Don't patent it! I tell you, it's a waste of time, money and effort. You need to pay thousands of dollars, and here's the worst part: you have to publish a detailed description of your product and how…
  • sonuame
    sonuame over 12 years ago in reply to Former Member +2
    @Rahul,, yeah i am agreed to you , I just told that Reset pin is too much a easy way to stop execution of the microcontroller for that complex machine. sure continously reading the EEPROM values sometimes…
  • ntewinkel
    ntewinkel over 12 years ago in reply to sonuame +2
    I really like Sunil's idea of it only checking after a few days! Much less obvious that way. You might also make it use a jumper on pins instead of a button, to prevent accidental presses. You could probably…
Parents
  • sonuame
    0 sonuame over 12 years ago

    Try connecting one I2C EEPROM 24C256, and write the Encrypted string or Code via arduino board. Lets say 1710 is the code you have written in it.

    Now, Atmega328 microcontroler has one onboard EEPROM, Write a code 1710 in it too...

     

    Now in the Setup Section of your code, Compare any I2C device attached to the uC. and make a female socket for the connection of external EEPROM.

     

    Run your whole program of arduino if and only if the internal EEPROM contains 1710 and dont execute if this code is not saved. Once yopu plug in the EXTERNAL EEPROM, define a logic like, if the code of External and Internal EEPROM matches..it will erase the internal EEPROM completly and hence your entire Arduino

    sketch will be useless. Doesnt matter even if you reset it or Power off...

     

    Hope this one helps...!!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 12 years ago in reply to sonuame

    Here's an idea:

     

    when the button is pressed, you could just write all the values to 0 (or anything else, if you're trying to confuse the user by giving bogus readings), and put the chip in a never ending loop by using something like this:

     

    while(1)

    {

         //do nothing here, or maybe keep clearing the values if you want

    }

     

    However, the code would start working again when you reset it, or of you power it off and then on again.

     

    What is this mysterious feature for anyway?

     

    One option I can think of (easy way out, no code) is to use a simple SPDT switch to connect the reset pin to ground (that way the micro can't do anything until you open the switch again), but this might not be suited to your (let's be honest, slightly dubious image) purposes. If the switch is hidden well enough, then whoever it's hidden from might not have a clue as to what's going on, unless they're familiar with microcontrollers and have really sharp eyes.

     

    Using the EEPROM to store variables seems a little overkill to me, unless for some reason you want them to be kept after you turn off the chip.

     

    If you want a way to permanently destroy all the code on the chip until it's reprogrammed, it get's a little more complex...

    If you're competent in programming in assembly, maybe you could somehow load the code into the RAM and go from there. This way, the code will vanish once the chip is powered off or reset. This seems like a daunting task to me, and forget using the Arduino environment to do this!

     

    Or you could just set fire to the thing, whatever works best image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Former Member
    0 Former Member over 12 years ago in reply to sonuame

    Here's an idea:

     

    when the button is pressed, you could just write all the values to 0 (or anything else, if you're trying to confuse the user by giving bogus readings), and put the chip in a never ending loop by using something like this:

     

    while(1)

    {

         //do nothing here, or maybe keep clearing the values if you want

    }

     

    However, the code would start working again when you reset it, or of you power it off and then on again.

     

    What is this mysterious feature for anyway?

     

    One option I can think of (easy way out, no code) is to use a simple SPDT switch to connect the reset pin to ground (that way the micro can't do anything until you open the switch again), but this might not be suited to your (let's be honest, slightly dubious image) purposes. If the switch is hidden well enough, then whoever it's hidden from might not have a clue as to what's going on, unless they're familiar with microcontrollers and have really sharp eyes.

     

    Using the EEPROM to store variables seems a little overkill to me, unless for some reason you want them to be kept after you turn off the chip.

     

    If you want a way to permanently destroy all the code on the chip until it's reprogrammed, it get's a little more complex...

    If you're competent in programming in assembly, maybe you could somehow load the code into the RAM and go from there. This way, the code will vanish once the chip is powered off or reset. This seems like a daunting task to me, and forget using the Arduino environment to do this!

     

    Or you could just set fire to the thing, whatever works best image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • dirtdiver
    0 dirtdiver over 12 years ago in reply to Former Member

    image  image interesting ideas . Anyway i need it becouse im making a racing simulator (http://www.youtube.com/watch?v=y9m--orp8O8)  and the  idea is to put it in a gaming club (i've talked to the owner and its all good), now i know the guy , but its never bad to have a "dead man's switch" in case he decides to pull any stunts i can just "render the sim uselses" and gain leverage image (im also putting a non-resetable timer in it to keep track at the time it was working)

    In other words im just trying to cover all the angles here

    it uses a teensy 3.0 (arduino doesnt have a joystick function) but its programed in the arduino IDE

    i like the idea with the reset pit or a switch keeping the values at 0...i will keep thinking and see whats the best option (maybe all of them)

    I was wondering if there is a way to irreversibly change a value to 0 or something similar so that once pressed the button ruins the code and it has to be reuploaded to the teensy

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • sonuame
    0 sonuame over 12 years ago in reply to dirtdiver

    Dude,, as per the video attached, I am pretty sure you're gonna mess with lots of Digital circuits and components..then why not a cheap eeprom.

    I am not agreed with the method stated by Mr Rahul. Its not 100% control over your sketch. Protection means real digital protection. Not with any analog means...

     

    4 digit security lock can be easily made just with one keypad and without any microcontroller in it, just by Analog means but its not secure and thats why we use Microcontrollers

    to provide it better security by digital Logics.

     

    Yeah Sure Reset Pin can workout for you but its really not practical.

     

    Make your whole sketch dependant on the values saved on onboard eeprom. And then dedicate a Key somewhere hidden if you want to or you can attach a small keypad if you want, to

    destroy it with some specific code.

     

    When you'll enter exact Code by keypad or you pressed that dead man switch, It should erase the eeprom completly which will make your sketch null and void and won't work until unless you reupload it again.

     

    As per my experience,, This is the Best (I wont say easy)  protection to yor sim...

    and it will be always there even if the power is out

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • dirtdiver
    0 dirtdiver over 12 years ago in reply to sonuame

    i guess you are right, im still gonna have to look into the eeprom couse im not really familiar with it

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • ntewinkel
    0 ntewinkel over 12 years ago in reply to dirtdiver

    How about just writing a variable to the built in EEPROM memory?

    http://www.arduino.cc/en/Reference/EEPROM

     

    And then in the loop just check to see if that value is set, and go to the never-ending loop at that point.

     

    Cheers,

    -Nico

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube