1.1.8 • Published 3 years ago

@fungible-systems/webcrypto-expo v1.1.8

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

@fungible-systems/webcrypto-expo

NOTE: this is a fork of @peculiar/webcrypto, to work specifically for micro-stacks and react-native.

License test Coverage Status npm version

We wanted to be able to write Javascript that used crypto on both the client and the server but we did not want to rely on Javascript implementations of crypto. The only native cryptography available in browser is Web Crypto, this resulted in us creating a @peculiar/webcrypto.

Table Of Contents

WARNING

At this time this solution should be considered suitable for research and experimentation, further code and security review is needed before utilization in a production application.

Module is based on NodeJS v10 Crypto API. It would work only with Node v10 and higher.

Installing

npm install @peculiar/webcrypto

Supported algorithms

Algorithm namegenerateKeydigestexport/importsign/verifyencrypt/decryptwrapKey/unwrapKeyderive
SHA-1X
SHA-256X
SHA-384X
SHA-512X
HMACXXX
RSASSA-PKCS1-v1_5XXX
RSAES-PKCS1-v1_52XXXX
RSA-PSSXXX
RSA-OAEPXXXX
AES-CMACXXX
AES-CBCXXXX
AES-CTRXXXX
AES-ECBXXXX
AES-GCMXXXX
AES-KWXXX
ECDSA1XXX
ECDH1XXX
EdDSA2,3XXX
ECDH-ES2,4XXX
HKDFXX
PBKDF2XX
DES-CBC2XXXX
DES-EDE3-CBC2XXXX

1 Mechanism supports extended list of named curves P-256, P-384, P-521, and K-256

2 Mechanism is not defined by the WebCrypto specifications. Use of mechanism in a safe way is hard, it was added for the purpose of enabling interoperability with an existing system. We recommend against its use unless needed for interoperability.

3 Mechanism supports extended list of named curves Ed25519, and Ed448

4 Mechanism supports extended list of named curves X25519, and X448

Using

const { Crypto } = require("@peculiar/webcrypto");

const crypto = new Crypto();

Examples

See WebCrypto Docs for examples

Bug Reporting

Please report bugs either as pull requests or as issues in the issue tracker. @peculiar/webcrypto has a full disclosure vulnerability policy. Please do NOT attempt to report any security vulnerability in this code privately to anybody.

Related