Socket
Socket
Sign inDemoInstall

crypto-lite

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    crypto-lite

Standard cryptographic algorithms


Version published
Weekly downloads
1.4K
increased by9.46%
Maintainers
1
Install size
10.2 kB
Created
Weekly downloads
 

Readme

Source

Cryptographic algorithms – Coverage Size Buy Me A Tea

Pure JavaScript implementations for:

  • RFC 3174 - SHA-1 - Secure Hash Algorithm 1
  • FIPS 180-2 - SHA-256 - Secure Hash Algorithm 2
  • RFC 3874 - SHA-224 - A 224-bit One-way Hash Function
  • RFC 2104 - HMAC - Keyed-Hashing for Message Authentication
  • RFC 8018 - PBKDF2 - Password-Based Key Derivation Function 2
  • RFC 6238 - TOTP - Time-Based One-Time Password
  • RFC 4226 - HOTP - HMAC-Based One-Time Password

How to use in browser

<script src=crypto-lite.js></script>

<script>
crypto.sha1("secret")
// e5e9fa1ba31ecd1ae84f75caaa474f3a663f05f4
crypto.sha256("secret")
// 2bb80d537b1da3e38bd30361aa855686bde0eacd7162fef6a25fe97bf527a25b
crypto.hmac("sha1", "key", "message")
// 2088df74d5f2146b48146caf4965377e9d0be3a4
crypto.hmac("sha256", "key", "message")
// 6e9ef29b75fffc5b7abae527d58fdadb2fe42e7219011976917343065f58ed4a
crypto.pbkdf2("password", "salt", 1, 20, "sha1")
// 0c60c80f961f0e71f3a9b524af6012062fe037a6
crypto.hotp("secret", { counter: 1, digits 6, algo: "sha1" })
crypto.totp("secret", { time: Date.now(), t0: 0, step: 30, digits 6, algo: "sha1" }) // Defaults
</script>

How to use in node.js

Although it should work in node.js, you should use native api there.

npm install crypto-lite

var crypto = require("crypto-lite").crypto

Licence

Copyright (c) 2014-2021 Lauri Rooden <lauri@rooden.ee>
The MIT License

Keywords

FAQs

Last updated on 28 Aug 2021

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc