Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CryptoModule

Crypto functions.

Hierarchy

  • CryptoModule

Index

Constructors

Properties

Methods

Constructors

Properties

client: IClient

Methods

  • Removes cached secrets (overwrites with zeroes) from all signing and encryption boxes, derived from crypto box.

    Parameters

    Returns Promise<void>

  • Removes cached secrets (overwrites with zeroes) from all signing and encryption boxes, derived from crypto box.

    NOTE: Available only for lib-node binding.

    Parameters

    Returns void

  • Creates a Crypto Box instance.

    remarks

    Crypto Box is a root crypto object, that encapsulates some secret (seed phrase usually) in encrypted form and acts as a factory for all crypto primitives used in SDK: keys for signing and encryption, derived from this secret.

    Crypto Box encrypts original Seed Phrase with salt and password that is retrieved from password_provider callback, implemented on Application side.

    When used, decrypted secret shows up in core library's memory for a very short period of time and then is immediately overwritten with zeroes.

    Parameters

    Returns Promise<RegisteredCryptoBox>

    RegisteredCryptoBox

  • Creates a Crypto Box instance.

    remarks

    Crypto Box is a root crypto object, that encapsulates some secret (seed phrase usually) in encrypted form and acts as a factory for all crypto primitives used in SDK: keys for signing and encryption, derived from this secret.

    Crypto Box encrypts original Seed Phrase with salt and password that is retrieved from password_provider callback, implemented on Application side.

    When used, decrypted secret shows up in core library's memory for a very short period of time and then is immediately overwritten with zeroes.

    NOTE: Available only for lib-node binding.

    Parameters

    Returns RegisteredCryptoBox

    RegisteredCryptoBox

  • Decrypts data using given encryption box Note.

    remarks

    Block cipher algorithms pad data to cipher block size so encrypted data can be longer then original data. Client should store the original data size after encryption and use it after decryption to retrieve the original data from decrypted data.

    Parameters

    Returns Promise<ResultOfEncryptionBoxDecrypt>

    ResultOfEncryptionBoxDecrypt

  • Decrypts data using given encryption box Note.

    remarks

    Block cipher algorithms pad data to cipher block size so encrypted data can be longer then original data. Client should store the original data size after encryption and use it after decryption to retrieve the original data from decrypted data.

    NOTE: Available only for lib-node binding.

    Parameters

    Returns ResultOfEncryptionBoxDecrypt

    ResultOfEncryptionBoxDecrypt

  • Encrypts data using given encryption box Note.

    remarks

    Block cipher algorithms pad data to cipher block size so encrypted data can be longer then original data. Client should store the original data size after encryption and use it after decryption to retrieve the original data from decrypted data.

    Parameters

    Returns Promise<ResultOfEncryptionBoxEncrypt>

    ResultOfEncryptionBoxEncrypt

  • Encrypts data using given encryption box Note.

    remarks

    Block cipher algorithms pad data to cipher block size so encrypted data can be longer then original data. Client should store the original data size after encryption and use it after decryption to retrieve the original data from decrypted data.

    NOTE: Available only for lib-node binding.

    Parameters

    Returns ResultOfEncryptionBoxEncrypt

    ResultOfEncryptionBoxEncrypt

  • generate_random_sign_keys(): Promise<KeyPair>
  • generate_random_sign_keys_sync(): KeyPair
  • Generates random ed25519 key pair.

    NOTE: Available only for lib-node binding.

    Returns KeyPair

    KeyPair

  • Get Crypto Box Info. Used to get encrypted_secret that should be used for all the cryptobox initializations except the first one.

    NOTE: Available only for lib-node binding.

    Parameters

    Returns ResultOfGetCryptoBoxInfo

    ResultOfGetCryptoBoxInfo

  • Get Crypto Box Seed Phrase.

    remarks

    Attention! Store this data in your application for a very short period of time and overwrite it with zeroes ASAP.

    NOTE: Available only for lib-node binding.

    Parameters

    Returns ResultOfGetCryptoBoxSeedPhrase

    ResultOfGetCryptoBoxSeedPhrase

  • Gets Encryption Box from Crypto Box.

    remarks

    Derives encryption keypair from cryptobox secret and hdpath and stores it in cache for secret_lifetime or until explicitly cleared by clear_crypto_box_secret_cache method. If secret_lifetime is not specified - overwrites encryption secret with zeroes immediately after encryption operation.

    Parameters

    Returns Promise<RegisteredEncryptionBox>

    RegisteredEncryptionBox

  • Gets Encryption Box from Crypto Box.

    remarks

    Derives encryption keypair from cryptobox secret and hdpath and stores it in cache for secret_lifetime or until explicitly cleared by clear_crypto_box_secret_cache method. If secret_lifetime is not specified - overwrites encryption secret with zeroes immediately after encryption operation.

    NOTE: Available only for lib-node binding.

    Parameters

    Returns RegisteredEncryptionBox

    RegisteredEncryptionBox

  • Derives a key pair for signing from the seed phrase

    remarks

    Validates the seed phrase, generates master key and then derives the key pair from the master key and the specified path

    Parameters

    Returns Promise<KeyPair>

    KeyPair

  • Derives a key pair for signing from the seed phrase

    remarks

    Validates the seed phrase, generates master key and then derives the key pair from the master key and the specified path

    NOTE: Available only for lib-node binding.

    Parameters

    Returns KeyPair

    KeyPair

  • Validates a mnemonic phrase

    remarks

    The phrase supplied will be checked for word length and validated according to the checksum specified in BIP0039.

    NOTE: Available only for lib-node binding.

    Parameters

    Returns ResultOfMnemonicVerify

    ResultOfMnemonicVerify

  • Public key authenticated encryption

    remarks

    Encrypt and authenticate a message using the senders secret key, the receivers public key, and a nonce.

    Parameters

    Returns Promise<ResultOfNaclBox>

    ResultOfNaclBox

  • nacl_box_keypair(): Promise<KeyPair>
  • Generates a random NaCl key pair

    NOTE: Available only for lib-node binding.

    Returns KeyPair

    KeyPair

  • Public key authenticated encryption

    remarks

    Encrypt and authenticate a message using the senders secret key, the receivers public key, and a nonce.

    NOTE: Available only for lib-node binding.

    Parameters

    Returns ResultOfNaclBox

    ResultOfNaclBox

  • Signs the message using the secret key and returns a signature.

    remarks

    Signs the message unsigned using the secret key secret and returns a signature signature.

    Parameters

    Returns Promise<ResultOfNaclSignDetached>

    ResultOfNaclSignDetached

  • Signs the message using the secret key and returns a signature.

    remarks

    Signs the message unsigned using the secret key secret and returns a signature signature.

    NOTE: Available only for lib-node binding.

    Parameters

    Returns ResultOfNaclSignDetached

    ResultOfNaclSignDetached

  • Verifies the signature and returns the unsigned message

    remarks

    Verifies the signature in signed using the signer's public key public and returns the message unsigned.

    If the signature fails verification, crypto_sign_open raises an exception.

    Parameters

    Returns Promise<ResultOfNaclSignOpen>

    ResultOfNaclSignOpen

  • Verifies the signature and returns the unsigned message

    remarks

    Verifies the signature in signed using the signer's public key public and returns the message unsigned.

    If the signature fails verification, crypto_sign_open raises an exception.

    NOTE: Available only for lib-node binding.

    Parameters

    Returns ResultOfNaclSignOpen

    ResultOfNaclSignOpen

Generated using TypeDoc