Nygma
Gotham's very own Mr. Nygma, a Rails 4 Encryptor
Compatibility
- Supports Ruby 1.9.3 and 2.
- Travis CI for Ruby 1.9.3, 2.0.0, 2.1.0, and 2.1.5
Usage
crypt = Nygma::Encryptor.crypt!(
Nygma::Configuration.secure_key,
Nygma::Configuration.secure_salt
)
encrypted_data = crypt.encrypt("foo")
# => "bDFTamNFcUxvU052c1MyZ0t5NkppQT09LS1WeDhBZUR1SkphczR2WmxiSWJoUElnPT0=--54f84c7f97986ab9b6afb74aea6e9b5b764cf6c1"
crypt.decrypt(encrypted_data)
# => "foo"
Generate the key with SecureRandom.hex(40)
and salt with SecureRandom.random_bytes(64)
.
Contributing
- Fork it
- 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 new Pull Request
License
This project rocks and uses MIT-LICENSE.