Class Aes128Ctr
AES-128-CTR (AES 128-bit in counter moder).
Implements
Namespace: Libplanet.KeyStore.Ciphers
Assembly: Libplanet.dll
Syntax
public sealed class Aes128Ctr : object, ICipher
Constructors
| Improve this Doc View SourceAes128Ctr(ImmutableArray<Byte>)
Creates an Aes128Ctr instance with the given iv
.
Declaration
public Aes128Ctr(in ImmutableArray<byte> iv)
Parameters
Type | Name | Description |
---|---|---|
ImmutableArray<Byte> | iv | Initialization vector. |
Aes128Ctr(Byte[])
Creates an Aes128Ctr instance with the given iv
.
Declaration
public Aes128Ctr(byte[] iv)
Parameters
Type | Name | Description |
---|---|---|
Byte[] | iv | Initialization vector. |
Properties
| Improve this Doc View SourceIv
Initialization vector.
Declaration
public ImmutableArray<byte> Iv { get; }
Property Value
Type | Description |
---|---|
ImmutableArray<Byte> |
Methods
| Improve this Doc View SourceDecrypt(ImmutableArray<Byte>, ImmutableArray<Byte>)
Decrypts the given ciphertext
using the given key
.
Declaration
public ImmutableArray<byte> Decrypt(in ImmutableArray<byte> key, in ImmutableArray<byte> ciphertext)
Parameters
Type | Name | Description |
---|---|---|
ImmutableArray<Byte> | key | A symmetric key. |
ImmutableArray<Byte> | ciphertext | An immutable |
Returns
Type | Description |
---|---|
ImmutableArray<Byte> | The plain text decrypted from the |
Encrypt(ImmutableArray<Byte>, ImmutableArray<Byte>)
Encrypts the given plaintext
using the given key
.
Declaration
public ImmutableArray<byte> Encrypt(in ImmutableArray<byte> key, in ImmutableArray<byte> plaintext)
Parameters
Type | Name | Description |
---|---|---|
ImmutableArray<Byte> | key | A symmetric key. |
ImmutableArray<Byte> | plaintext | An immutable |
Returns
Type | Description |
---|---|
ImmutableArray<Byte> | The ciphertext made from the |
WriteJson(Utf8JsonWriter)
Dumps the cipher parameters as a JSON representation according to Ethereum's Web3 Secret Storage Definition.
Declaration
public string WriteJson(Utf8JsonWriter writer)
Parameters
Type | Name | Description |
---|---|---|
Utf8JsonWriter | writer | A JSON writer which has not begun object nor array. |
Returns
Type | Description |
---|---|
String | A unique identifier of the cipher algorithm. This is going to be the
|