0.0
No commit activity in last 3 years
No release in over 3 years
Create and/or save values created by SecureRandom.hex(64). Ideal for plain-text passwords that should not be in source control.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.3
>= 0
>= 0
 Project Readme

MakeSecret

Make Secret will create random values generated by SecureRandom.hex(64). It stores these values in key/value form either in memory on in a file. The ideal situation for Make Secret is if you have plain-text passwords that need to be hidden from source control.

Installation

Add this line to your application's Gemfile:

gem 'make_secret'

And then execute:

$ bundle

Or install it yourself as:

$ gem install make_secret

Usage

# Require the gem
require 'make_secret'

# To Store data in memory
memory_value = MakeSecret::Value.for( :key )  => result of SecureRandom.hex(64)
memory_value == MakeSecret::Value.for( :key ) => true

# To Store data in a file
file_value = MakeSecret::Value.for( :key, 'my_file' ) => result of SecureRandom.hex(64)
file_value = MakeSecret::Value.for( :key, 'my_file' ) => true

file_value == memory_value => false

Rails 4.0.0

I will be using this for new Rails applications. Open up config/initializers/secret_token.rb, and replace this:

MyApp::Application.config.secret_key_base = ' ... '

With this:

MyApp::Application.config.secret_key_base = MakeSecret::Value.for( :key_base, '.make_secret' )

Then add /.make_secret to the ignore file

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request