
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@stevent-team/totp
Advanced tools
Lightweight rfc-compliant TOTP authentication library based on `crypto`
Lightweight rfc-compliant TOTP authentication library for nodejs based on crypto
Warning This package is unstable and still in active development. You are more than welcome to contribute and make use of it but please note that there may be breaking changes
Conforms to the IETF RFC 6238 specification including all interoperability test vectors.
yarn add @stevent-team/totp
import { generateTotp, validateTotp, type TotpOptions } from '@stevent-team/totp'
// Configure
const config: TotpOptions = {
secret: process.env['MY_SECRET_KEY'], // REQUIRED
timestamp: Date.now(),
period: 30, // seconds
periodOffset: 0,
algorithm: 'sha512',
outputDigits: 6,
}
// Generate a one time password (on a client)
const pass = generateTotp(config)
console.log(pass) // 568231
// Validate the one time password (on a server)
const isValid = validateTotp(pass, config)
console.log(isValid) // true
Issue and PR contributions are greatly welcomed and appreciated!
totp
is licensed under MIT
Created with love by the Stevent Team 💙
FAQs
Lightweight rfc-compliant TOTP authentication library based on `crypto`
We found that @stevent-team/totp demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.