Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
brainfoolong committed Nov 23, 2023
1 parent 0e4802f commit f91eb46
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ $decrypted = Ascon::decryptFromHex($key, $encrypted, $associatedData);

// raw usage (the original implementation with raw values)
$key = [0x90, 0x80, 0x70, 0x60, 0x50, 0x40, 0x30, 0x20, 0x10, 0xAA, 0x90, 0x90, 0x90, 0x90, 0xCC, 0xEF];
$nonce = [0x50, 0x10, 0x30, 0x70, 0x90, 0x60, 0x40, 0x30, 0xEF, 0x20, 0x10, 0xAA, 0x90, 0x90, 0x90, 0xCC];
$nonce = random_bytes(16);
$plaintext = "Hi, i am a secret message!";
$associatedData = "Some data the will not be encrypted but verified along the plaintext (Decryption will fail if you not provide the exact same data)";
$ciphertextByteArray = Ascon::encrypt($key, $nonce, $associatedData, $plaintext);
Expand Down

0 comments on commit f91eb46

Please sign in to comment.