Skip to content
/ crypto Public

πŸ” Fast crypto library for Deno written in pure Typescript. AES, Blowfish, CAST5, DES, 3DES, HMAC, HKDF, PBKDF2

License

Notifications You must be signed in to change notification settings

aykxt/crypto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

8137a99 Β· Feb 15, 2025

History

65 Commits
Feb 13, 2025
Feb 13, 2025
Feb 13, 2025
Feb 13, 2025
Mar 11, 2021
Feb 14, 2025
Oct 15, 2020
Feb 13, 2025
Apr 5, 2021
Feb 13, 2025
Apr 5, 2021
Apr 5, 2021
Feb 15, 2025
Feb 15, 2025
Apr 5, 2021
Mar 25, 2021
Mar 14, 2021
Mar 26, 2021
Apr 5, 2021

Repository files navigation

πŸ” Deno Crypto

A collection of useful cryptographic algorithms written in Typescript.


πŸ§ͺ This project is still in an early stage of development. Expect breaking changes.


βœ” Supported algorithms

Message Authentication Code algorithms (MACs)

πŸ“ Examples

AES-128-CBC

import { Aes } from "https://deno.land/x/crypto/aes.ts";
import { Cbc, Padding } from "https://deno.land/x/crypto/block-modes.ts";

const te = new TextEncoder();

const key = te.encode("SuperDuperSecret");
const data = te.encode("DataToBeEncrypted");
const iv = new Uint8Array(16);

// Ciphers have an internal state, you should therefore create
// separate ciphers for encryption and decryption
const cipher = new Cbc(Aes, key, iv, Padding.PKCS7);
const decipher = new Cbc(Aes, key, iv, Padding.PKCS7);

const encrypted = cipher.encrypt(data);
const decrypted = decipher.decrypt(encrypted);

πŸ”” Disclaimer

This repository has not yet received any formal cryptographic and security reviews. USE AT YOUR OWN RISK