Crypto React
    Preparing search index...

    Function useEncrypt

    • React hook for symmetric authenticated encryption (XChaCha20-Poly1305 secretbox).

      Uses the defaultKey from CryptoProvider when no key argument is given.

      Returns UseEncryptResult

      function SecretMessage() {
      const { encrypt, decrypt } = useEncrypt();
      const sealed = encrypt("hello world", myHexKey);
      const opened = decrypt(sealed, myHexKey);
      }