Fake Mirrors
    Preparing search index...

    Function decrypt

    • Decrypts a URL-safe Base64 encoded ciphertext using AES-256-GCM.

      The process is as follows:

      1. The input is decoded from Base64 to binary data.
      2. The salt, IV, authentication tag, and ciphertext are extracted.
      3. The key is re-derived from the secret and extracted salt.
      4. The ciphertext is decrypted and verified using the auth tag.
      5. The decrypted data is decompressed using inflate.
      6. The final plaintext is returned as a string.

      Parameters

      • input: string

        The URL-safe Base64 encoded ciphertext. Must be a non-empty string.

      • secret: string

        The secret passphrase used for encryption. Must be a non-empty string.

      Returns string

      The decrypted and decompressed plaintext string.

      Error If input or secret is empty.

      Error If the decryption or decompression process fails.