pdf-lite - v1.0.1
    Preparing search index...
    • Creates an RC4 cipher for PDF encryption. RC4 is a symmetric stream cipher where encryption and decryption use the same operation (XOR with the key stream).

      Parameters

      • key: ByteArray

        The encryption key (variable length).

      Returns Cipher

      A Cipher object with encrypt and decrypt methods.

      const cipher = rc4(key)
      const encrypted = await cipher.encrypt(plaintext)
      const decrypted = await cipher.decrypt(encrypted)