Quasor

Quasor: A High-Security AEAD

Version 6.0

1. Introduction and Goals

Quasor is a high-security Authenticated Encryption with Associated Data (AEAD) scheme designed for modern applications where robustness and defense-in-depth are paramount. It is built on a Duplex Sponge construction using SHAKE256 and incorporates several advanced features to provide strong protection against both implementation errors and sophisticated attacks.

The primary design goals achieved in this version are:

2. Cryptographic Primitives

3. Key Derivation Process

The master key K for the cipher is derived from a user-provided password and a unique salt using Argon2id.

  1. Inputs: A user password (variable length) and a unique salt (minimum 8 bytes).
  2. Hashing: The Argon2id function is called with its default secure parameters (as of v0.5) to produce a 32-byte (256-bit) master key K.
  3. Security: This process is intentionally slow and memory-intensive to make offline brute-force and dictionary attacks computationally infeasible.

4. Encryption Process

Inputs:

Procedure:

  1. Nonce Derivation (SIV):

    a. A 128-bit nonce N is derived by computing the keyed hash of the associated data and the plaintext using a secure, unambiguous serialization.

    b. The exact structure to be hashed is: len(A)   A   len(P)   P, where len() is the length in bytes, encoded as a 64-bit little-endian integer.

    c. For large inputs, the hashing of P is automatically parallelized using Rayon for high performance.

  2. Initialization:

    a. A new SHAKE256 sponge instance is initialized.

    b. The master key K, the derived nonce N, and the associated data A are absorbed into the sponge.

  3. Encryption, Duplexing, and Rekeying:

    a. The plaintext P is processed sequentially in chunks of REKEY_INTERVAL size (1 MiB).

    b. For each block within a chunk, a keystream is squeezed from the sponge and XORed with the plaintext to produce ciphertext. The original plaintext block is then absorbed back into the sponge’s state.

    c. After each 1 MiB chunk is processed (except the last), a rekeying step is performed: 32 bytes are squeezed from the sponge to form an ephemeral key, which is then immediately absorbed back into the state. This provides forward secrecy.

  4. Tag Generation:

    a. After all plaintext has been processed, a 32-byte authentication tag T is squeezed from the sponge’s final state.

Outputs:

5. Decryption Process

Inputs:

Procedure:

  1. Initialization & Decryption: The decryption process mirrors the encryption process exactly: the sponge is initialized with K, N, and A, and the ciphertext is processed sequentially to reconstruct the plaintext, with identical rekeying steps performed along the way.

  2. Tag Verification:

    a. After all ciphertext is processed, an expected tag T’ is squeezed from the sponge’s final state.

    b. The received tag T must be compared to the computed tag T’ using a constant-time equality function. This is a critical step to prevent timing side-channel attacks. If they do not match, the process aborts, and an error is returned.

  3. Nonce Verification:

    a. If the tag is valid, the SIV nonce is re-derived using the newly decrypted plaintext P and the same length-prefixed serialization as in encryption.

    b. This re-derived nonce N’ is compared to the received nonce N. If they do not match, the process aborts, and an error is returned. This final check ensures the integrity of the entire message.

Output:

6. Design Rationale and Security Considerations