Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SecretParams

Installation

Add this line to your application's Gemfile:

gem 'secret_params', git: "git@github.com:kera-inc/secret_params.git"

Log into the console and generate a secret key

> EzCrypto::Key.generate
=> "SecretKey"

Set the SECRET_PARAMS_TOKEN environment variable to the generated key.

Install the gem on any machine you need to communicate securely with and use the same generated key.

Usage

Where you would normally do a request like so:

get 'users.html', user_id: 22

Now you wrap the parameters like so:

get 'users.html', SecretParams.encrypt_params(user_id: 22)

On the receiving side in the controller:

before_filter :decrypt_params

def decrypt_params
  params.merge!(SecretParams.decrypt_params(params))
end

About

Secure a hash across an unsecured channel

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages