0.6.0-beta.6 • Published 3 years ago

@burstjs/crypto v0.6.0-beta.6

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
3 years ago

@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

Classes

Constants

crypto ⇒

Returns: The decrypted content
See: [encryptAES]

ParamDescription
encryptedBase64encrypted data in base64 format
keyThe secret key

crypto ⇒

Returns: The original plain text

ParamDescription
encryptedDataThe encrypted data
senderPublicKeyHexThe senders public key in hex format
recipientPrivateKeyHexThe recipients private (agreement) key in hex format

crypto ⇒

Returns: The original message

ParamDescription
encryptedMessageThe encrypted message
senderPublicKeyHexThe senders public key in hex format
recipientPrivateKeyHexThe recipients private (agreement) key in hex format

crypto ⇒

Returns: The encrypted message as Base64 string
See: [decryptAES]

ParamDescription
textThe message/text to be encrypted
keyThe key used

crypto ⇒

Returns: The encrypted Data
See: [decryptData]

ParamDescription
plaintextData to be encrypted
recipientPublicKeyHexThe recipients public key in hexadecimal format
senderPrivateKeyHexThe senders private (agreement) key hexadecimal format

crypto ⇒

Returns: The encrypted Message
See: [decryptMessage]

ParamDescription
plaintextMessage to be encrypted
recipientPublicKeyHexThe recipients public key hexadecimal format
senderPrivateKeyHexThe senders private (agreement) key hexadecimal format

crypto ⇒

Returns: EC-KCDSA sign key pair + agreement key

ParamDescription
passPhraseThe passphrase

crypto ⇒

Returns: The signature in hexadecimal format

ParamDescription
messageHexThe data in hexadecimal representation
privateKeyThe private key for signing

crypto ⇒

Returns: The signed message digest

ParamDescription
unsignedTransactionHexThe unsigned message
signatureThe signature

crypto ⇒

Returns: The numeric account Id

ParamDescription
publicKeyThe public key

crypto ⇒

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

ParamDescription
sA hexadecimal string

crypto ⇒

Returns: the hash for that string in hex format

ParamDescription
inputAn arbitrary text

crypto

Note: For secure randomization seedrandom is used.

crypto ⇒

Returns: true, if signature is valid, otherwise false
See: [generateSignature]

ParamDescription
signatureThe signature to be verified
messageHexThe message data in hexadecimal representation
publicKeyThe public key

crypto

Converter

Kind: global class

IV_LENGTH

Kind: global constant

IV_LENGTH

Kind: global constant

0.6.0-beta.6

3 years ago

0.6.0-beta.5

3 years ago

0.6.0-beta.4

3 years ago

0.6.0-beta.3

3 years ago

0.6.0-beta.2

3 years ago

0.6.0-beta.1

3 years ago

0.6.0-alpha.9

3 years ago

0.6.0-alpha.8

3 years ago

0.6.0-alpha.1

3 years ago

0.6.0-alpha.2

3 years ago

0.6.0-alpha.7

3 years ago

0.6.0-alpha.5

3 years ago

0.6.0-alpha.6

3 years ago

0.6.0-alpha.4

3 years ago

0.5.1

4 years ago

0.5.0

4 years ago

0.5.0-beta.12

4 years ago

0.5.0-beta.11

4 years ago

0.5.0-beta.10

4 years ago

0.5.0-beta.9

4 years ago

0.5.0-beta.8

4 years ago

0.5.0-beta.7

4 years ago

0.5.0-beta.6

4 years ago

0.5.0-beta.5

4 years ago

0.5.0-beta.4

4 years ago

0.5.0-beta.3

4 years ago

0.5.0-beta.2

4 years ago

0.5.0-beta.1

4 years ago

0.5.0-alpha.3

4 years ago

0.5.0-alpha.2

4 years ago

0.5.0-alpha.1

4 years ago

0.5.0-alpha.0

4 years ago

0.4.3

4 years ago

0.4.2

4 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0-rc.3.2

5 years ago

0.1.0-rc.3.1

5 years ago

0.1.0-rc.3

5 years ago

0.1.0-rc.2

5 years ago

0.1.0-rc1

5 years ago

0.0.14

5 years ago

0.0.13

5 years ago

0.0.12

5 years ago

0.0.11

5 years ago

0.0.10

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago