Skip to content

Instantly share code, notes, and snippets.

View Harasz's full-sized avatar
:atom:

Jakub Sydor Harasz

:atom:
View GitHub Profile
@Harasz
Harasz / bitwarden-simple.ts
Last active July 23, 2024 13:57
An attempt in Node.js to create a simple example of how Bitwarden works under the hood. Based on [Bitwarden Security White Paper](https://bitwarden.com/help/bitwarden-security-white-paper/)
import {
createHmac,
createCipheriv,
createDecipheriv,
randomBytes,
generateKeyPairSync,
privateDecrypt,
publicEncrypt,
} from "crypto";
import { hash, argon2id } from "argon2";