How-To

Method 1: Using a PC

Unlocked State

By default, the camera is in the "unlocked" state. You can take pictures as normal and view them as normal. There is no encryption.

Locking the Camera

You'll notice two files on the card:

This is the generated key-pair. If you delete them, or delete only "pubkey.pem", the camera will generate a new key-pair. It's a good idea to use a fresh key-pair when you lock the camera, especially if someone could've copied off the private key.

To lock the camera, move the private key file ("privatekey.pem") off of the camera. Keep this file in a safe place.

What happens now?

The next time the camera is power on, it detects the missing private key. It copies the public key to internal storage, and uses it to encrypt. At this point, it's in a "locked" state. A "LOCKED" message will be shown the first time. If pictures are currently on the camera, they will ALL be encrypted. I suggest emptying the pictures from the camera before locking it.

Locked State

When the camera is in the "locked" state, the AF Illuminator (bright green front LED) will double-blink when the camera is turned on.

When you take a picture, you'll see the quick preview. The LED by the "Play" button will blink rapidly, indicating that it's busy saving data. Don't turn off the camera while it's busy!

If you press the "Play" button to view your pictures, you'll see this error:

Of course the pictures can't be viewed. They're encrypted!

Unlocking the Camera

Return the private key file ("privatekey.pem") to where it was originally at.

What happens now?

The next time the camera is power on, it detects the private key. It uses the private key to decrypt all of the pictures, and will show an "UNLOCKED" message. It deletes the internally-stored public key, deletes the private key, and reboots. At this point, it's back in the "unlocked" state and you can view/copy the pictures as normal.

Method 2: Using a Second SD Card

If you know you won't have a PC available, it's possible to use a second SD card. The second card holds a script and holds the private key file. I'll call this the "Key Card". Don't use this card for taking pictures!

Download my "Key Card Script" and unzip it to a freshly formatted card. (Use the camera to format the card first.) Once this is made, the instructions for Locking and Unlocking are the same.

    1. Power off the camera.
    2. Insert the Key Card.
    3. Power on the camera.
    4. Whatever state the camera is in (locked or unlocked), it'll transition to the other state.
    5. Wait until the message is shown indicating Locked or Unlocked.
    6. Power off the camera.
    7. Put in your primary card.
    8. Quirk: Sometimes the camera won't power on correctly and gets stuck. Pop out the battery for a second to reset it.

Troubleshooting / FAQ

There is a file IO error when I try to view the picture, why?

The file has been encrypted and renamed, so the camera can't read it.

When I turn on the camera, there are no pictures. Where did my pictures go?

Upon power-up, the camera scans the card for pictures. Since they are all encrypted, it doesn't find them. When you unlock the camera, they will all show up again.

Keys got mixed up -- how to I manually unlock my pictures?

Lock the camera with a new key (or any key). Then, copy the correct private key to the card to unlock.

If it fails to decrypt a photo (such as with using the incorrect key), it'll remain on the card.

What if I lost the private key?

The pictures cannot be recovered. (But an "undelete" utility might work.)

Is there a way to unlock the camera or uninstall the crypto function?

Doing a "Reset" (factory reset) will forcefully unlock the camera.

Reloading the firmware does a "Reset" as well. You can reload Samsung's firmware at any time.

Note that pictures will NOT be decrypted.

What about video?

After shooting a video with the camera, it will be processed the same as a picture. Make sure to wait for the LED to finish blinking before powering off the camera, otherwise you may lose the video. You need plenty of free space on the card as well. If it runs out of room encrypting, you'll lose it too.

How secure is it?

The public key / private key encryption is RSA, and uses RC4 to encrypt the file. The program "OpenSSL" does the work. It's a secure industry standard. However, Samsung's firmware isn't bulletproof. A locked camera could easily be unlocked. Or the encryption process could be killed using a remote shell or script, allowing some pictures to not be encrypted as expected. Files could be recovered with an "undelete" utility. To truly make a secure camera, the functionality from my "additions" would need to be moved into the internal closed-source binaries. I hope that camera manufacturers will see value in adding this in the future -- I'd be willing to help them with this task.