crypt
crypt
This is a amateur WIP, made for fun, and is not of good quality.
Crypt is a crystal-library for encrypting and decrypting cipers.
Most of what is here works like it should, apart for some problems with casing in alphabet chars, this is easily avoided by using only uppercased chars, but im working on fixing the bufg, the bug causes case-sensitive ciphers like the dvorak-substitution-cipher to not work properly.
I have no expertise in ciphers, so any constructive feedback is very much welcome, even just a simple explanation of expexted behaviour.
Currently the only avaible ciphers are simple substitution-ciphers, and the tabula recta.
Installation
Add this to your application's shard.yml
:
dependencies:
crypt:
github: Jens0512/crypt
Usage
require "crypt"
Simple caesar ciphers
rot3 = Ciphers.caesar 3
encrypted = rot3.encrypt "This, is, weak!" # => "Wklv, lv, zhdn!"
rot3.decrypt encrypted # => "This, is, weak!"
rot3.transform! cut_unknown?: true
rot3.encrypt "This, is, weak!" # => "Wklv lv zhdn"
Simple substitution-ciphers
cipher = Ciphers.substitution("1234",
"4321")
cipher.encrypt "12345" # => "43215"
cipher.decrypt "400" # => "100"
Contributing
Help wanted! See: #1
- Fork it ( https://github.com/[your-github-name]/crypt/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- Jens0512 Jens - creator, maintainer
crypt
- 0
- 0
- 1
- 0
- 0
- over 6 years ago
- September 18, 2018
MIT License
Sun, 22 Dec 2024 16:51:09 GMT