Table of Contents

Class Kalyna256

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

Kalyna-256 symmetric cipher implementation (DSTU 7624:2014) with 128-bit block.

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

Remarks

Kalyna-256 uses a 128-bit block with a 256-bit key (14 rounds). This provides a higher security margin than Kalyna-128.

Constructors

Kalyna256()

Initializes a new instance of the Kalyna256 class.

public Kalyna256()

Fields

KeySizeBits

Key size in bits.

public const int KeySizeBits = 256

Field Value

int

KeySizeBytes

Key size in bytes.

public const int KeySizeBytes = 32

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 Kalyna256 cipher.

public static Kalyna256 Create()

Returns

Kalyna256

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.