MCPcopy Index your code
hub / github.com/aykxt/crypto

github.com/aykxt/crypto @v0.11.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.11.0 ↗ · + Follow
83 symbols 195 edges 47 files 2 documented · 2% updated 16mo agov0.11.0 · 2025-02-14★ 52
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

🔐 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

Block ciphers

Message Authentication Code algorithms (MACs)

Key Derivation Functions (KDFs)

📝 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

Extension points exported contracts — how you extend this code

BlockCipher (Interface)
(no doc) [10 implementers]
src/block-modes/base.ts
TestVector (Interface)
(no doc)
tests/block-modes.test.ts
BlockCipherClass (Interface)
(no doc)
src/block-modes/base.ts
TestVectorWithIV (Interface)
(no doc)
tests/block-modes.test.ts

Core symbols most depended-on inside this repo

encryptBlock
called by 20
src/block-modes/base.ts
decryptBlock
called by 16
src/block-modes/base.ts
decrypt
called by 13
src/block-modes/ecb.ts
pad
called by 12
src/utils/padding.ts
encrypt
called by 12
src/block-modes/ofb.ts
f1
called by 12
src/cast5/mod.ts
hmac
called by 12
src/hmac/mod.ts
unpad
called by 11
src/utils/padding.ts

Shape

Method 38
Class 23
Function 17
Interface 4
Enum 1

Languages

TypeScript100%

Modules by API surface

src/cast5/mod.ts8 symbols
src/block-modes/base.ts8 symbols
src/des/mod.ts7 symbols
src/blowfish/mod.ts6 symbols
src/des/tdes.ts5 symbols
src/block-modes/ige.ts5 symbols
src/block-modes/ecb.ts5 symbols
src/block-modes/ctr.ts5 symbols
src/block-modes/cfb.ts5 symbols
src/block-modes/cbc.ts5 symbols
src/aes/mod.ts5 symbols
src/block-modes/ofb.ts4 symbols

For agents

$ claude mcp add crypto \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact