Simple encryption software - Security & Cryptography
Users browsing this thread: 6 Guest(s)
|
|||
Ok guys, so this project is going forward, and now I would need some input from other people to make it as good as possible!
Here's the idea. The password manager works by storing secrets as encrypted files on disk. When you store a secret, you'll be prompted for your master password. This password is used to derivate a secret key, along with a random salt (that MUST be stored in some ways. Once the key is obtained, it is used to encrypt whatever comes on <stdin> and write the encrypted stream in a file named after your entry. This solution presents 2 problems: 1. The salt is so important that we must store it, thus putting a hard dependency on these few bytes 2. Upon encryption, the password is not verified, so we could end up with secrets encrypted from different passwords I need to find a simple way to fix these issues, but I'm not sure how. My first idea is that the master password is just a password like any other, so I can store it within the safe, say under an hardcoded name like "MASTER", ".lock", whatever. Then before storing a secret, I would check that the password hash match the one from the store. The salt could also be prepended to this "master" file, for easy retrieval. This would then set the workflow as follow: 1. User wants to store a secret, prompt for the master password 2. Read salt from the MASTER password file (first x bytes of the file) 3. Derivate key from password + salt 4. Try to decrypt the MASTER password file using the key 5. Store the secret, encrypted using the previously derived key If the MASTER password file cannot be decrypted, then the program will refuse to store the secret. This would require the user to initialise the store beforehand though, by providing the master password, to generate the first salt. Something seems fishy to me with this worflow, but I cannot put my finger on it... If anyone has a comment, idea, or whatever, everything is welcome! |
|||