I'd like to build a simple password-protected symmetric key system. The key-creation process in my system operates as follows:
- The system creates a 256-bit key purely at random.
- The user chooses a password, which is hashed using SHA-256.
- The system stores the value
key XOR SHA(password), which we call the "pseudo-key".
The pseudo-key is stored permanently by the system or user, whereas the actual key and password hash are never stored. When the user wants to produce his key for encryption or decryption, he can recreate the actual key from
pseudokey XOR SHA(password). The password hash and actual key are always destroyed immediately after use.
- Aside from an adversary obtaining the pseudo-key and brute-forcing the password, are there any obvious theoretical problems with this system?
- Is it notably inferior to other extant password-based key systems?
- Is the system I'm describing (or any system that password-protects a symmetric key) already present in some cryptographic library?