I'm creating a password management application and I'm considering using the following procedure to keep passwords safe:
Asking the user for
raw_password, for example "MyLongMasterKeyPassword"
raw_passwordwith Scrypt and a random
raw_message(the password to store)
cipherusing AEAD-ChaCha20Poly1305IETF and generating a random
nonce, and then asking for
AD, then using the
nonceonce for encryption, that returning
nonce, then asking for
raw_passwordto regenerate the
master_keywith the stored
salt, and then generating a
nonce, which returns the
decrypted_message(a password, probably)
Now, the question is, is this procedure safe? Specifically, is it safe to re-use the same nonce for decryption an indefinite amount of times, if you only use it once for encryption?