CryptApi
The gem sending an encrypted request to the specified address and decrypting of the received response. Demo-version 0.1.9.
Installation
Add this line to your application's Gemfile:
gem 'crypt-api'
And then execute:
$ bundle
Or install it yourself as:
$ gem install crypt-api
Usage
After installation CryptApi, you need to run the generator:
$ rails g initializer crypt_api
The generator will create a file config/intializers/crypt_api.rb to set up the necessary configs.
Now you can send encrypted data call the following method:
secret_data = { secret_param_1: "param1", secret_param_2: "param2" }
encrypted_response = CryptApi::Main.send_encrypted_request(data: secret_data)
And also receive and decrypt the response:
params = {data: "encrypted_data",...}
CryptApi::Main.decrypt_response(params[:data])
Contributing
- Fork it ( https://github.com/alexmatskevich/crypt-api/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