Namespace Libplanet.Crypto
Classes
CryptoConfig
Libplanet cryptography configuration information.
DefaultCryptoBackend<T>
GenerateKeyParamTriesExceedException
InvalidCiphertextException
PrivateKey
A secret part of a key pair involved in ECDSA, the digital signature algorithm on which the Libplanet is based. It can be used to create signatures, which can be verified with the corresponding PublicKey, as well as to decrypt messages which were encrypted with the corresponding PublicKey.
Note that it uses secp256k1 as the parameters of the elliptic curve, which is the same to Bitcoin and Ethereum. It means private keys generated for Bitcoin/Ethereum can be used by Libplanet-backed games/apps too.
PublicKey
A public part of a key pair involved in ECDSA, the digital signature algorithm on which the Libplanet is based. It can be used to verify signatures created with the corresponding PrivateKey and to encrypt messages for someone possessing the corresponding PrivateKey. This can be distributed publicly, hence the name.
Note that it uses secp256k1 as the parameters of the elliptic curve, which is same to Bitcoin and Ethereum. It means public keys generated for Bitcoin/Ethereum can be used by Libplanet-backed games/apps too.
SymmetricKey
An AES-GCM symmetric key. Unlike PrivateKey and PublicKey that are involved in an asymmetric key cryptography, it uses the same SymmetricKey for both encrypting a plaintext and decrypting a ciphertext.
Structs
Address
An identifier of 20 bytes (or 40 letters in hexadecimal, commonly with
a prefix 0x
) that refers to a unique account.
It is derived from the corresponding PublicKey of an account, but as a derivation loses information, it is always unidirectional.
The address derivation from a public key is as follows:
- Calculates the Keccak-256, which is a previous form of SHA-3 before NIST standardized it and does not follow FIPS-202, of the corresponding PublicKey.
- Takes only the last 20 bytes of the calculated Keccak-256 hash.
- When the address needs to be shown to end users,
displays these 20 bytes in hexadecimal, with a prefix
0x
.
Since the scheme of the address derivation and the PrivateKey/PublicKey is the same to Ethereum, Ethereum addresses can be used by Libplanet-backed games/apps too.
Interfaces
ICryptoBackend<T>
Cryptography backend interface.