Data Logger - password protect log file?

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
swampdonkey
 
Posts: 9
Joined: Mon May 30, 2011 11:42 pm

Data Logger - password protect log file?

Post by swampdonkey »

Is there an easy way to encrypt or simply password protect the CSV file when using adafruit's logger shield? It doesn't have to be super secure, just so any lookee loos don't have unfettered access to the data.
Maybe even a simple formula in the sketch to pseudo-randomize the data that can be decrypted by a formula in Excel?
Ideas?

User avatar
adafruit_support_bill
 
Posts: 88154
Joined: Sat Feb 07, 2009 10:11 am

Re: Data Logger - password protect log file?

Post by adafruit_support_bill »

Considering the limited resources on the Arduino, your bet bet is to scramble the data somehow. One very simple (although not terribly secure) technique is to use a 'password' of arbitrary length, and use it to perform some reversible logical operations on the data.

For example, if you start with everyone's favorite password "admin":
When writing the file, you XOR the first byte of data with 'a', the second byte with 'd', the third byte with 'm' etc.
When you get to the end , you start over again with 'a'.

When reading the file, if you know the password, you can retrieve the original data by applying the same process:
XOR the first byte with 'a', the second byte with 'd' etc. Assuming that you use the right password, this will restore each byte to its original value.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”