Skip to content

SealCipher

Namespace Nfty.Core.Publish in assembly Nfty.Core.

public record SealCipher

How the payload was encrypted.

Constructors

SealCipher(string, int, int, long, string)

public SealCipher(string Algorithm, int FrameBytes, int Frames, long PlainBytes, string NoncePrefix);

Parameters

  • Algorithm (string) - The AEAD name.
  • FrameBytes (int) - Plaintext bytes per frame. The payload is encrypted in independently authenticated frames so a 4 GB collection never has to be held in memory to be read or written.
  • Frames (int) - How many frames the payload holds.
  • PlainBytes (long) - The plaintext length, which is what gives the final (short) frame its size. Both are in the AAD of every frame, so a truncated payload fails to authenticate rather than decrypting to a shorter collection.
  • NoncePrefix (string) - The four random bytes every frame nonce begins with, hex. The remaining eight are the frame index, so no nonce can repeat under one key.

Properties

Algorithm

public string Algorithm { get; init; }

The AEAD name.

FrameBytes

public int FrameBytes { get; init; }

Plaintext bytes per frame. The payload is encrypted in independently authenticated frames so a 4 GB collection never has to be held in memory to be read or written.

Frames

public int Frames { get; init; }

How many frames the payload holds.

NoncePrefix

public string NoncePrefix { get; init; }

The four random bytes every frame nonce begins with, hex. The remaining eight are the frame index, so no nonce can repeat under one key.

PlainBytes

public long PlainBytes { get; init; }

The plaintext length, which is what gives the final (short) frame its size. Both are in the AAD of every frame, so a truncated payload fails to authenticate rather than decrypting to a shorter collection.