There is some facility in the SD card spec for password protection, but to my knowledge*, there is no code in any of the Linux versions normally used on the PI to make use of the SD card's password protection capabilities. I've seen others ask about it numerous times, and I believe the answers are always negative. If someone can physically access the Pi, they can pull the microSD card and plug it into another computer and read the contents. It was designed to be a teaching and hobbyist computer.

*: (I'm just someone who has been experimenting with Raspberry Pi's, and following the forums here, for a couple years.)

If a drive or memory card can be read by the Pi, then it can be read by anything else as well - this should be obvious. It is not possible for a drive or memory card to recognize the device which is accessing it and thereby decide wheter or not the contents should be made available to that device.

You may, however, encrypt the contents of a drive attached to a Pi, but the password (or key) must be stored on the Pi if the Pi is supposed to auto-mount the drive and this would be an unsecure sollution. The only secure way of attaching encrypted storage will require you to manually type in the password every time the storage is mounted.

Please do not ask questions in private messages, they will not help others.

NotRequired wrote:If a drive or memory card can be read by the Pi, then it can be read by anything else as well - this should be obvious. It is not possible for a drive or memory card to recognize the device which is accessing it and thereby decide wheter or not the contents should be made available to that device.

You may, however, encrypt the contents of a drive attached to a Pi, but the password (or key) must be stored on the Pi if the Pi is supposed to auto-mount the drive and this would be an unsecure sollution. The only secure way of attaching encrypted storage will require you to manually type in the password every time the storage is mounted.

That would work. Every time I plug the sd card into a device it requires a passcode. How can I do what you said?

Every time this issue comes up, I feel that I must ask: What is it that you are trying so hard to protect? Is it code? Do you think your code is unique and that no one else will ever write a program to do the same thing? Is it data, such as names and social security numbers?

There are two major issues here. The first is the physical security of the actual device. If someone steals the Pi, SD card and all, then encryption *may* prevent reading the data...or it may not. It depends on how good your encryption is and who is trying to read it. The second is remote electronic access. In this case, if the files can be read by the Pi, then the intruder will be able to do so as well, so what you need to worry about is system security, not file or data security.

Then there is a semi-minor issue. You have to consider the cost (and your time is a cost) to secure the files against the value that will be lost if the files are stolen or compromised. Note that files that are stolen may still exist, so it's more a matter of the economic loss by there being someone else with the files.

Most of this comes down to this: What exactly are you trying to protect and what threats are you trying to protect it from, and why?

Every time this issue comes up, I feel that I must ask: What is it that you are trying so hard to protect? Is it code? Do you think your code is unique and that no one else will ever write a program to do the same thing? Is it data, such as names and social security numbers?

There are two major issues here. The first is the physical security of the actual device. If someone steals the Pi, SD card and all, then encryption *may* prevent reading the data...or it may not. It depends on how good your encryption is and who is trying to read it. The second is remote electronic access. In this case, if the files can be read by the Pi, then the intruder will be able to do so as well, so what you need to worry about is system security, not file or data security.

Then there is a semi-minor issue. You have to consider the cost (and your time is a cost) to secure the files against the value that will be lost if the files are stolen or compromised. Note that files that are stolen may still exist, so it's more a matter of the economic loss by there being someone else with the files.

Most of this comes down to this: What exactly are you trying to protect and what threats are you trying to protect it from, and why?

I just want to make a password or something to stop the average person from pluging the sd card into a computer, copying the files, and making copies. I am not trying to protect anything that would matter if it was compromised.

johnnyo1012 wrote:
I just want to make a password or something to stop the average person from pluging the sd card into a computer, copying the files, and making copies. I am not trying to protect anything that would matter if it was compromised.

CarlRJ wrote:There is some facility in the SD card spec for password protection, but to my knowledge*, there is no code in any of the Linux versions normally used on the PI to make use of the SD card's password protection capabilities.