1.4.6 • Published 21 days ago

@peculiar/webcrypto v1.4.6

Weekly downloads
60,774
License
MIT
Repository
github
Last release
21 days ago

@peculiar/webcrypto

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
shake1282X
shake2562X

1 Mechanism supports extended list of named curves P-256, P-384, P-521, K-256, brainpoolP160r1, brainpoolP160t1, brainpoolP192r1, brainpoolP192t1, brainpoolP224r1, brainpoolP224t1, brainpoolP256r1, brainpoolP256t1, brainpoolP320r1, brainpoolP320t1, brainpoolP384r1, brainpoolP384t1, brainpoolP512r1, and brainpoolP512t1

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

isocrypt-utilsbanking-service-ts@ccf-test/ccf-web@paul_wieland_repo/ccf-webrubeuse2ee-msg-processor-jshaxball-server-nodejs@infinitebrahmanuniverse/nolb-_pec@tsightler/werift@tsightler/ring-client-api@everything-registry/sub-chunk-710drip-filesharingselfguard-clientselfguard-nodescreenshotone-api-sdksfrtcspiffedigital-covid-certificate-lib@digitalcredentials/isomorphic-webcryptocredify-crypto@distributed/iron-session@diegobm/isomorphic-webcrypto@dinhbx/lucid-customsasl-scram-jssafe-as2relay_sdkretail-react-appring-client-apicryptopassgencs2-encryption@decentralized-identity/did-crypto-typescriptbutter-libopact-sdkopen-facturaparkydb@betro/lib@betacodd/lighthouse-package@carv/jest-preset@carv/scripts@caskprotocol/sdkpolykeyplanetscale-node@clerk/edge@clerk/backend@clerk/backend-corecommon-nest-plena@spalk/werift@swiftprotocol/auth@swiftprotocol/guard-v1@swiftprotocol/selfguardcoolcertcore.cryptocose-kit@credify/cryptocovid-certificatepcca-verifierpaste-dbpassport-esia-esmpwa-kit-buildpeer-vpa-modnpm-vwconnectidapinuah@appliedblockchain/silentdata-node@depay/js-verify-signature@docknetwork/universal-wallet@docknetwork/walletcrypo.jsqueue-runauthrite-utilsnode-haxball@anastasia-labs/lucid-cardano-forksunder-kitfido-rent-iron-sessionfido2-libfido2-lib-nodeetag-webcryptotl-create@inog/iris-library-js@inrupt/jest-jsdom-polyfills@innatical/inncryption@innatical/isomorphic-webcrypto@idbase/idbase-auth@fireproof/core@fireproof/database@fireproof/encrypted-blockstore@fsujob1984/isomorphic-webcrypto@facturacr/atv-sdk@hyper-hyper-space/node-env@jacobcoro/gun@keur/ring-client-api@koush/werift@libp2p/tls@planetarium/account-web3-secret-storage@proton/js@pioneer-platform/pioneer-app-e2e@pioneer-platform/pioneer-app-electron@pioneer-platform/pioneer-app@questnetwork/quest-crypto-js@quilted/polyfills@relaycorp/relaydev
1.4.6

21 days ago

1.4.5

3 months ago

1.4.4

3 months ago

1.4.3

1 year ago

1.4.2

1 year ago

1.4.1

1 year ago

1.4.0

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.29

4 years ago

1.0.28

4 years ago

1.0.27

4 years ago

1.0.26

4 years ago

1.0.25

4 years ago

1.0.24

4 years ago

1.0.23

4 years ago

1.0.22

4 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago