
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
org.webjars.npm:js-crypto-hash
Advanced tools
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.
NOTE: This repository is a monorepo of a universal cryptographic library for JavaScript called
js-crypto-utils(jscu), which is designed so as to work in most modern browsers and Node.js. The detailed explanation would be given in each package repository. The root package is given here (indevelopbranch).
CURRENT STATUS: Finished rewriting
jscuall packages in TypeScript, and we believed this big change increase the maintainability. (Nov. 19, 2019). **Terminated to support MS IE11 and released v1.0 (Sep. 30, 2020).
This project called jscu is being developed to provide unified cryptographic APIs for browsers and Node.js. There currently exist various sophisticated cryptographic suites for JavaScript that are implemented as native functions, e.g., WebCrypto API and crypto in Node.js. However, they have different interfaces and are NOT supported at all platforms. For instance, FireFox cannot be fed PKCS8-formatted private key in WebCrypto API but Chrome does. On the other hand, such suites have not been designed to keep compatibility to existing non-Web cryptographic suites like OpenSSL. This can be seen from the fact that WebCrypto API does not support PEM-formatted keys. Hence we (actually I!) need to write ugly codes so as to enable apps to work in various environments. From this observation, we aim that this library provides support functions to fill such gaps among JS cryptographic suites and that between JavaScript and other popular crypto suites.
In particular, this library provides unified APIs of the following cryptographic functions that works in most modern browsers and Node.js.
Additionally, this library provides random, hash, AES, HMAC, HKDF, and PBKDF functions. This implies the jscu is composed of the several subpackages and can be seen as a cryptographic suite like openpgpjs. The root package, js-crypto-utils, of the suite and its subpackages are listed as follows.
crypto-utils: Root cryptographic package providing unified APIs.x509-utils: Subpackage handling X509 certificates.key-utils: Subpackage handling various key formats like PEM, DER, and JWK.ec: Subpackage providing naive encryption and signing of elliptic curve cryptography.rsa: Subpackage providing naive encryption and signing of RSA cryptography.aes: Subpackage for AES encryption.random: Subpackage for cryptographic random generator.hash: Subpackage providing hash functions including SHA-2 and SHA-3.hkdf: Subpackage providing hash-based key derivation function.pbkdf: Subpackage providing password-based key derivation function 1 and 2.hmac: Subpackage providing hash-based message authentication code.The structure of the package is described in the README.md of the root package, and hence we should start from there. But we can use various cryptographic functions not only via the root package, js-crypto-utils, but also by directly importing subpackages of intended functions. We should refer to README.md of each subpackage for its detailed usage.
Using npm package is the simplest way to fully leverage jscu functions. Considering you fork, develop, and update jscu packages themselves, i.e., as developers and contributors, usage of this monorepo and procedures for NPM deployment are summarized as follows.
yarn install at the root of the cloned folder. Then the setup is all done.package.json is tied with the root package, i.e., packages/js-crypto-utils. The name of root package is also given in the root package.json.yarn flow:version and bump a version of each package that has been modified on develop branch. Here we note that for each updated package, the updated tag would be committed (not pushed), and hence we should almost finalize the release operation at least for each package. This simultaneously update the repo version specified in the root package.json without committing.yarn release:start to start release process on a release branch. Here we note the release version will be the updated Git repo version.yarn release:finish to merge the release branch to master, and then merge master to develop. It will also tag the master branch with the updated Git repo version, i.e., the root package (packages/js-crypto-utils) version.yarn release:push and push all branches and the generated tag of Git repo version to GitHub.jscu is free, open source software licensed under MIT License.
You can open issues for bugs you've found or features you think are missing. You can also submit pull requests to this repository.
Contributors are more than welcome!
The jscu documentation is a dynamically generated site from this monorepo via esdoc. You can submit pull requests to 'docs' of this monorepo for document update.
FAQs
WebJar for js-crypto-hash
We found that org.webjars.npm:js-crypto-hash demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.