Skip to content

Commit

Permalink
g
Browse files Browse the repository at this point in the history
  • Loading branch information
komuw committed Sep 16, 2024
1 parent 1ded99e commit 48be82c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cry/enc.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ func (e Enc) Encrypt(plainTextMsg string) (encryptedMsg []byte) {
)

// Encrypt the message and append the ciphertext to the nonce.
//
// version as additionalData ensures that encryption/decryption will fail if using different versions of `ong/cry`
// another option would be to prepend the version similar to salt.
encrypted := e.aead.Seal(nonce, nonce, msgToEncrypt, []byte{version})

// Append the salt & nonce to encrypted msg.
Expand Down

0 comments on commit 48be82c

Please sign in to comment.