React hook for symmetric authenticated encryption (XChaCha20-Poly1305 secretbox).
Uses the defaultKey from CryptoProvider when no key argument is given.
defaultKey
CryptoProvider
function SecretMessage() { const { encrypt, decrypt } = useEncrypt(); const sealed = encrypt("hello world", myHexKey); const opened = decrypt(sealed, myHexKey);} Copy
function SecretMessage() { const { encrypt, decrypt } = useEncrypt(); const sealed = encrypt("hello world", myHexKey); const opened = decrypt(sealed, myHexKey);}
React hook for symmetric authenticated encryption (XChaCha20-Poly1305 secretbox).
Uses the
defaultKeyfromCryptoProviderwhen no key argument is given.