I was wondering if such practice would be safe:
- I have a table that stores encrypted notes
- Every note has a data field and a password field
- When a password is entered, i want to select all notes, encrypted with that password
- For this purpose, i need to safely store the password next to the data
- There can be many notes and many different passwords
To solve this problem, here's what i do:
- Encrypt the data to be stored with an AES key, generated by PBKDF
- Hash the key with md5
- Store the md5 version of the key next to the data
Here's what i'm thinking:
- MD5 is super insecure!
- So we have a better chance brute forcing the MD5 hash to recover the original key
- But ...
- The key itself is 256 bits
- So in theory, brute forcing such an md5 hash should still be a nightmare ... or am i wrong?
What would be a better alternative for storing a password hash (i only need it for determining which notes to select from db)?
Thanks for your thoughts