Status: experimental, need your testing!Short description:io_crypt is a module which automatically encrypts .CR2 and .JPG while you shoot them.
The original file content is never written to card, so there is no way to restore the image content by reading the raw sectors etc.
You can choose between different modes and security levels.
This was formerly discussed
there and was requested already a few times.
Detailed description:This module hooks the file-io operations for your SD and CF card and places custom read/write routines instead.
These custom r/w operations encrypt your file content before the card's real write handler is being called.
For you there is no additional task to do after you shot the image - just shoot as usual and your files are encrypted.
There are two possible modes:
-
Password Before you shoot images, you have to enter a password which is being used for all images
The password gets fed into a LFSR (Linear Feedback Shift Register) to shuffle the bits and get a 64 bit
file key.
advantage: you can enter different keys, one per "session" or "access level" and share them accordingly
disadvantage: you have to enter the key every time you power on the camera (storing is insecure of course)
-
RSA Before you start your shooting, you create a RSA public/private key pair via menu.
(edit: this takes up to 10 minutes with a 4096 bit key!!)
Then you copy the private key from your card (
ML/DATA/IO_CRYPT.KEY), store it at a safe place and delete it from your card (!!).
You need the private key only for decrypting (on computer), the public key only for encrypting (on camera)
With the internal PRNG for every image a separate
file key is being generated and encrypted using RSA.
advantage: no password must be entered, power on and shoot. every image has a different, random "password"
disadvantage: you have to prepare yourself a bit by copying and deleting the encryption keys correctly
In both modes, the file content is being encrypted using a XOR operation with the output of a 64-bit LFSR that was pre-loaded with the
file key and the current block numver.
To make random access feasible and the encryption fast enough, the keys are used
blockwise.
This obviously weakens encryption a lot and makes it possible to recover the 64 bit block encryption key using known plaintext attacks.
The good thing - know plaintext attacks are only suitable for file content that has a predictable pattern, like the file header.
Still the encryption i implemented is *not* military grade. Although it is (imho) safe enough for a normal individual.
Options: Blocksize The block size that is being encrypted with the same 64 bit key.
larger is faster, but insecure. smaller values slow down saving. choose.
Ask for password on startup If you are in Password mode, camera will ask for password right after poweron.
When disabled, you have to enter the menu manually and set the key - else no pictures will be encrypted.
RSA Keysize Choose the largest value that you can tolerate. The larger the size, the longer generating will take (up to 10 minutes...).
Also saving will slow down a bit with larger keys
Image review:Canon caches the images you have shot until you
poweroff the camera or the memory gets full (5-10 images).
As long the images are in cache, you can review it without any problem, even if you change the key.
In RSA-Mode you currently *not* review images other than those in cache. Not sure if i will implement it at all.
In Password mode, you can view images when you set the correct password.
Decryption:After you copied the files onto your computer, you can decrypt it with io_decrypt which is (not yet) avaiable precompiled, but you can get from the repository.
./io_decrypt <in_file> [out_file] [password]
If you want to decrypt password protected files (LFSR64), you have to supply the encryption password on commandline.
For RSA encrypted files, the private key
ML/DATA/IO_CRYPT.KEY must be in the current directory.
Compatibility:The module contains some camera specific memory addresses, so it has to be ported for every model.
Cameras that are supported: 7D, 5D3, 60D, 600D, 650D
Next cameras being added: 5D2, 6D
If you have a different model and want to use/test the module, please post it here.
Disclaimer:1. Do not do any illegal stuff with it.
2. It is meant for e.g. reporters whose security depends on the footage not being revealed or for securing sensible information
3. Dont rely on it. It will for sure somewhen fail and your footage is gone.
4. Dont cry when something goes badly wrong.
Download:You can always download my latest build
therehere is the windows console decrypter.
ToDo: - Show fake images instead of the standard canon error screen
- background encryption for unsupported models. will scan, encrypt and save the images in background while your camera is idle.