• Overview
  • Design
  • API Reference
  • Changelog
  • Contribute
Show / Hide Table of Contents
  • Libplanet
    • Address
    • AddressExtension
    • ByteUtil
    • Hashcash
    • Hashcash.Stamp
    • HashDigest<T>
    • HashDigestExtension
    • Nonce
  • Libplanet.Action
    • AccountStateGetter
    • ActionEvaluation
    • ActionTypeAttribute
    • IAccountStateDelta
    • IAction
    • IActionContext
    • IRandom
    • MissingActionTypeException
    • PolymorphicAction<T>
    • RandomExtension
    • UnexpectedlyTerminatedActionException
  • Libplanet.Blockchain
    • BlockChain<T>
    • BlockChain<T>.TipChangedEventArgs
    • IncompleteBlockStatesException
    • MineBlockEventArgs<T>
  • Libplanet.Blockchain.Policies
    • BlockPolicy<T>
    • IBlockPolicy<T>
  • Libplanet.Blocks
    • Block<T>
    • InvalidBlockDifficultyException
    • InvalidBlockException
    • InvalidBlockHashException
    • InvalidBlockIndexException
    • InvalidBlockNonceException
    • InvalidBlockPreviousHashException
    • InvalidBlockTimestampException
    • InvalidGenesisBlockException
  • Libplanet.Crypto
    • CryptoConfig
    • DefaultCryptoBackend
    • ICryptoBackend
    • InvalidCiphertextException
    • PrivateKey
    • PublicKey
    • SymmetricKey
  • Libplanet.KeyStore
    • IncorrectPassphraseException
    • InvalidKeyJsonException
    • KeyJsonException
    • MismatchedAddressException
    • ProtectedPrivateKey
    • UnsupportedKeyJsonException
  • Libplanet.KeyStore.Ciphers
    • Aes128Ctr
    • ICipher
  • Libplanet.KeyStore.Kdfs
    • IKdf
    • Pbkdf2<T>
    • Scrypt
  • Libplanet.Net
    • ActionExecutionState
    • BlockDownloadState
    • BoundPeer
    • DifferentAppProtocolVersionException
    • DifferentProtocolVersionEventArgs
    • IceServer
    • IceServerException
    • InvalidMessageException
    • NoSwarmContextException
    • Peer
    • PeerNotFoundException
    • PeerState
    • PreloadBlockDownloadFailEventArgs
    • PreloadState
    • StateDownloadState
    • Swarm<T>
    • SwarmException
  • Libplanet.Net.Protocols
    • PeerDiscoveryException
  • Libplanet.Serialization
    • SerializationInfoExtension
  • Libplanet.Store
    • BaseIndex<TKey, TVal>
    • BaseStore
    • BlockSet<T>
    • ChainIdNotFoundException
    • DefaultStore
    • IStore
    • StoreExtension
    • TransactionSet<T>
  • Libplanet.Tx
    • InvalidTxException
    • InvalidTxIdException
    • InvalidTxNonceException
    • InvalidTxPublicKeyException
    • InvalidTxSignatureException
    • InvalidTxUpdatedAddressesException
    • Transaction<T>
    • TxId

Class Aes128Ctr

AES-128-CTR (AES 128-bit in counter moder).

Inheritance
Object
Aes128Ctr
Implements
ICipher
Namespace: Libplanet.KeyStore.Ciphers
Assembly: Libplanet.dll
Syntax
public sealed class Aes128Ctr : object, ICipher

Constructors

| Improve this Doc View Source

Aes128Ctr(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.

| Improve this Doc View Source

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 Source

Iv

Initialization vector.

Declaration
public ImmutableArray<byte> Iv { get; }
Property Value
Type Description
ImmutableArray<Byte>

Methods

| Improve this Doc View Source

Decrypt(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 array to decrypt.

Returns
Type Description
ImmutableArray<Byte>

The plain text decrypted from the ciphertext using the key.

| Improve this Doc View Source

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 array to encrypt.

Returns
Type Description
ImmutableArray<Byte>

The ciphertext made from the plaintext using the key.

| Improve this Doc View Source

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 crypto.cipher field in the key JSON file.

Implements

ICipher
  • Improve this Doc
  • View Source
Back to top Copyright © 2019–2020 Planetarium