Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "scrypt"

Index

Functions

checkCtrDecrypted

  • checkCtrDecrypted(saltOrAddress: string | Address, publicKeyEncoded: string): void
  • Checks if the password supplied to decrypt was correct.

    This method was taken out from decrypt, because it needs to create public key from private key and it needs to be supplied from outside.

    Parameters

    • saltOrAddress: string | Address

      4 hex encoded bytes salt or Address object

    • publicKeyEncoded: string

      Public key from decrypted key

    Returns void

checkEcbDecrypted

  • checkEcbDecrypted(encryptedKey: string, decryptedKey: string, publicKeyEncoded: string): void
  • Checks if the password supplied to decrypt was correct.

    This method was taken out from decrypt, because it needs to create public key from private key and it needs to be supplied from outside.

    Parameters

    • encryptedKey: string

      Original encrypted key

    • decryptedKey: string

      Decrypted key with decrypt

    • publicKeyEncoded: string

      Public key from decrypted key

    Returns void

decryptWithCtr

  • decryptWithCtr(encryptedKey: string, keyphrase: string, saltOrAddress: string | Address, scryptParams?: ScryptParams): string
  • Decrypt with aes-ctr

    Parameters

    • encryptedKey: string

      encrypted private key

    • keyphrase: string

      user's password to encrypt private key

    • saltOrAddress: string | Address

      4 hex encoded bytes salt or Address object

    • Default value scryptParams: ScryptParams = DEFAULT_SCRYPT

    Returns string

decryptWithEcb

  • decryptWithEcb(encryptedKey: string, keyphrase: string, scryptParams?: ScryptParams): string
  • Decrypt with aes-ecb

    Parameters

    • encryptedKey: string
    • keyphrase: string
    • Default value scryptParams: ScryptParams = DEFAULT_SCRYPT

    Returns string

decryptWithGcm

  • decryptWithGcm(encrypted: string, address: Address, salt: string, keyphrase: string, scryptParams?: ScryptParams): string
  • Decrypt with aes-256-gcm

    Parameters

    • encrypted: string

      Encrypted private key

    • address: Address

      Address to decrypt with

    • salt: string

      Salt to decrypt with

    • keyphrase: string

      User's password

    • Default value scryptParams: ScryptParams = DEFAULT_SCRYPT

      Optioanl params to decrypt with

    Returns string

encryptWithCtr

  • encryptWithCtr(privateKey: string, publicKeyEncoded: string, keyphrase: string, scryptParams?: ScryptParams): string
  • Encrypt with aes-ctr

    Parameters

    • privateKey: string
    • publicKeyEncoded: string
    • keyphrase: string
    • Default value scryptParams: ScryptParams = DEFAULT_SCRYPT

    Returns string

encryptWithEcb

  • encryptWithEcb(privateKey: string, publicKeyEncoded: string, keyphrase: string, scryptParams?: ScryptParams): string
  • Encrypt with aes-ecb

    Parameters

    • privateKey: string
    • publicKeyEncoded: string
    • keyphrase: string
    • Default value scryptParams: ScryptParams = DEFAULT_SCRYPT

    Returns string

encryptWithGcm

  • encryptWithGcm(privateKey: string, address: Address, salt: string, keyphrase: string, scryptParams?: ScryptParams): string
  • Encrypt with aes-gcm-256 This is the default encryption algorithm for private key

    Parameters

    • privateKey: string

      Private key to encpryt with

    • address: Address

      Adderss to encrypt with

    • salt: string

      Salt to encrypt with

    • keyphrase: string

      User's password

    • Default value scryptParams: ScryptParams = DEFAULT_SCRYPT

      Optional params to encrypt

    Returns string

scrypt

  • scrypt(keyphrase: string, addressHash: string, params: ScryptParams): Buffer
  • Synchronious call to scrypt-async-js.

    Parameters

    • keyphrase: string

      Keyphrase to use

    • addressHash: string

      Hex encoded address

    • params: ScryptParams

      Scrypt params

    Returns Buffer

Generated using TypeDoc