What data type to use when storing PBKDF2 encrypted passwords?
Asked Answered
T

1

2

I am using SimpleCrypto.Net to encrypt my passwords, which i understands uses PBKDF2 and a specified salt and number of iterations. I would like to know what's the most appropriate data type for me to set the password column to in the database.

Tergiversate answered 12/10, 2012 at 8:45 Comment(0)
E
3

From looking at the code the result is a base64 encoded key of 64 bytes. Considering base64 is made up of ASCII characters I would recommend storing it as CHAR(88) or to be on the safe side you could go with VARCHAR(MAX). However, as the key size is fixed at 64 bytes the length of the result should never change (even if your salt/iterations are changed).

Engleman answered 12/10, 2012 at 9:23 Comment(1)
Thanks, exactly the kind of answer that I was looking for.Tergiversate

© 2022 - 2024 — McMap. All rights reserved.