Popularity
0.4
Growing
Activity
0.0
Stable
5
3
0

Description

Keywords: Hash HMAC AES XTEA RSA KeyDerivation ECC BIP39 SRP Random ... This software is licensed under the MIT License. Projects which use the library: PrivMX WebMail, ...

Programming language: JavaScript
License: MIT License
Tags: Nodejs     Node     JavaScript     Browser     Client     Encryption    

PrivMX JS Crypto Lib alternatives and similar libraries

Based on the "NodeJS" category.
Alternatively, view PrivMX JS Crypto Lib alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of PrivMX JS Crypto Lib or a related project?

Add another 'NodeJS' Library

README

PrivMX Crypto Java Script ....

Information

...

Keywords: Hash HMAC AES XTEA RSA KeyDerivation ECC BIP39 SRP Random ...

This software is licensed under the MIT License.

Projects which use the library: PrivMX WebMail, ...

Installation

...

Implementation details

...

API description

Hash functions

Name Description Params Result
sha1 SHA-1 (20 bytes long) Buffer data Promise<Buffer>
sha256 SHA-256 (32 bytes long) Buffer data Promise<Buffer>
sha512 SHA-512 (64 bytes long) Buffer data Promise<Buffer>

Hmac functions

Name Description Params Result
hmacSha1 HMAC-SHA-1 Buffer keyBuffer data Promise<Buffer>
hmacSha256 HMAC-SHA-256 Buffer keyBuffer data Promise<Buffer>
hmacSha512 HMAC-SHA-512 Buffer keyBuffer data Promise<Buffer>

AES encryption

Name Description Params Result
aes256Ecb AES-256-ECB Buffer dataBuffer key Promise<Buffer>
aes256EcbDecrypt AES-256-ECB Buffer dataBuffer key Promise<Buffer>
aes256CbcPcks7Encrypt AES-256-CBC with PKCS7 padding encryption Buffer dataBuffer keyBuffer iv Promise<Buffer>
aes256CbcPcks7Decrypt AES-256-CBC with PKCS7 padding decryption Buffer dataBuffer keyBuffer iv Promise<Buffer>
aes256CbcHmac256Encrypt AES-256-CBC with PKCS7 padding and SHA-256 HMAC with NIST compatible KDF Buffer dataBuffer keybool deterministic, default: falsenumber taglen, default: 16 Promise<Buffer>
aes256CbcHmac256Decrypt AES-256-CBC with PKCS7 padding and SHA-256 HMAC with NIST compatible KDF Buffer dataBuffer keynumber taglen, default: 16 Promise<Buffer>

XTEA encryption

Name Description Params Result
xteaEcbPkcs7Encrypt XTEA-ECB with PKCS7 padding encryption Buffer dataBuffer key Promise<Buffer>
xteaEcbPkcs7Decrypt XTEA-ECB with PKCS7 padding decryption Buffer dataBuffer key Promise<Buffer>

RSA encryption

Name Description Params Result
rsaGenerateKey number bits Promise<string>
rsaOaepEncrypt string keyBuffer data Promise<Buffer>
rsaOaepDecrypt string keyBuffer data Promise<Buffer>
rsaSign string keyBuffer data Promise<Buffer>
rsaVerify string keyBuffer signatureBuffer data Promise<boolean>
encryptPrivateKey string keystring passphrase Promise<string>
decryptPrivateKey string enckeystring passphrase Promise<string>

Key derivation

Name Description Params Result
pbkdf2 string passwordBuffer saltnumber roundsnumber lengthstring algorithm Promise<Buffer>
prf_tls12 Buffer keyBuffer seednumber length Promise<Buffer>

ECC functions

Name Description Params Result
signToCompactSignature Ecc.PrivateKey keyBuffer message Promise<Buffer>
verifyCompactSignature Ecc.PublicKey keyBuffer dataBuffer signature Promise<bool>
signToCompactSignatureWithHash Ecc.PrivateKey keyBuffer message Promise<Buffer>
verifyCompactSignatureWithHash Ecc.PublicKey keyBuffer dataBuffer signature Promise<bool>
getSharedKey Ecc.PrivateKey privateEcc.PublicKey public Promise<Buffer>
deriveHardened Ecc.ExtKey keynumber index Promise<Ecc.ExtKey>
eciesEncrypt Ecc.PrivateKey privateEcc.PublicKey publicBuffer data Promise<Buffer>
eciesDecrypt Ecc.PrivateKey privateEcc.PublicKey publicBuffer data Promise<Buffer>

BIP39 functions

interface Bip39Result {
    entropy: Buffer;
    mnemonic: Buffer;
    extKey: Ecc.ExtKey;
};
Name Description Params Result
bip39Generate number strengthstring password Promise<Bip39Result>
bip39FromEntropy Buffer entropystring password Promise<Bip39Result>
bip39FromMnemonic Buffer entropystring password Promise<Bip39Result>
bip39GetExtKey Buffer entropystring password Promise<Ecc.ExtKey>

SRP functions

interface RegisterResult {
    s: Buffer;
    v: Buffer;
};

interface LoginStep1Result {
    A: Buffer;
    K: Buffer;
    M1: Buffer;
    M2: Buffer;
};
Name Description Params Result
srpRegister Buffer NBuffer gstring Istring P Promise<RegisterResult>
srpLoginStep1 Buffer NBuffer gBuffer sBuffer BBuffer kstring Istring P Promise<LoginStep1Result>
srpLoginStep2 Buffer clientM2Buffer serverM2 Promise<void>

Random generation

Name Description Params Result
randomFeed Buffer feed void
randomInt32 void number
randomDouble void number
randomBytes number count Buffer
randomBits number count Buffer
randomBN BN max BN

Misc.

Name Description Params Result
reductKey Reducts 32-bytes long key to 16-bytes long by SHA-256 and takes first 16 bytes Buffer key Promise<Buffer>
generateIv Generates IV from index for AES (16 bytes long) Buffer keynumber index Promise<Buffer>

Build

gulp

Test

Browser tests

npm start

and browse http://localhost:8123/

Mocha tests

npm test


*Note that all licence references and agreements mentioned in the PrivMX JS Crypto Lib README section above are relevant to that project's source code only.