OSDN Git Service

Create and use a salt when calling pbkdf2 to encrypt/decrypt the master key.
authorKen Sumrall <ksumrall@android.com>
Wed, 19 Jan 2011 06:01:55 +0000 (22:01 -0800)
committerKen Sumrall <ksumrall@android.com>
Wed, 19 Jan 2011 06:01:55 +0000 (22:01 -0800)
commite87440703663f5ee326326f6438f3b00ea315623
tree19a888075b69a69ece6b1c4ce43904ac36ba9733
parent0cc166385a7e1d3026bbcb62f094e419f779e872
Create and use a salt when calling pbkdf2 to encrypt/decrypt the master key.

In order to prevent rainbow table attacks on decrypting the master key,
create a 16 byte "salt" by reading /dev/urandom.  This is done right after
reading urandom to get the master key for the filesystem.  The salt is
stored 32 bytes after the end of the key (a padding added to help prevent
accidental overwriting of the salt) and the salt is fixed at 16 bytes long.

This change will make existing encrypted filesystems unusable.

Change-Id: I420549d064c61d38aea78eef4d86c88acb265ca3
cryptfs.c
cryptfs.h