Crypto Testing
    Preparing search index...

    Function mockEncrypt

    • XOR-based fast fake encryption. Returns a hex-encoded "ciphertext" that can be round-tripped with mockDecrypt.

      Parameters

      • key: string

        Hex-encoded 256-bit key.

      • plaintext: string | Uint8Array<ArrayBufferLike>

        UTF-8 string or bytes to encrypt.

      Returns string

      Hex-encoded "ciphertext".

      import { mockEncrypt, TEST_KEYS } from "@sebastienrousseau/crypto-testing";

      const ct = mockEncrypt(TEST_KEYS.aes256, "hello world");