Skip to content

Commit

Permalink
Fix minor spelling errors in the documenation for sodium_crypto_secre…
Browse files Browse the repository at this point in the history
…tbox and sodium_crypto_secretbox_open (#2646)
  • Loading branch information
michaelmawhinney authored Aug 5, 2023
1 parent 5e6bdba commit 660cdbf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ $key = random_bytes(SODIUM_CRYPTO_SECRETBOX_KEYBYTES);
$nonce = random_bytes(SODIUM_CRYPTO_SECRETBOX_NONCEBYTES);
$ciphertext = sodium_crypto_secretbox('message to be encrypted', $nonce, $key);
// The same nouce and key are required to decrypt the $ciphertext
// The same nonce and key are required to decrypt the $ciphertext
$plaintext = sodium_crypto_secretbox_open($ciphertext, $nonce, $key);
if ($plaintext !== false) {
echo $plaintext . PHP_EOL;
Expand Down
2 changes: 1 addition & 1 deletion reference/sodium/functions/sodium-crypto-secretbox.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ $plaintext = "message to be encrypted";
$ciphertext = sodium_crypto_secretbox($plaintext, $nonce, $key);
var_dump(bin2hex($ciphertext));
// The same nouce and key are required to decrypt the $ciphertext
// The same nonce and key are required to decrypt the $ciphertext
var_dump(sodium_crypto_secretbox_open($ciphertext, $nonce, $key));
?>
]]>
Expand Down

0 comments on commit 660cdbf

Please sign in to comment.