JavaScript tool for encrypting and decrypting classical ciphers.
For now, you must clone this repository, install all dependencies (npm install) and run npm run build in the command line.
Then include the cryptos.js file from build folder to your document.
<script src="path/to/cryptos.js" type="text/javascript"></script>In the near future there will be an npm package and CDN version of this library.
You can use cryptos methods by accessing cryptos object. Then, you must provide cipher name, and method with arguments.
Each cipher contains only two methods - encrypt() and decrypt(), but the arguments are different.
cryptos.cipherName.methodName(arguments)Example:
//encrypt string with Caesar cipher with the shift of 4
cryptos.caesar.encrypt("Hello world!", 4)
//outputs Lipps asvph!
cryptos.caesar.decrypt("Lipps asvph!", 4)
//outputs Hello world!- Library documentation
- Vigenère cipher
- Polybius square cipher
- Importing ciphers directly from cryptos package e.g.
import Caesar from 'cryptos'