42c9a1903c85a813b570b2911a5601911d22811faa125cd87e47f9dc677f5eb207c04196dff0709f6dac37bcb7d000a299ba0bbc6c1050d05ce5441401b5e4 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # crypto-browserify <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
  2. A port of node's `crypto` module to the browser.
  3. [![github actions][actions-image]][actions-url]
  4. [![coverage][codecov-image]][codecov-url]
  5. [![License][license-image]][license-url]
  6. [![Downloads][downloads-image]][downloads-url]
  7. [![Sauce Test Status](https://saucelabs.com/browser-matrix/crypto-browserify.svg)](https://saucelabs.com/u/crypto-browserify)
  8. [![npm badge][npm-badge-png]][package-url]
  9. The goal of this module is to reimplement node's crypto module, in pure javascript so that it can run in the browser.
  10. Here is the subset that is currently implemented:
  11. * createHash (sha1, sha224, sha256, sha384, sha512, md5, rmd160)
  12. * createHmac (sha1, sha224, sha256, sha384, sha512, md5, rmd160)
  13. * pbkdf2
  14. * pbkdf2Sync
  15. * randomBytes
  16. * pseudoRandomBytes
  17. * createCipher (aes)
  18. * createDecipher (aes)
  19. * createDiffieHellman
  20. * createSign (rsa, ecdsa)
  21. * createVerify (rsa, ecdsa)
  22. * createECDH (secp256k1)
  23. * publicEncrypt/privateDecrypt (rsa)
  24. * privateEncrypt/publicDecrypt (rsa)
  25. ## todo
  26. these features from node's `crypto` are still unimplemented.
  27. * createCredentials
  28. ## contributions
  29. If you are interested in writing a feature, please implement as a new module,
  30. which will be incorporated into crypto-browserify as a dependency.
  31. All deps must be compatible with node's crypto
  32. (generate example inputs and outputs with node, and save base64 strings inside JSON, so that tests can run in the browser)
  33. see [sha.js](https://github.com/dominictarr/sha.js)
  34. Crypto is _extra serious_ so please do not hesitate to review the code, and post comments if you do.
  35. ## License
  36. MIT
  37. [package-url]: https://npmjs.org/package/crypto-browserify
  38. [npm-version-svg]: https://versionbadg.es/browserify/crypto-browserify.svg
  39. [deps-svg]: https://david-dm.org/browserify/crypto-browserify.svg
  40. [deps-url]: https://david-dm.org/browserify/crypto-browserify
  41. [dev-deps-svg]: https://david-dm.org/browserify/crypto-browserify/dev-status.svg
  42. [dev-deps-url]: https://david-dm.org/browserify/crypto-browserify#info=devDependencies
  43. [npm-badge-png]: https://nodei.co/npm/crypto-browserify.png?downloads=true&stars=true
  44. [license-image]: https://img.shields.io/npm/l/crypto-browserify.svg
  45. [license-url]: LICENSE
  46. [downloads-image]: https://img.shields.io/npm/dm/crypto-browserify.svg
  47. [downloads-url]: https://npm-stat.com/charts.html?package=crypto-browserify
  48. [codecov-image]: https://codecov.io/gh/browserify/crypto-browserify/branch/main/graphs/badge.svg
  49. [codecov-url]: https://app.codecov.io/gh/browserify/crypto-browserify/
  50. [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/browserify/crypto-browserify
  51. [actions-url]: https://github.com/browserify/crypto-browserify/actions