Skip to content

Block crypto

Bruce Wayne edited this page Jul 28, 2021 · 3 revisions

Create

AES

IBlockCrypto ecb = AESUtils.CreateECB(ReadOnlySpan<byte> key);
IBlockCrypto cbc = AESUtils.CreateCBC(ReadOnlySpan<byte> key, ReadOnlySpan<byte> iv);

SM4

IBlockCrypto ecb = new SM4Crypto(ReadOnlySpan<byte> key); //ECB
IBlockCrypto cbc = new CBCBlockMode(ecb, ReadOnlySpan<byte> iv); //CBC

Properties

Property Description
Name Name of the crypto
BlockSize Block size of the crypto

Methods

Method Description
void Encrypt(ReadOnlySpan<byte>, Span<byte>) Encrypt a block of the data
void Decrypt(ReadOnlySpan<byte>, Span<byte>) Decrypt a block of the data
void Encrypt4(ReadOnlySpan<byte>, Span<byte>) Encrypt four block of the data
void Reset() Reset the state
void Dispose() Releases the resources

Data format extensions

KDF

Symmetric crypto

Clone this wiki locally