Simple encryption software - Security & Cryptography

Users browsing this thread: 2 Guest(s)
z3bra
Grey Hair Nixers
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!


Messages In This Thread
Simple encryption software - by z3bra - 05-04-2019, 09:00 AM
RE: Simple encryption software - by z3bra - 11-04-2019, 09:18 AM
RE: Simple encryption software - by venam - 11-04-2019, 09:42 AM
RE: Simple encryption software - by z3bra - 12-04-2019, 05:49 AM
RE: Simple encryption software - by venam - 12-04-2019, 05:54 AM
RE: Simple encryption software - by pkal - 12-04-2019, 12:19 PM
RE: Simple encryption software - by z3bra - 12-04-2019, 01:54 PM
RE: Simple encryption software - by z3bra - 19-04-2019, 09:02 AM
RE: Simple encryption software - by tudurom - 19-04-2019, 04:07 PM
RE: Simple encryption software - by z3bra - 20-04-2019, 05:47 AM
RE: Simple encryption software - by z3bra - 23-05-2019, 05:03 PM
RE: Simple encryption software - by Doom - 24-05-2019, 06:58 PM
RE: Simple encryption software - by z3bra - 25-05-2019, 02:31 AM
RE: Simple encryption software - by tudurom - 25-05-2019, 05:51 PM
RE: Simple encryption software - by z3bra - 27-05-2019, 06:14 AM
RE: Simple encryption software - by Doom - 28-05-2019, 05:28 PM
RE: Simple encryption software - by z3bra - 29-05-2019, 03:30 AM
RE: Simple encryption software - by z3bra - 31-05-2019, 06:46 PM
RE: Simple encryption software - by Halfwit - 31-05-2019, 06:54 PM
RE: Simple encryption software - by Halfwit - 31-05-2019, 06:59 PM
RE: Simple encryption software - by z3bra - 01-06-2019, 03:34 AM
RE: Simple encryption software - by Halfwit - 01-06-2019, 03:37 AM
RE: Simple encryption software - by z3bra - 01-06-2019, 04:27 AM
RE: Simple encryption software - by Halfwit - 01-06-2019, 01:00 PM
RE: Simple encryption software - by Halfwit - 01-06-2019, 01:02 PM
RE: Simple encryption software - by z3bra - 13-06-2019, 03:49 AM
RE: Simple encryption software - by tudurom - 09-07-2019, 03:12 PM
RE: Simple encryption software - by tudurom - 09-07-2019, 04:05 PM
RE: Simple encryption software - by z3bra - 10-07-2019, 08:40 AM
RE: Simple encryption software - by z3bra - 10-08-2020, 05:37 PM
RE: Simple encryption software - by pranomostro - 11-08-2020, 07:08 PM
RE: Simple encryption software - by z3bra - 12-08-2020, 04:59 AM