• 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 Scrypt

Scrypt.

Inheritance
Object
Scrypt
Implements
IKdf
Namespace: Libplanet.KeyStore.Kdfs
Assembly: Libplanet.dll
Syntax
public sealed class Scrypt : object, IKdf

Constructors

| Improve this Doc View Source

Scrypt(Int32, ImmutableArray<Byte>, Int32, Int32, Int32)

Configures parameters of Scrypt.

Declaration
public Scrypt(int cost, in ImmutableArray<byte> salt, int keyLength, int parallelization, int blockSize)
Parameters
Type Name Description
Int32 cost

The CPU/memory cost parameter. Corresponds to n.

ImmutableArray<Byte> salt

A cryptographic salt.

Int32 keyLength

The desired byte-length of the derived key. Corresponds to dkLen except that it's not bit-wise but byte-wise.

Int32 parallelization

The parallelization parameter. Corresponds to p.

Int32 blockSize

The blocksize parameter. Corresponds to r.

| Improve this Doc View Source

Scrypt(Int32, Byte[], Int32, Int32, Int32)

Configures parameters of Scrypt.

Declaration
public Scrypt(int cost, byte[] salt, int keyLength, int parallelization, int blockSize)
Parameters
Type Name Description
Int32 cost

The CPU/memory cost parameter. Corresponds to n.

Byte[] salt

A cryptographic salt.

Int32 keyLength

The desired byte-length of the derived key. Corresponds to dkLen except that it's not bit-wise but byte-wise.

Int32 parallelization

The parallelization parameter. Corresponds to p.

Int32 blockSize

The blocksize parameter. Corresponds to r.

Properties

| Improve this Doc View Source

BlockSize

The blocksize parameter. Corresponds to r.

Declaration
public int BlockSize { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

Cost

The CPU/memory cost parameter. Corresponds to n.

Declaration
public int Cost { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

KeyLength

The desired byte-length of the derived key. Corresponds to dkLen except that it's not bit-wise but byte-wise.

Declaration
public int KeyLength { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

Parallelization

The parallelization parameter. Corresponds to p.

Declaration
public int Parallelization { get; }
Property Value
Type Description
Int32
| Improve this Doc View Source

Salt

A cryptographic salt.

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

Methods

| Improve this Doc View Source

Derive(String)

Derives a cryptographic key in s from a user input passphrase.

Declaration
public ImmutableArray<byte> Derive(string passphrase)
Parameters
Type Name Description
String passphrase

A user input passphrase.

Returns
Type Description
ImmutableArray<Byte>

A derived cryptographic key.

| Improve this Doc View Source

WriteJson(Utf8JsonWriter)

Dumps the KDF parameters as a JSON representation.

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 KDF. This is going to be the crypto.kdf field in the key JSON file.

Implements

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