toy_crypto - a Ruby gem illustrating simple crypto concepts

Build Status Code Climate

ToyCrypto is...

ToyCrypto implements some elementary cryptography concepts in a way that is intended to be easy to read and hopefully easy to learn. Check out this example: ```ruby => require 'toy_crypto' true

=> secret = "One two three four five six seven eight".key_xor("Laverne") "\x03\x0F\x13E\x06\x19\nl\x15\x1E\x17\x17\vE*\x0E\x03\x17R\b\f:\x04V\x16\e\x16E?\x04\x00\x00\x1CN\x00%\x06\x1E\x11"

=> ToyCrypto::Solvers.break_block_cipher secret, keysize: 5 :plaintext=>"llv cvi\tp{xtn Oa`r7mcYa3stu Zaocy+eJe{t", :fitness=>48302.333333333336

=> ToyCrypto::Solvers.break_block_cipher secret, keysize: 7 :plaintext=>"One two three four five six seven eight", :fitness=>87371.46153846153 ```

Project home

toy_crypto on Github

Try it!

With Bundler

gem "toy_crypto", "~> x.y.z"

Direct from Rubygems

toy_crypto on RubyGems

Build from master (Github)

git clone git://github.com/dpritchett/toy_crypto.git
cd toy_crypto
bundle install
rake rebuild

Author

Daniel Pritchett | dpritchett@gmail.com

License

MIT