Skip to content

Cryptography

@zugriff/cryptography

This package is part of the zugriff ecosystem. It benefits from a direct integration on our systems and falls back to WASM on yours.

@zugriff/cryptography adheres to the OWASP minimum requirements. Hashes are returned PHC formatted.

Usage

Terminal window
npm i --save @zugriff/cryptography

Argon2

Recommended

import { argon2id } from '@zugriff/cryptography';
// Create account
const password = await argon2id.hash('password'); // $argon2id$v=19..
// Login
await argon2id.verify('password', password); // true

Scrypt

import { scrypt } from '@zugriff/cryptography';
// Create account
const password = await scrypt.hash('password'); // $scrypt$ln=17..
// Login
await scrypt.verify('password', password); // true