Polkadot Apps
    Preparing search index...

    Function xchachaEncryptText

    • Encrypt a UTF-8 string with XChaCha20-Poly1305.

      Parameters

      • plaintext: string

        The string to encrypt.

      • key: Uint8Array

        32-byte encryption key.

      Returns { ciphertext: Uint8Array; nonce: Uint8Array }

      Object containing ciphertext and 24-byte nonce.

      If key is not exactly 32 bytes.