I have a personal project in mind in which I plan to use cryptography in order to let the users be confident in the fact that, even if all data get's stolen, it would be virtually impossible to crack in the next few decades.
I would like some advice on the way I planned it until now:
All data resides in two key/value stores:
Store 1 - contains messages:
- key : msg_id (numerical)
- value : AES encrypted message with random key K1.
Store 2 - links users to messages:
- key : hash H1 of (user identification + password + X)
- value : AES encrypted data containing the msg_id and key K1, encrypted with key K2 (identification + password + salt/padding)
( X increments from 1 to N, per message linked to user. I use this to create more noise, should there be an attack, and to differentiate the hash H1 with key K2).
Without any regard to the way it should work (which is quite specific): is the data contained in the two stores safe even if an attacker knows their architecture and has access to the application's source code ? They may know some user id's, but not their password.
BTW: I'm quite new to cryptography. I'm reading through the basic materials (applied cryptography by Bruce Schneier, for one), so please be indulgent.