encryption - Security using AES with salted password as key -


i understand how salted hash of password works, assuming need store salt, username, key, , encryptedpassword. think overall need understand how implement instance how store , how regenerate password. if explain why using salted value better, couldn't person dictionary attack salt in front of each word?

thanks,

it unclear trying do: verify supplied password correct (as system login); or implement encryption of data key derived password.

if latter (which known password-based encryption), should use key derivation function, such pbkdf2. key derivation function takes salt , supplied user password, , produces key can used cipher aes.

to encrypt, prompt password, generate random salt, , derive key using kdf. use key aes in suitable block cipher mode encrypt data, , store only salt , encrypted data (and whatever iv cipher mode requires).

to decrypt, prompt password, load salt file, , re-derive key. use key decrypt file.

the purpose of salt prevent precomputation optimisations being applied dictionary attack. indeed possible perform bruteforce dictionary attack once salt known, kdf designed slow enough make infeasible without precomputation.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -