@irfanshadikrishad/cipher
v1.4.1
Published
A versatile and secure cryptographic library for implementing various cipher algorithms in Node.js applications with zero/0 dependencies.
Maintainers
Readme
@irfanshadikrishad/cipher
A versatile and secure cryptographic library for implementing various cipher algorithms in Node.js applications with zero/0 dependencies.
🚀 Installation
Install the package via npm:
npm install @irfanshadikrishad/cipheryarn:
yarn add @irfanshadikrishad/cipherbun:
bun add @irfanshadikrishad/cipher📖 Usage
Import the library and use a cipher algorithm:
import { Cipher } from '@irfanshadikrishad/cipher'
// Create a Caesar Cipher instance with a shift of 6
const caesar = new Cipher.Caesar(6)
console.log(caesar.encrypt('hello world')) // Output: "nkrru cuxrj"🔐 Supported Ciphers
This library provides implementations of various classical and modern ciphers:
| Cipher | Type | Key required? | Strength | Used In/Notes | | --------------------------------------------------- | ---------------------------------------- | ------------- | --------- | --------------------------------------------------- | | Caesar Cipher | Substitution | No | Low | Ancient Rome, Simple Obsfuscation | | Atbash Cipher | Substitution | No | Low | Hebrew Cipher, Basic Encryption | | Playfair Cipher | Diagraph-based | Yes | Medium | Used in WWI & WWII | | Vigenère Cipher | Polyalphabetic | Yes | Medium | Used in Historical Documents | | The Alphabet Cipher | Polyalphabetic | Yes | Medium | Inspired by Vigenere, Cryptography Puzzles | | Salsa20 | Stream Cipher | Yes | High | Modern Cryptography, Secure Communications | | ADFGVX | Polybius Square + Columnar Transposition | Yes | Medium | Used in WWI, Known for 6x6 polybius square | | AES | Symmetric Block Cipher | Yes | High | Also known as, Rijndael | | DES | Symmetric Block Cipher | Yes | Medium | 56-bit key, Used in legacy systems, replaced by AES | | ECC | Asymmetric (Public-Key Cryptography) | Yes | Very High | Used in modern systems like Bitcoin, TLS, JWT, etc. | | ROT13 | Substitution (Caesar variant) | No | Very Low | Simple text obfuscation, not secure |
More ciphers coming soon...
🍀 Contribution
To contribute on the codebase, follow contribution guideline.
❤️ Support
If you find this library useful, consider giving it a ⭐ on GitHub!
Thanks for visiting! (>'-'<)
