Table of Contents

Class Seed

Namespace
CryptoHives.Foundation.Security.Cryptography.Cipher
Assembly
CryptoHives.Foundation.Security.Cryptography.dll

SEED symmetric cipher implementation (KISA, RFC 4269).

public sealed class Seed : SymmetricCipher, IDisposable
Inheritance
Seed
Implements
Inherited Members

Remarks

SEED is a 128-bit block cipher with a 128-bit key, developed by KISA (Korea Information Security Agency) and standardized as a Korean national standard (TTAS.KO-12.0004). It uses a 16-round Feistel structure.

Security level: 128 bits (quantum: 64 bits with Grover's algorithm)

Example usage:

using var seed = Seed.Create();
seed.GenerateKey();
seed.GenerateIV();

byte[] ciphertext = seed.Encrypt(plaintext); byte[] decrypted = seed.Decrypt(ciphertext);

Constructors

Seed()

Initializes a new instance of the Seed class.

public Seed()

Fields

KeySizeBits

Key size in bits for SEED.

public const int KeySizeBits = 128

Field Value

int

KeySizeBytes

Key size in bytes for SEED.

public const int KeySizeBytes = 16

Field Value

int

Properties

AlgorithmName

Gets the name of the cipher algorithm.

public override string AlgorithmName { get; }

Property Value

string

Examples

"AES-256", "ChaCha20", "AES-256-GCM"

IVSize

Gets the required IV/nonce size in bytes for the current mode.

public override int IVSize { get; }

Property Value

int

Methods

Create()

Creates a new instance of the Seed cipher.

public static Seed Create()

Returns

Seed

A new SEED cipher instance.

CreateCipherDecryptor(ReadOnlySpan<byte>, ReadOnlySpan<byte>)

Creates a decryptor transform using the specified key and IV.

protected override ICipherTransform CreateCipherDecryptor(ReadOnlySpan<byte> key, ReadOnlySpan<byte> iv)

Parameters

key ReadOnlySpan<byte>

The secret key.

iv ReadOnlySpan<byte>

The initialization vector or nonce.

Returns

ICipherTransform

A new cipher decryptor transform.

CreateCipherEncryptor(ReadOnlySpan<byte>, ReadOnlySpan<byte>)

Creates an encryptor transform using the specified key and IV.

protected override ICipherTransform CreateCipherEncryptor(ReadOnlySpan<byte> key, ReadOnlySpan<byte> iv)

Parameters

key ReadOnlySpan<byte>

The secret key.

iv ReadOnlySpan<byte>

The initialization vector or nonce.

Returns

ICipherTransform

A new cipher encryptor transform.