Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@burstjs/crypto

Package Overview
Dependencies
Maintainers
2
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@burstjs/crypto

Cryptographic functions for building Burstcoin apps.

  • 0.5.0-beta.11
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
27
increased by35%
Maintainers
2
Weekly downloads
 
Created
Source

@burstjs/crypto

Cryptographic functions for building Burstcoin apps.

Installation

burstJS can be used with NodeJS or Web. Two formats are available

Using with NodeJS and/or modern web frameworks

Install using npm:

npm install @burstjs/crypto

or using yarn:

yarn add @burstjs/crypto
Example
import {encryptAES, decryptAES, hashSHA256} from '@burstjs/crypto'

const encrypted = encryptAES('test', 'key')
const decrypted = decryptAES(encrypted, 'key')
console.log(hashSHA256('test'))
console.log(decrypted)

Using in classic <script>

Each package is available as bundled standalone library using IIFE. This way burstJS can be used also within <script>-Tags. This might be useful for Wordpress and/or other PHP applications.

Just import the package using the HTML <script> tag.

<script src='https://cdn.jsdelivr.net/npm/@burstjs/crypto/dist/burstjs.crypto.min.js'></script>

Example
const encrypted = b$crypto.encryptAES("test", "key");
const decrypted = b$crypto.decryptAES(encrypted, "key");
console.log(b$crypto.hashSHA256("test"));
console.log(decrypted);

See more here:

@burstjs/crypto Online Documentation


API Reference

Modules

crypto

crypto

crypto.getAccountIdFromPublicKey ⇒

Arbitrary length hexadecimal to decimal conversion https://stackoverflow.com/questions/21667377/javascript-hexadecimal-string-to-decimal-string

Kind: static property of crypto
Returns:

A decimal string

ParamDescription
s

A hexadecimal string

crypto~Converter

A set of useful converter methods for crypto operations.

Kind: inner class of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~decryptAES(encryptedBase64, key) ⇒

Decrypt an encrypted message

Kind: inner method of crypto
Returns:

The decrypted content

ParamDescription
encryptedBase64

encrypted data in base64 format

key

The secret key

crypto~decryptData(encryptedData, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted cipher text

Kind: inner method of crypto
Returns:

The original plain text

ParamDescription
encryptedData

The encrypted data

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~decryptMessage(encryptedMessage, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted Message

Kind: inner method of crypto
Returns:

The original message

ParamDescription
encryptedMessage

The encrypted message

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~encryptData(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts arbitrary data

Kind: inner method of crypto
Returns:

The encrypted Data

ParamDescription
plaintext

Data to be encrypted

recipientPublicKeyHex

The recipients public key in hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~encryptMessage(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts a message (UTF-8 compatible)

Kind: inner method of crypto
Returns:

The encrypted Message

ParamDescription
plaintext

Message to be encrypted

recipientPublicKeyHex

The recipients public key hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~generateMasterKeys(passPhrase) ⇒

Generate the Master Public Key and Master Private Key for a new passphrase

Kind: inner method of crypto
Returns:

EC-KCDSA sign key pair + agreement key

ParamDescription
passPhrase

The passphrase

crypto~generateSignature(messageHex, privateKey)

Generate a signature for the transaction

Method:

 s = sign(sha256(sha256(transactionHex)_keygen(sha256(sha256(transactionHex)_privateKey)).publicKey),
         sha256(sha256(transactionHex)_privateKey),
         privateKey)
 p = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)

Kind: inner method of crypto

ParamDescription
messageHex

The data in hexadecimal representation

privateKey

The private key for signing

crypto~generateSignedTransactionBytes(unsignedTransactionHex, signature) ⇒

Generates a signed message digest

Kind: inner method of crypto
Returns:

The signed message digest

ParamDescription
unsignedTransactionHex

The unsigned message

signature

The signature

crypto~getAccountIdFromPublicKey(publicKey) ⇒

Convert hex string of the public key to the account id

Kind: inner method of crypto
Returns:

The numeric account Id

ParamDescription
publicKey

The public key

crypto~verifySignature(signature, messageHex, publicKey)

Verify a signature for given message

  • Method:
* h1 = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)
==
sha256(sha256(transactionHex)_verify(v, h1, publickey)) = h2

Kind: inner method of crypto

ParamDescription
signature

The signature to be verified

messageHex

The message data in hexadecimal representation

publicKey

The public key

crypto

crypto.getAccountIdFromPublicKey ⇒

Arbitrary length hexadecimal to decimal conversion https://stackoverflow.com/questions/21667377/javascript-hexadecimal-string-to-decimal-string

Kind: static property of crypto
Returns:

A decimal string

ParamDescription
s

A hexadecimal string

crypto~Converter

A set of useful converter methods for crypto operations.

Kind: inner class of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~decryptAES(encryptedBase64, key) ⇒

Decrypt an encrypted message

Kind: inner method of crypto
Returns:

The decrypted content

ParamDescription
encryptedBase64

encrypted data in base64 format

key

The secret key

crypto~decryptData(encryptedData, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted cipher text

Kind: inner method of crypto
Returns:

The original plain text

ParamDescription
encryptedData

The encrypted data

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~decryptMessage(encryptedMessage, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted Message

Kind: inner method of crypto
Returns:

The original message

ParamDescription
encryptedMessage

The encrypted message

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~encryptData(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts arbitrary data

Kind: inner method of crypto
Returns:

The encrypted Data

ParamDescription
plaintext

Data to be encrypted

recipientPublicKeyHex

The recipients public key in hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~encryptMessage(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts a message (UTF-8 compatible)

Kind: inner method of crypto
Returns:

The encrypted Message

ParamDescription
plaintext

Message to be encrypted

recipientPublicKeyHex

The recipients public key hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~generateMasterKeys(passPhrase) ⇒

Generate the Master Public Key and Master Private Key for a new passphrase

Kind: inner method of crypto
Returns:

EC-KCDSA sign key pair + agreement key

ParamDescription
passPhrase

The passphrase

crypto~generateSignature(messageHex, privateKey)

Generate a signature for the transaction

Method:

 s = sign(sha256(sha256(transactionHex)_keygen(sha256(sha256(transactionHex)_privateKey)).publicKey),
         sha256(sha256(transactionHex)_privateKey),
         privateKey)
 p = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)

Kind: inner method of crypto

ParamDescription
messageHex

The data in hexadecimal representation

privateKey

The private key for signing

crypto~generateSignedTransactionBytes(unsignedTransactionHex, signature) ⇒

Generates a signed message digest

Kind: inner method of crypto
Returns:

The signed message digest

ParamDescription
unsignedTransactionHex

The unsigned message

signature

The signature

crypto~getAccountIdFromPublicKey(publicKey) ⇒

Convert hex string of the public key to the account id

Kind: inner method of crypto
Returns:

The numeric account Id

ParamDescription
publicKey

The public key

crypto~verifySignature(signature, messageHex, publicKey)

Verify a signature for given message

  • Method:
* h1 = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)
==
sha256(sha256(transactionHex)_verify(v, h1, publickey)) = h2

Kind: inner method of crypto

ParamDescription
signature

The signature to be verified

messageHex

The message data in hexadecimal representation

publicKey

The public key

crypto

crypto.getAccountIdFromPublicKey ⇒

Arbitrary length hexadecimal to decimal conversion https://stackoverflow.com/questions/21667377/javascript-hexadecimal-string-to-decimal-string

Kind: static property of crypto
Returns:

A decimal string

ParamDescription
s

A hexadecimal string

crypto~Converter

A set of useful converter methods for crypto operations.

Kind: inner class of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~decryptAES(encryptedBase64, key) ⇒

Decrypt an encrypted message

Kind: inner method of crypto
Returns:

The decrypted content

ParamDescription
encryptedBase64

encrypted data in base64 format

key

The secret key

crypto~decryptData(encryptedData, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted cipher text

Kind: inner method of crypto
Returns:

The original plain text

ParamDescription
encryptedData

The encrypted data

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~decryptMessage(encryptedMessage, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted Message

Kind: inner method of crypto
Returns:

The original message

ParamDescription
encryptedMessage

The encrypted message

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~encryptData(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts arbitrary data

Kind: inner method of crypto
Returns:

The encrypted Data

ParamDescription
plaintext

Data to be encrypted

recipientPublicKeyHex

The recipients public key in hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~encryptMessage(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts a message (UTF-8 compatible)

Kind: inner method of crypto
Returns:

The encrypted Message

ParamDescription
plaintext

Message to be encrypted

recipientPublicKeyHex

The recipients public key hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~generateMasterKeys(passPhrase) ⇒

Generate the Master Public Key and Master Private Key for a new passphrase

Kind: inner method of crypto
Returns:

EC-KCDSA sign key pair + agreement key

ParamDescription
passPhrase

The passphrase

crypto~generateSignature(messageHex, privateKey)

Generate a signature for the transaction

Method:

 s = sign(sha256(sha256(transactionHex)_keygen(sha256(sha256(transactionHex)_privateKey)).publicKey),
         sha256(sha256(transactionHex)_privateKey),
         privateKey)
 p = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)

Kind: inner method of crypto

ParamDescription
messageHex

The data in hexadecimal representation

privateKey

The private key for signing

crypto~generateSignedTransactionBytes(unsignedTransactionHex, signature) ⇒

Generates a signed message digest

Kind: inner method of crypto
Returns:

The signed message digest

ParamDescription
unsignedTransactionHex

The unsigned message

signature

The signature

crypto~getAccountIdFromPublicKey(publicKey) ⇒

Convert hex string of the public key to the account id

Kind: inner method of crypto
Returns:

The numeric account Id

ParamDescription
publicKey

The public key

crypto~verifySignature(signature, messageHex, publicKey)

Verify a signature for given message

  • Method:
* h1 = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)
==
sha256(sha256(transactionHex)_verify(v, h1, publickey)) = h2

Kind: inner method of crypto

ParamDescription
signature

The signature to be verified

messageHex

The message data in hexadecimal representation

publicKey

The public key

crypto

crypto.getAccountIdFromPublicKey ⇒

Arbitrary length hexadecimal to decimal conversion https://stackoverflow.com/questions/21667377/javascript-hexadecimal-string-to-decimal-string

Kind: static property of crypto
Returns:

A decimal string

ParamDescription
s

A hexadecimal string

crypto~Converter

A set of useful converter methods for crypto operations.

Kind: inner class of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~decryptAES(encryptedBase64, key) ⇒

Decrypt an encrypted message

Kind: inner method of crypto
Returns:

The decrypted content

ParamDescription
encryptedBase64

encrypted data in base64 format

key

The secret key

crypto~decryptData(encryptedData, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted cipher text

Kind: inner method of crypto
Returns:

The original plain text

ParamDescription
encryptedData

The encrypted data

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~decryptMessage(encryptedMessage, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted Message

Kind: inner method of crypto
Returns:

The original message

ParamDescription
encryptedMessage

The encrypted message

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~encryptData(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts arbitrary data

Kind: inner method of crypto
Returns:

The encrypted Data

ParamDescription
plaintext

Data to be encrypted

recipientPublicKeyHex

The recipients public key in hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~encryptMessage(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts a message (UTF-8 compatible)

Kind: inner method of crypto
Returns:

The encrypted Message

ParamDescription
plaintext

Message to be encrypted

recipientPublicKeyHex

The recipients public key hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~generateMasterKeys(passPhrase) ⇒

Generate the Master Public Key and Master Private Key for a new passphrase

Kind: inner method of crypto
Returns:

EC-KCDSA sign key pair + agreement key

ParamDescription
passPhrase

The passphrase

crypto~generateSignature(messageHex, privateKey)

Generate a signature for the transaction

Method:

 s = sign(sha256(sha256(transactionHex)_keygen(sha256(sha256(transactionHex)_privateKey)).publicKey),
         sha256(sha256(transactionHex)_privateKey),
         privateKey)
 p = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)

Kind: inner method of crypto

ParamDescription
messageHex

The data in hexadecimal representation

privateKey

The private key for signing

crypto~generateSignedTransactionBytes(unsignedTransactionHex, signature) ⇒

Generates a signed message digest

Kind: inner method of crypto
Returns:

The signed message digest

ParamDescription
unsignedTransactionHex

The unsigned message

signature

The signature

crypto~getAccountIdFromPublicKey(publicKey) ⇒

Convert hex string of the public key to the account id

Kind: inner method of crypto
Returns:

The numeric account Id

ParamDescription
publicKey

The public key

crypto~verifySignature(signature, messageHex, publicKey)

Verify a signature for given message

  • Method:
* h1 = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)
==
sha256(sha256(transactionHex)_verify(v, h1, publickey)) = h2

Kind: inner method of crypto

ParamDescription
signature

The signature to be verified

messageHex

The message data in hexadecimal representation

publicKey

The public key

crypto

crypto.getAccountIdFromPublicKey ⇒

Arbitrary length hexadecimal to decimal conversion https://stackoverflow.com/questions/21667377/javascript-hexadecimal-string-to-decimal-string

Kind: static property of crypto
Returns:

A decimal string

ParamDescription
s

A hexadecimal string

crypto~Converter

A set of useful converter methods for crypto operations.

Kind: inner class of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~decryptAES(encryptedBase64, key) ⇒

Decrypt an encrypted message

Kind: inner method of crypto
Returns:

The decrypted content

ParamDescription
encryptedBase64

encrypted data in base64 format

key

The secret key

crypto~decryptData(encryptedData, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted cipher text

Kind: inner method of crypto
Returns:

The original plain text

ParamDescription
encryptedData

The encrypted data

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~decryptMessage(encryptedMessage, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted Message

Kind: inner method of crypto
Returns:

The original message

ParamDescription
encryptedMessage

The encrypted message

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~encryptData(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts arbitrary data

Kind: inner method of crypto
Returns:

The encrypted Data

ParamDescription
plaintext

Data to be encrypted

recipientPublicKeyHex

The recipients public key in hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~encryptMessage(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts a message (UTF-8 compatible)

Kind: inner method of crypto
Returns:

The encrypted Message

ParamDescription
plaintext

Message to be encrypted

recipientPublicKeyHex

The recipients public key hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~generateMasterKeys(passPhrase) ⇒

Generate the Master Public Key and Master Private Key for a new passphrase

Kind: inner method of crypto
Returns:

EC-KCDSA sign key pair + agreement key

ParamDescription
passPhrase

The passphrase

crypto~generateSignature(messageHex, privateKey)

Generate a signature for the transaction

Method:

 s = sign(sha256(sha256(transactionHex)_keygen(sha256(sha256(transactionHex)_privateKey)).publicKey),
         sha256(sha256(transactionHex)_privateKey),
         privateKey)
 p = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)

Kind: inner method of crypto

ParamDescription
messageHex

The data in hexadecimal representation

privateKey

The private key for signing

crypto~generateSignedTransactionBytes(unsignedTransactionHex, signature) ⇒

Generates a signed message digest

Kind: inner method of crypto
Returns:

The signed message digest

ParamDescription
unsignedTransactionHex

The unsigned message

signature

The signature

crypto~getAccountIdFromPublicKey(publicKey) ⇒

Convert hex string of the public key to the account id

Kind: inner method of crypto
Returns:

The numeric account Id

ParamDescription
publicKey

The public key

crypto~verifySignature(signature, messageHex, publicKey)

Verify a signature for given message

  • Method:
* h1 = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)
==
sha256(sha256(transactionHex)_verify(v, h1, publickey)) = h2

Kind: inner method of crypto

ParamDescription
signature

The signature to be verified

messageHex

The message data in hexadecimal representation

publicKey

The public key

crypto

crypto.getAccountIdFromPublicKey ⇒

Arbitrary length hexadecimal to decimal conversion https://stackoverflow.com/questions/21667377/javascript-hexadecimal-string-to-decimal-string

Kind: static property of crypto
Returns:

A decimal string

ParamDescription
s

A hexadecimal string

crypto~Converter

A set of useful converter methods for crypto operations.

Kind: inner class of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~decryptAES(encryptedBase64, key) ⇒

Decrypt an encrypted message

Kind: inner method of crypto
Returns:

The decrypted content

ParamDescription
encryptedBase64

encrypted data in base64 format

key

The secret key

crypto~decryptData(encryptedData, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted cipher text

Kind: inner method of crypto
Returns:

The original plain text

ParamDescription
encryptedData

The encrypted data

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~decryptMessage(encryptedMessage, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted Message

Kind: inner method of crypto
Returns:

The original message

ParamDescription
encryptedMessage

The encrypted message

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~encryptData(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts arbitrary data

Kind: inner method of crypto
Returns:

The encrypted Data

ParamDescription
plaintext

Data to be encrypted

recipientPublicKeyHex

The recipients public key in hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~encryptMessage(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts a message (UTF-8 compatible)

Kind: inner method of crypto
Returns:

The encrypted Message

ParamDescription
plaintext

Message to be encrypted

recipientPublicKeyHex

The recipients public key hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~generateMasterKeys(passPhrase) ⇒

Generate the Master Public Key and Master Private Key for a new passphrase

Kind: inner method of crypto
Returns:

EC-KCDSA sign key pair + agreement key

ParamDescription
passPhrase

The passphrase

crypto~generateSignature(messageHex, privateKey)

Generate a signature for the transaction

Method:

 s = sign(sha256(sha256(transactionHex)_keygen(sha256(sha256(transactionHex)_privateKey)).publicKey),
         sha256(sha256(transactionHex)_privateKey),
         privateKey)
 p = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)

Kind: inner method of crypto

ParamDescription
messageHex

The data in hexadecimal representation

privateKey

The private key for signing

crypto~generateSignedTransactionBytes(unsignedTransactionHex, signature) ⇒

Generates a signed message digest

Kind: inner method of crypto
Returns:

The signed message digest

ParamDescription
unsignedTransactionHex

The unsigned message

signature

The signature

crypto~getAccountIdFromPublicKey(publicKey) ⇒

Convert hex string of the public key to the account id

Kind: inner method of crypto
Returns:

The numeric account Id

ParamDescription
publicKey

The public key

crypto~verifySignature(signature, messageHex, publicKey)

Verify a signature for given message

  • Method:
* h1 = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)
==
sha256(sha256(transactionHex)_verify(v, h1, publickey)) = h2

Kind: inner method of crypto

ParamDescription
signature

The signature to be verified

messageHex

The message data in hexadecimal representation

publicKey

The public key

crypto

crypto.getAccountIdFromPublicKey ⇒

Arbitrary length hexadecimal to decimal conversion https://stackoverflow.com/questions/21667377/javascript-hexadecimal-string-to-decimal-string

Kind: static property of crypto
Returns:

A decimal string

ParamDescription
s

A hexadecimal string

crypto~Converter

A set of useful converter methods for crypto operations.

Kind: inner class of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~decryptAES(encryptedBase64, key) ⇒

Decrypt an encrypted message

Kind: inner method of crypto
Returns:

The decrypted content

ParamDescription
encryptedBase64

encrypted data in base64 format

key

The secret key

crypto~decryptData(encryptedData, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted cipher text

Kind: inner method of crypto
Returns:

The original plain text

ParamDescription
encryptedData

The encrypted data

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~decryptMessage(encryptedMessage, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted Message

Kind: inner method of crypto
Returns:

The original message

ParamDescription
encryptedMessage

The encrypted message

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~encryptData(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts arbitrary data

Kind: inner method of crypto
Returns:

The encrypted Data

ParamDescription
plaintext

Data to be encrypted

recipientPublicKeyHex

The recipients public key in hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~encryptMessage(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts a message (UTF-8 compatible)

Kind: inner method of crypto
Returns:

The encrypted Message

ParamDescription
plaintext

Message to be encrypted

recipientPublicKeyHex

The recipients public key hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~generateMasterKeys(passPhrase) ⇒

Generate the Master Public Key and Master Private Key for a new passphrase

Kind: inner method of crypto
Returns:

EC-KCDSA sign key pair + agreement key

ParamDescription
passPhrase

The passphrase

crypto~generateSignature(messageHex, privateKey)

Generate a signature for the transaction

Method:

 s = sign(sha256(sha256(transactionHex)_keygen(sha256(sha256(transactionHex)_privateKey)).publicKey),
         sha256(sha256(transactionHex)_privateKey),
         privateKey)
 p = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)

Kind: inner method of crypto

ParamDescription
messageHex

The data in hexadecimal representation

privateKey

The private key for signing

crypto~generateSignedTransactionBytes(unsignedTransactionHex, signature) ⇒

Generates a signed message digest

Kind: inner method of crypto
Returns:

The signed message digest

ParamDescription
unsignedTransactionHex

The unsigned message

signature

The signature

crypto~getAccountIdFromPublicKey(publicKey) ⇒

Convert hex string of the public key to the account id

Kind: inner method of crypto
Returns:

The numeric account Id

ParamDescription
publicKey

The public key

crypto~verifySignature(signature, messageHex, publicKey)

Verify a signature for given message

  • Method:
* h1 = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)
==
sha256(sha256(transactionHex)_verify(v, h1, publickey)) = h2

Kind: inner method of crypto

ParamDescription
signature

The signature to be verified

messageHex

The message data in hexadecimal representation

publicKey

The public key

crypto

crypto.getAccountIdFromPublicKey ⇒

Arbitrary length hexadecimal to decimal conversion https://stackoverflow.com/questions/21667377/javascript-hexadecimal-string-to-decimal-string

Kind: static property of crypto
Returns:

A decimal string

ParamDescription
s

A hexadecimal string

crypto~Converter

A set of useful converter methods for crypto operations.

Kind: inner class of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~decryptAES(encryptedBase64, key) ⇒

Decrypt an encrypted message

Kind: inner method of crypto
Returns:

The decrypted content

ParamDescription
encryptedBase64

encrypted data in base64 format

key

The secret key

crypto~decryptData(encryptedData, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted cipher text

Kind: inner method of crypto
Returns:

The original plain text

ParamDescription
encryptedData

The encrypted data

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~decryptMessage(encryptedMessage, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted Message

Kind: inner method of crypto
Returns:

The original message

ParamDescription
encryptedMessage

The encrypted message

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~encryptData(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts arbitrary data

Kind: inner method of crypto
Returns:

The encrypted Data

ParamDescription
plaintext

Data to be encrypted

recipientPublicKeyHex

The recipients public key in hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~encryptMessage(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts a message (UTF-8 compatible)

Kind: inner method of crypto
Returns:

The encrypted Message

ParamDescription
plaintext

Message to be encrypted

recipientPublicKeyHex

The recipients public key hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~generateMasterKeys(passPhrase) ⇒

Generate the Master Public Key and Master Private Key for a new passphrase

Kind: inner method of crypto
Returns:

EC-KCDSA sign key pair + agreement key

ParamDescription
passPhrase

The passphrase

crypto~generateSignature(messageHex, privateKey)

Generate a signature for the transaction

Method:

 s = sign(sha256(sha256(transactionHex)_keygen(sha256(sha256(transactionHex)_privateKey)).publicKey),
         sha256(sha256(transactionHex)_privateKey),
         privateKey)
 p = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)

Kind: inner method of crypto

ParamDescription
messageHex

The data in hexadecimal representation

privateKey

The private key for signing

crypto~generateSignedTransactionBytes(unsignedTransactionHex, signature) ⇒

Generates a signed message digest

Kind: inner method of crypto
Returns:

The signed message digest

ParamDescription
unsignedTransactionHex

The unsigned message

signature

The signature

crypto~getAccountIdFromPublicKey(publicKey) ⇒

Convert hex string of the public key to the account id

Kind: inner method of crypto
Returns:

The numeric account Id

ParamDescription
publicKey

The public key

crypto~verifySignature(signature, messageHex, publicKey)

Verify a signature for given message

  • Method:
* h1 = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)
==
sha256(sha256(transactionHex)_verify(v, h1, publickey)) = h2

Kind: inner method of crypto

ParamDescription
signature

The signature to be verified

messageHex

The message data in hexadecimal representation

publicKey

The public key

crypto

crypto.getAccountIdFromPublicKey ⇒

Arbitrary length hexadecimal to decimal conversion https://stackoverflow.com/questions/21667377/javascript-hexadecimal-string-to-decimal-string

Kind: static property of crypto
Returns:

A decimal string

ParamDescription
s

A hexadecimal string

crypto~Converter

A set of useful converter methods for crypto operations.

Kind: inner class of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~decryptAES(encryptedBase64, key) ⇒

Decrypt an encrypted message

Kind: inner method of crypto
Returns:

The decrypted content

ParamDescription
encryptedBase64

encrypted data in base64 format

key

The secret key

crypto~decryptData(encryptedData, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted cipher text

Kind: inner method of crypto
Returns:

The original plain text

ParamDescription
encryptedData

The encrypted data

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~decryptMessage(encryptedMessage, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted Message

Kind: inner method of crypto
Returns:

The original message

ParamDescription
encryptedMessage

The encrypted message

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~encryptData(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts arbitrary data

Kind: inner method of crypto
Returns:

The encrypted Data

ParamDescription
plaintext

Data to be encrypted

recipientPublicKeyHex

The recipients public key in hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~encryptMessage(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts a message (UTF-8 compatible)

Kind: inner method of crypto
Returns:

The encrypted Message

ParamDescription
plaintext

Message to be encrypted

recipientPublicKeyHex

The recipients public key hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~generateMasterKeys(passPhrase) ⇒

Generate the Master Public Key and Master Private Key for a new passphrase

Kind: inner method of crypto
Returns:

EC-KCDSA sign key pair + agreement key

ParamDescription
passPhrase

The passphrase

crypto~generateSignature(messageHex, privateKey)

Generate a signature for the transaction

Method:

 s = sign(sha256(sha256(transactionHex)_keygen(sha256(sha256(transactionHex)_privateKey)).publicKey),
         sha256(sha256(transactionHex)_privateKey),
         privateKey)
 p = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)

Kind: inner method of crypto

ParamDescription
messageHex

The data in hexadecimal representation

privateKey

The private key for signing

crypto~generateSignedTransactionBytes(unsignedTransactionHex, signature) ⇒

Generates a signed message digest

Kind: inner method of crypto
Returns:

The signed message digest

ParamDescription
unsignedTransactionHex

The unsigned message

signature

The signature

crypto~getAccountIdFromPublicKey(publicKey) ⇒

Convert hex string of the public key to the account id

Kind: inner method of crypto
Returns:

The numeric account Id

ParamDescription
publicKey

The public key

crypto~verifySignature(signature, messageHex, publicKey)

Verify a signature for given message

  • Method:
* h1 = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)
==
sha256(sha256(transactionHex)_verify(v, h1, publickey)) = h2

Kind: inner method of crypto

ParamDescription
signature

The signature to be verified

messageHex

The message data in hexadecimal representation

publicKey

The public key

crypto

crypto.getAccountIdFromPublicKey ⇒

Arbitrary length hexadecimal to decimal conversion https://stackoverflow.com/questions/21667377/javascript-hexadecimal-string-to-decimal-string

Kind: static property of crypto
Returns:

A decimal string

ParamDescription
s

A hexadecimal string

crypto~Converter

A set of useful converter methods for crypto operations.

Kind: inner class of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~decryptAES(encryptedBase64, key) ⇒

Decrypt an encrypted message

Kind: inner method of crypto
Returns:

The decrypted content

ParamDescription
encryptedBase64

encrypted data in base64 format

key

The secret key

crypto~decryptData(encryptedData, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted cipher text

Kind: inner method of crypto
Returns:

The original plain text

ParamDescription
encryptedData

The encrypted data

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~decryptMessage(encryptedMessage, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted Message

Kind: inner method of crypto
Returns:

The original message

ParamDescription
encryptedMessage

The encrypted message

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~encryptData(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts arbitrary data

Kind: inner method of crypto
Returns:

The encrypted Data

ParamDescription
plaintext

Data to be encrypted

recipientPublicKeyHex

The recipients public key in hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~encryptMessage(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts a message (UTF-8 compatible)

Kind: inner method of crypto
Returns:

The encrypted Message

ParamDescription
plaintext

Message to be encrypted

recipientPublicKeyHex

The recipients public key hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~generateMasterKeys(passPhrase) ⇒

Generate the Master Public Key and Master Private Key for a new passphrase

Kind: inner method of crypto
Returns:

EC-KCDSA sign key pair + agreement key

ParamDescription
passPhrase

The passphrase

crypto~generateSignature(messageHex, privateKey)

Generate a signature for the transaction

Method:

 s = sign(sha256(sha256(transactionHex)_keygen(sha256(sha256(transactionHex)_privateKey)).publicKey),
         sha256(sha256(transactionHex)_privateKey),
         privateKey)
 p = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)

Kind: inner method of crypto

ParamDescription
messageHex

The data in hexadecimal representation

privateKey

The private key for signing

crypto~generateSignedTransactionBytes(unsignedTransactionHex, signature) ⇒

Generates a signed message digest

Kind: inner method of crypto
Returns:

The signed message digest

ParamDescription
unsignedTransactionHex

The unsigned message

signature

The signature

crypto~getAccountIdFromPublicKey(publicKey) ⇒

Convert hex string of the public key to the account id

Kind: inner method of crypto
Returns:

The numeric account Id

ParamDescription
publicKey

The public key

crypto~verifySignature(signature, messageHex, publicKey)

Verify a signature for given message

  • Method:
* h1 = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)
==
sha256(sha256(transactionHex)_verify(v, h1, publickey)) = h2

Kind: inner method of crypto

ParamDescription
signature

The signature to be verified

messageHex

The message data in hexadecimal representation

publicKey

The public key

crypto

crypto.getAccountIdFromPublicKey ⇒

Arbitrary length hexadecimal to decimal conversion https://stackoverflow.com/questions/21667377/javascript-hexadecimal-string-to-decimal-string

Kind: static property of crypto
Returns:

A decimal string

ParamDescription
s

A hexadecimal string

crypto~Converter

A set of useful converter methods for crypto operations.

Kind: inner class of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~decryptAES(encryptedBase64, key) ⇒

Decrypt an encrypted message

Kind: inner method of crypto
Returns:

The decrypted content

ParamDescription
encryptedBase64

encrypted data in base64 format

key

The secret key

crypto~decryptData(encryptedData, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted cipher text

Kind: inner method of crypto
Returns:

The original plain text

ParamDescription
encryptedData

The encrypted data

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~decryptMessage(encryptedMessage, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted Message

Kind: inner method of crypto
Returns:

The original message

ParamDescription
encryptedMessage

The encrypted message

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~encryptData(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts arbitrary data

Kind: inner method of crypto
Returns:

The encrypted Data

ParamDescription
plaintext

Data to be encrypted

recipientPublicKeyHex

The recipients public key in hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~encryptMessage(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts a message (UTF-8 compatible)

Kind: inner method of crypto
Returns:

The encrypted Message

ParamDescription
plaintext

Message to be encrypted

recipientPublicKeyHex

The recipients public key hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~generateMasterKeys(passPhrase) ⇒

Generate the Master Public Key and Master Private Key for a new passphrase

Kind: inner method of crypto
Returns:

EC-KCDSA sign key pair + agreement key

ParamDescription
passPhrase

The passphrase

crypto~generateSignature(messageHex, privateKey)

Generate a signature for the transaction

Method:

 s = sign(sha256(sha256(transactionHex)_keygen(sha256(sha256(transactionHex)_privateKey)).publicKey),
         sha256(sha256(transactionHex)_privateKey),
         privateKey)
 p = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)

Kind: inner method of crypto

ParamDescription
messageHex

The data in hexadecimal representation

privateKey

The private key for signing

crypto~generateSignedTransactionBytes(unsignedTransactionHex, signature) ⇒

Generates a signed message digest

Kind: inner method of crypto
Returns:

The signed message digest

ParamDescription
unsignedTransactionHex

The unsigned message

signature

The signature

crypto~getAccountIdFromPublicKey(publicKey) ⇒

Convert hex string of the public key to the account id

Kind: inner method of crypto
Returns:

The numeric account Id

ParamDescription
publicKey

The public key

crypto~verifySignature(signature, messageHex, publicKey)

Verify a signature for given message

  • Method:
* h1 = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)
==
sha256(sha256(transactionHex)_verify(v, h1, publickey)) = h2

Kind: inner method of crypto

ParamDescription
signature

The signature to be verified

messageHex

The message data in hexadecimal representation

publicKey

The public key

crypto

crypto.getAccountIdFromPublicKey ⇒

Arbitrary length hexadecimal to decimal conversion https://stackoverflow.com/questions/21667377/javascript-hexadecimal-string-to-decimal-string

Kind: static property of crypto
Returns:

A decimal string

ParamDescription
s

A hexadecimal string

crypto~Converter

A set of useful converter methods for crypto operations.

Kind: inner class of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~decryptAES(encryptedBase64, key) ⇒

Decrypt an encrypted message

Kind: inner method of crypto
Returns:

The decrypted content

ParamDescription
encryptedBase64

encrypted data in base64 format

key

The secret key

crypto~decryptData(encryptedData, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted cipher text

Kind: inner method of crypto
Returns:

The original plain text

ParamDescription
encryptedData

The encrypted data

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~decryptMessage(encryptedMessage, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted Message

Kind: inner method of crypto
Returns:

The original message

ParamDescription
encryptedMessage

The encrypted message

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~encryptData(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts arbitrary data

Kind: inner method of crypto
Returns:

The encrypted Data

ParamDescription
plaintext

Data to be encrypted

recipientPublicKeyHex

The recipients public key in hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~encryptMessage(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts a message (UTF-8 compatible)

Kind: inner method of crypto
Returns:

The encrypted Message

ParamDescription
plaintext

Message to be encrypted

recipientPublicKeyHex

The recipients public key hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~generateMasterKeys(passPhrase) ⇒

Generate the Master Public Key and Master Private Key for a new passphrase

Kind: inner method of crypto
Returns:

EC-KCDSA sign key pair + agreement key

ParamDescription
passPhrase

The passphrase

crypto~generateSignature(messageHex, privateKey)

Generate a signature for the transaction

Method:

 s = sign(sha256(sha256(transactionHex)_keygen(sha256(sha256(transactionHex)_privateKey)).publicKey),
         sha256(sha256(transactionHex)_privateKey),
         privateKey)
 p = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)

Kind: inner method of crypto

ParamDescription
messageHex

The data in hexadecimal representation

privateKey

The private key for signing

crypto~generateSignedTransactionBytes(unsignedTransactionHex, signature) ⇒

Generates a signed message digest

Kind: inner method of crypto
Returns:

The signed message digest

ParamDescription
unsignedTransactionHex

The unsigned message

signature

The signature

crypto~getAccountIdFromPublicKey(publicKey) ⇒

Convert hex string of the public key to the account id

Kind: inner method of crypto
Returns:

The numeric account Id

ParamDescription
publicKey

The public key

crypto~verifySignature(signature, messageHex, publicKey)

Verify a signature for given message

  • Method:
* h1 = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)
==
sha256(sha256(transactionHex)_verify(v, h1, publickey)) = h2

Kind: inner method of crypto

ParamDescription
signature

The signature to be verified

messageHex

The message data in hexadecimal representation

publicKey

The public key

crypto

crypto.getAccountIdFromPublicKey ⇒

Arbitrary length hexadecimal to decimal conversion https://stackoverflow.com/questions/21667377/javascript-hexadecimal-string-to-decimal-string

Kind: static property of crypto
Returns:

A decimal string

ParamDescription
s

A hexadecimal string

crypto~Converter

A set of useful converter methods for crypto operations.

Kind: inner class of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~decryptAES(encryptedBase64, key) ⇒

Decrypt an encrypted message

Kind: inner method of crypto
Returns:

The decrypted content

ParamDescription
encryptedBase64

encrypted data in base64 format

key

The secret key

crypto~decryptData(encryptedData, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted cipher text

Kind: inner method of crypto
Returns:

The original plain text

ParamDescription
encryptedData

The encrypted data

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~decryptMessage(encryptedMessage, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted Message

Kind: inner method of crypto
Returns:

The original message

ParamDescription
encryptedMessage

The encrypted message

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~encryptData(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts arbitrary data

Kind: inner method of crypto
Returns:

The encrypted Data

ParamDescription
plaintext

Data to be encrypted

recipientPublicKeyHex

The recipients public key in hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~encryptMessage(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts a message (UTF-8 compatible)

Kind: inner method of crypto
Returns:

The encrypted Message

ParamDescription
plaintext

Message to be encrypted

recipientPublicKeyHex

The recipients public key hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~generateMasterKeys(passPhrase) ⇒

Generate the Master Public Key and Master Private Key for a new passphrase

Kind: inner method of crypto
Returns:

EC-KCDSA sign key pair + agreement key

ParamDescription
passPhrase

The passphrase

crypto~generateSignature(messageHex, privateKey)

Generate a signature for the transaction

Method:

 s = sign(sha256(sha256(transactionHex)_keygen(sha256(sha256(transactionHex)_privateKey)).publicKey),
         sha256(sha256(transactionHex)_privateKey),
         privateKey)
 p = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)

Kind: inner method of crypto

ParamDescription
messageHex

The data in hexadecimal representation

privateKey

The private key for signing

crypto~generateSignedTransactionBytes(unsignedTransactionHex, signature) ⇒

Generates a signed message digest

Kind: inner method of crypto
Returns:

The signed message digest

ParamDescription
unsignedTransactionHex

The unsigned message

signature

The signature

crypto~getAccountIdFromPublicKey(publicKey) ⇒

Convert hex string of the public key to the account id

Kind: inner method of crypto
Returns:

The numeric account Id

ParamDescription
publicKey

The public key

crypto~verifySignature(signature, messageHex, publicKey)

Verify a signature for given message

  • Method:
* h1 = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)
==
sha256(sha256(transactionHex)_verify(v, h1, publickey)) = h2

Kind: inner method of crypto

ParamDescription
signature

The signature to be verified

messageHex

The message data in hexadecimal representation

publicKey

The public key

crypto

crypto.getAccountIdFromPublicKey ⇒

Arbitrary length hexadecimal to decimal conversion https://stackoverflow.com/questions/21667377/javascript-hexadecimal-string-to-decimal-string

Kind: static property of crypto
Returns:

A decimal string

ParamDescription
s

A hexadecimal string

crypto~Converter

A set of useful converter methods for crypto operations.

Kind: inner class of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~decryptAES(encryptedBase64, key) ⇒

Decrypt an encrypted message

Kind: inner method of crypto
Returns:

The decrypted content

ParamDescription
encryptedBase64

encrypted data in base64 format

key

The secret key

crypto~decryptData(encryptedData, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted cipher text

Kind: inner method of crypto
Returns:

The original plain text

ParamDescription
encryptedData

The encrypted data

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~decryptMessage(encryptedMessage, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted Message

Kind: inner method of crypto
Returns:

The original message

ParamDescription
encryptedMessage

The encrypted message

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~encryptData(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts arbitrary data

Kind: inner method of crypto
Returns:

The encrypted Data

ParamDescription
plaintext

Data to be encrypted

recipientPublicKeyHex

The recipients public key in hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~encryptMessage(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts a message (UTF-8 compatible)

Kind: inner method of crypto
Returns:

The encrypted Message

ParamDescription
plaintext

Message to be encrypted

recipientPublicKeyHex

The recipients public key hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~generateMasterKeys(passPhrase) ⇒

Generate the Master Public Key and Master Private Key for a new passphrase

Kind: inner method of crypto
Returns:

EC-KCDSA sign key pair + agreement key

ParamDescription
passPhrase

The passphrase

crypto~generateSignature(messageHex, privateKey)

Generate a signature for the transaction

Method:

 s = sign(sha256(sha256(transactionHex)_keygen(sha256(sha256(transactionHex)_privateKey)).publicKey),
         sha256(sha256(transactionHex)_privateKey),
         privateKey)
 p = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)

Kind: inner method of crypto

ParamDescription
messageHex

The data in hexadecimal representation

privateKey

The private key for signing

crypto~generateSignedTransactionBytes(unsignedTransactionHex, signature) ⇒

Generates a signed message digest

Kind: inner method of crypto
Returns:

The signed message digest

ParamDescription
unsignedTransactionHex

The unsigned message

signature

The signature

crypto~getAccountIdFromPublicKey(publicKey) ⇒

Convert hex string of the public key to the account id

Kind: inner method of crypto
Returns:

The numeric account Id

ParamDescription
publicKey

The public key

crypto~verifySignature(signature, messageHex, publicKey)

Verify a signature for given message

  • Method:
* h1 = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)
==
sha256(sha256(transactionHex)_verify(v, h1, publickey)) = h2

Kind: inner method of crypto

ParamDescription
signature

The signature to be verified

messageHex

The message data in hexadecimal representation

publicKey

The public key

crypto

crypto.getAccountIdFromPublicKey ⇒

Arbitrary length hexadecimal to decimal conversion https://stackoverflow.com/questions/21667377/javascript-hexadecimal-string-to-decimal-string

Kind: static property of crypto
Returns:

A decimal string

ParamDescription
s

A hexadecimal string

crypto~Converter

A set of useful converter methods for crypto operations.

Kind: inner class of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~decryptAES(encryptedBase64, key) ⇒

Decrypt an encrypted message

Kind: inner method of crypto
Returns:

The decrypted content

ParamDescription
encryptedBase64

encrypted data in base64 format

key

The secret key

crypto~decryptData(encryptedData, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted cipher text

Kind: inner method of crypto
Returns:

The original plain text

ParamDescription
encryptedData

The encrypted data

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~decryptMessage(encryptedMessage, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted Message

Kind: inner method of crypto
Returns:

The original message

ParamDescription
encryptedMessage

The encrypted message

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~encryptData(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts arbitrary data

Kind: inner method of crypto
Returns:

The encrypted Data

ParamDescription
plaintext

Data to be encrypted

recipientPublicKeyHex

The recipients public key in hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~encryptMessage(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts a message (UTF-8 compatible)

Kind: inner method of crypto
Returns:

The encrypted Message

ParamDescription
plaintext

Message to be encrypted

recipientPublicKeyHex

The recipients public key hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~generateMasterKeys(passPhrase) ⇒

Generate the Master Public Key and Master Private Key for a new passphrase

Kind: inner method of crypto
Returns:

EC-KCDSA sign key pair + agreement key

ParamDescription
passPhrase

The passphrase

crypto~generateSignature(messageHex, privateKey)

Generate a signature for the transaction

Method:

 s = sign(sha256(sha256(transactionHex)_keygen(sha256(sha256(transactionHex)_privateKey)).publicKey),
         sha256(sha256(transactionHex)_privateKey),
         privateKey)
 p = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)

Kind: inner method of crypto

ParamDescription
messageHex

The data in hexadecimal representation

privateKey

The private key for signing

crypto~generateSignedTransactionBytes(unsignedTransactionHex, signature) ⇒

Generates a signed message digest

Kind: inner method of crypto
Returns:

The signed message digest

ParamDescription
unsignedTransactionHex

The unsigned message

signature

The signature

crypto~getAccountIdFromPublicKey(publicKey) ⇒

Convert hex string of the public key to the account id

Kind: inner method of crypto
Returns:

The numeric account Id

ParamDescription
publicKey

The public key

crypto~verifySignature(signature, messageHex, publicKey)

Verify a signature for given message

  • Method:
* h1 = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)
==
sha256(sha256(transactionHex)_verify(v, h1, publickey)) = h2

Kind: inner method of crypto

ParamDescription
signature

The signature to be verified

messageHex

The message data in hexadecimal representation

publicKey

The public key

crypto

crypto.getAccountIdFromPublicKey ⇒

Arbitrary length hexadecimal to decimal conversion https://stackoverflow.com/questions/21667377/javascript-hexadecimal-string-to-decimal-string

Kind: static property of crypto
Returns:

A decimal string

ParamDescription
s

A hexadecimal string

crypto~Converter

A set of useful converter methods for crypto operations.

Kind: inner class of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~IV_LENGTH

Original work Copyright (c) 2018 PoC-Consortium Modified work Copyright (c) 2019 Burst Apps Team

Kind: inner constant of crypto

crypto~decryptAES(encryptedBase64, key) ⇒

Decrypt an encrypted message

Kind: inner method of crypto
Returns:

The decrypted content

ParamDescription
encryptedBase64

encrypted data in base64 format

key

The secret key

crypto~decryptData(encryptedData, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted cipher text

Kind: inner method of crypto
Returns:

The original plain text

ParamDescription
encryptedData

The encrypted data

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~decryptMessage(encryptedMessage, senderPublicKeyHex, recipientPrivateKeyHex) ⇒

Decrypts an encrypted Message

Kind: inner method of crypto
Returns:

The original message

ParamDescription
encryptedMessage

The encrypted message

senderPublicKeyHex

The senders public key in hex format

recipientPrivateKeyHex

The recipients private (agreement) key in hex format

crypto~encryptData(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts arbitrary data

Kind: inner method of crypto
Returns:

The encrypted Data

ParamDescription
plaintext

Data to be encrypted

recipientPublicKeyHex

The recipients public key in hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~encryptMessage(plaintext, recipientPublicKeyHex, senderPrivateKeyHex) ⇒

Encrypts a message (UTF-8 compatible)

Kind: inner method of crypto
Returns:

The encrypted Message

ParamDescription
plaintext

Message to be encrypted

recipientPublicKeyHex

The recipients public key hexadecimal format

senderPrivateKeyHex

The senders private (agreement) key hexadecimal format

crypto~generateMasterKeys(passPhrase) ⇒

Generate the Master Public Key and Master Private Key for a new passphrase

Kind: inner method of crypto
Returns:

EC-KCDSA sign key pair + agreement key

ParamDescription
passPhrase

The passphrase

crypto~generateSignature(messageHex, privateKey)

Generate a signature for the transaction

Method:

 s = sign(sha256(sha256(transactionHex)_keygen(sha256(sha256(transactionHex)_privateKey)).publicKey),
         sha256(sha256(transactionHex)_privateKey),
         privateKey)
 p = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)

Kind: inner method of crypto

ParamDescription
messageHex

The data in hexadecimal representation

privateKey

The private key for signing

crypto~generateSignedTransactionBytes(unsignedTransactionHex, signature) ⇒

Generates a signed message digest

Kind: inner method of crypto
Returns:

The signed message digest

ParamDescription
unsignedTransactionHex

The unsigned message

signature

The signature

crypto~getAccountIdFromPublicKey(publicKey) ⇒

Convert hex string of the public key to the account id

Kind: inner method of crypto
Returns:

The numeric account Id

ParamDescription
publicKey

The public key

crypto~verifySignature(signature, messageHex, publicKey)

Verify a signature for given message

  • Method:
* h1 = sha256(sha256(transactionHex)_keygen(sha256(transactionHex_privateKey)).publicKey)
==
sha256(sha256(transactionHex)_verify(v, h1, publickey)) = h2

Kind: inner method of crypto

ParamDescription
signature

The signature to be verified

messageHex

The message data in hexadecimal representation

publicKey

The public key

FAQs

Package last updated on 24 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc