Putting password into a SD.

Hi guys, sorry to bother you. I'm messing around with this: http://snipurl.com/29u7htl It's an Arduino sketch which does some pretty things on SD cards. Among the things that it sets out to do there is the possibility to put a password into the cards. It works, I have some questions though. I don't understand where the presetted password is stored. Digging the matter I saw in sd_raw_roland.cpp that at row 199 there is what should be the presetted password used by the sketch: 199 char GlobalPWDStr[16] = {'T', 'W', 'I', 'L', 'I', 'G', 'S', 'P', 'O', 'R', 'K', 'L', 'E', 'P', 'A', 'H'}; // password used to lock the card The problem is that it isn't the password that is used by the scketch, the real one is totally different, it doesent match with that. More, even changing it in the row 199 seems do anything, the password used is still the same as before. So my questions are: 1)Where is the real password stored? 2)How can it be possible that the password in the row 199 can be translated into the real one used by the sketch due the fact that by changing it nothing happens and it remains unchanged? Thank in advance for the help. Regards,


The idea with storing passwords is not to be able to read them. As then they are not passwords anymore - just a key to be read.

Therefore the password is crypted by an algoritm (math bit cruncher), making the password illegible to humans. If you want to read the password back, you must use the same algoritm - in reverse.

To use the password stored, you will have to remember the legible password which can be written and read by humans. This is then compared against the stored (and crypted) password by the code, which de-crypt it for comparison.

Remember how it works, when you are doing on-line banking. You certainly dont want anyone to be able to find and read a legible password to your account. Besides - online banking is using a far more elaborated crypting, than you are dealing with 8)

  • hopefully :fearful:

Hi Anders53, thank for posting! I agree with you but this is not the same case. Simply modifying a bit the library I'm in the position to read the real password, here is why I wrote it doesn't match with the one which is in the row 199. I verified also using a logic analyzer and surely the password issued by that sketch isn't the same in the row 199, no story. Indeed it would seem that the string in the line 199 is good for nothing due the fact that even changing it all still works with the password issued which is always the same, nothing changes. That's what I don't understand. Thanks.