Using PBKDF2
Posted: Thu Sep 13, 2012 2:40 pm
I maintain an Mac/iOS AES library called RNCryptor (https://github.com/rnapier/RNCryptor). I'd been lamenting my need to create "yet another" encrypted file format, and one of my readers pointed to the AESCrypt format as a possible option. I was reviewing it, and had some concerns that I wanted to kick around.
The biggest concern is the custom KDF. PBKDF2, while perhaps not perfect, is well-vetted, analyzed, and standardized. Is there any analysis of the strength of the 8k hashing approach that you're using?
I'm also somewhat concerned with the key reuse between encryption and HMAC. My recommendation is to generate separate keys for these functions. Using PBKDF2, it is easy to generate two keys using different salts.
In general, this file format is growing on me and I'd like to investigate bringing it to iOS and Mac-native (i.e. using the built-in CommonCryptor functions). The RNCryptor page includes a list of my security design goals.
A couple of other notes:
* It would be useful if the file format documentation explained how the various fields are generated and what they mean. I had to crawl through the code to figure out what was actually happening (which I *assume* is what is intended to be happening). That said, it is very easy to read code.
* It would also be useful if the format could handle raw keys rather than a password. Passwords have a very compressed key space, so for machine-to-machine communication it is useful to use shared secret keys rather than passwords. (For similar reasons, it would be useful if the format could handle other key sizes; I know this is on the wish list).
The biggest concern is the custom KDF. PBKDF2, while perhaps not perfect, is well-vetted, analyzed, and standardized. Is there any analysis of the strength of the 8k hashing approach that you're using?
I'm also somewhat concerned with the key reuse between encryption and HMAC. My recommendation is to generate separate keys for these functions. Using PBKDF2, it is easy to generate two keys using different salts.
In general, this file format is growing on me and I'd like to investigate bringing it to iOS and Mac-native (i.e. using the built-in CommonCryptor functions). The RNCryptor page includes a list of my security design goals.
A couple of other notes:
* It would be useful if the file format documentation explained how the various fields are generated and what they mean. I had to crawl through the code to figure out what was actually happening (which I *assume* is what is intended to be happening). That said, it is very easy to read code.
* It would also be useful if the format could handle raw keys rather than a password. Passwords have a very compressed key space, so for machine-to-machine communication it is useful to use shared secret keys rather than passwords. (For similar reasons, it would be useful if the format could handle other key sizes; I know this is on the wish list).