2

I want to build an embedded system that reads external data and logs it to a file saved in an SD card. However this system is accessed through a password and I want either the SD card or the file in it to use this password as well. How can I do it? About the file, I thought of saving it with a .CSV extension because it uses rows and columns. Can this type of files have password? Any suggestions?

To be more specific with the question: I will use a microcontroller, programmed with C language. What commands should I send to the SD card in order to be password-protected? Or, what is the format of a file in order to have an access password?

EDIT: I want to add a password so that only the user is able to open the file and read it using his/her PC.

esal26
  • 123
  • 2
  • 8

1 Answers1

3

The SD card has password protection built into the standards. Here you can read the standards for SD cards to learn how it works. Below is a link to a project for locking/unlocking a SD card with an Atmel microcontroller.

SDLocker2

  • 4
    But note that most devices which interface with SD cards, including computer-based SD readers, do not support password protection. You will likely be unable to use the card while protection is enabled. –  Sep 09 '14 at 05:17
  • @duskwuff I want to add a password so that only the user is able to open the file and read it (using his/her PC). So, according to your comment, this will not be possible if I use the solution provided above, is that what you mean? – esal26 Sep 10 '14 at 17:54
  • Correct. SD card passwords protect the entire card from being used, not individual files. –  Sep 10 '14 at 18:02
  • @duskwuff Strictly speaking, this is only true when the SD reader is connected via USB Mass storage endpoint (or a similar interface) which doesn't support raw SD commands. Many internal card readers accept arbitrary SD commands. You still need software to send these commands though. – Dmitry Grigoryev Aug 15 '17 at 09:53
  • @DmitryGrigoryev Right, I mean from a practical perspective. Even if the hardware can technically send the commands to unlock the card, the drivers probably won't handle that case. Inserting a password-protected card will likely result in an error message or nothing at all -- not a password prompt. –  Aug 15 '17 at 20:47