Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aykxt/crypto
๐ Fast crypto library for Deno written in pure Typescript. AES, Blowfish, CAST5, DES, 3DES, HMAC, HKDF, PBKDF2
https://github.com/aykxt/crypto
3des aes blowfish cast5 cbc cfb ciphers crypto ctr deno des ecb hkdf hmac ofb pbkdf2 typescript
Last synced: about 2 months ago
JSON representation
๐ Fast crypto library for Deno written in pure Typescript. AES, Blowfish, CAST5, DES, 3DES, HMAC, HKDF, PBKDF2
- Host: GitHub
- URL: https://github.com/aykxt/crypto
- Owner: aykxt
- License: mit
- Created: 2020-10-01T14:58:02.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-09-29T20:57:11.000Z (about 1 year ago)
- Last Synced: 2024-10-18T10:27:50.452Z (2 months ago)
- Topics: 3des, aes, blowfish, cast5, cbc, cfb, ciphers, crypto, ctr, deno, des, ecb, hkdf, hmac, ofb, pbkdf2, typescript
- Language: TypeScript
- Homepage: https://deno.land/x/crypto
- Size: 158 KB
- Stars: 53
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
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]
- [AES] (Rijndael)
- [Blowfish]
- [CAST5] (CAST-128)
- [DES]
- [3DES]
- ECB, CBC, CFB, OFB and CTR [block modes]### [Message Authentication Code] algorithms (MACs)
- [HMAC]
### [Key Derivation Functions] (KDFs)
- [HKDF]
- [PBKDF2]## ๐ Examples
#### AES-128-CBC
```ts
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**[Block ciphers]: https://en.wikipedia.org/wiki/Block_cipher
[block modes]: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation
[AES]: https://en.wikipedia.org/wiki/Advanced_Encryption_Standard
[Blowfish]: https://en.wikipedia.org/wiki/Blowfish_(cipher)
[CAST5]: https://en.wikipedia.org/wiki/CAST-128
[DES]: https://en.wikipedia.org/wiki/Data_Encryption_Standard
[3DES]: https://en.wikipedia.org/wiki/Triple_DES
[Message Authentication Code]: https://en.wikipedia.org/wiki/Message_authentication_code
[HMAC]: https://en.wikipedia.org/wiki/HMAC
[Key Derivation Functions]: https://en.wikipedia.org/wiki/Key_derivation_function
[HKDF]: https://en.wikipedia.org/wiki/HKDF
[PBKDF2]: https://en.wikipedia.org/wiki/PBKDF2