Gathering detailed insights and metrics for webcrypto-core
Gathering detailed insights and metrics for webcrypto-core
Gathering detailed insights and metrics for webcrypto-core
Gathering detailed insights and metrics for webcrypto-core
@peculiar/webcrypto
A WebCrypto Polyfill for NodeJS
iron-webcrypto
a cryptographic utility for sealing-unsealing a JSON object using symmetric key encryption with message integrity verification
webcrypto-shim
Web Cryptography API shim for legacy browsers
isomorphic-webcrypto
webcrypto library for Node, React Native and IE11+
npm install webcrypto-core
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
29 Stars
361 Commits
13 Forks
8 Watching
4 Branches
10 Contributors
Updated on 12 Nov 2024
TypeScript (99.29%)
JavaScript (0.71%)
Cumulative downloads
Total Downloads
Last day
-2.7%
599,712
Compared to previous day
Last week
2.4%
3,090,743
Compared to previous week
Last month
1.2%
13,096,497
Compared to previous month
Last year
36.7%
155,687,088
Compared to previous year
We have created a number of WebCrypto polyfills including: node-webcrypto-ossl, node-webcrypto-p11, and webcrypto-liner. webcrypto-core
was designed to be a common layer to be used by all of these libraries for input validation.
Unless you intend to create a WebCrypto polyfill this library is probably not useful to you.
npm install webcrypto-core
Current examples shows how you can implement your own WebCrypt interface
1const core = require("."); 2const crypto = require("crypto"); 3 4class Sha1Provider extends core.ProviderCrypto { 5 6 constructor() { 7 super(); 8 9 this.name = "SHA-1"; 10 this.usages = []; 11 } 12 13 async onDigest(algorithm, data) { 14 const hash = crypto.createHash("SHA1").update(Buffer.from(data)).digest(); 15 return new Uint8Array(hash).buffer; 16 } 17 18} 19 20class SubtleCrypto extends core.SubtleCrypto { 21 constructor() { 22 super(); 23 24 // Add SHA1 provider to SubtleCrypto 25 this.providers.set(new Sha1Provider()); 26 } 27} 28 29class Crypto extends core.Crypto { 30 31 constructor() { 32 this.subtle = new SubtleCrypto(); 33 } 34 35 getRandomValues(array) { 36 const buffer = Buffer.from(array.buffer); 37 crypto.randomFillSync(buffer); 38 return array; 39 } 40 41} 42 43const webcrypto = new Crypto(); 44webcrypto.subtle.digest("SHA-1", Buffer.from("TEST MESSAGE")) 45 .then((hash) => { 46 console.log(Buffer.from(hash).toString("hex")); // dbca505deb07e1612d944a69c0c851f79f3a4a60 47 }) 48 .catch((err) => { 49 console.error(err); 50 });
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
4 existing vulnerabilities detected
Details
Reason
6 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 5
Reason
Found 2/14 approved changesets -- score normalized to 1
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More