Breaking Rfc2898DeriveBytes key with input password but without salt

1k views Asked by At

I am using C# RijndaelManaged class for AES encryption. The key and IV are generated from input password and salt using Rfc2898DeriveBytes class. My question is, how difficult would it be to break encryption if someone obtained input password but not the salt?

1

There are 1 answers

0
Maarten Bodewes On

It would be close to impossible to retrieve the key and IV. Actually, sometimes a static, secret salt stored in source code is used in addition to the public random salt. In that way an attacker is required to get the source or runtime code in addition to the database with the salts and password hashes.

This kind of scheme does require a large enough (secret) salt, say 128 bytes. It would be best to use concatenation to create the combined public and secret salt.

Of course, it is always possible to mess up the encryption otherwise, e.g. by being vulnerable to padding oracle attacks, forgetting an authentication tag (HMAC) in addition to encryption, etc. etc. etc.