Use multiple KDFs (add Scrypt for AES256)

This commit is contained in:
2025-05-08 17:26:12 +00:00
parent ce0b5d4bf5
commit ac5314396e
4 changed files with 24 additions and 11 deletions
+2 -2
View File
@@ -19,7 +19,7 @@ func encryptCha(data []byte, passphrase []byte) []byte {
io.ReadFull(rand.Reader, salt)
// derive key from passphrase using the salt
key := deriveKey(passphrase, salt)
key := deriveKeyArgon2(passphrase, salt)
// create ChaCha20-Poly1305 cipher
stream, _ := chacha20poly1305.NewX(key)
@@ -52,7 +52,7 @@ func decryptCha(encryptedData []byte, passphrase []byte) ([]byte, error) {
ciphertext := encryptedData[saltSize+nonceSizeCha:]
// derive key from passphrase using the salt
key := deriveKey(passphrase, salt)
key := deriveKeyArgon2(passphrase, salt)
// create ChaCha20-Poly1305 cipher
stream, _ := chacha20poly1305.NewX(key)