Skip to content

SixArm/sixarm_ruby_password_salt

Repository files navigation

SixArm.com → Ruby →
PasswordSalt class to generate secure user-friendly passwords

Introduction

Password tool to create strong user-friendly salt for hashes, using Ruby's secure random cryptographic functions.

For docs go to http://sixarm.com/sixarm_ruby_password_salt/doc

Want to help? We're happy to get pull requests.

Install

Gem

To install this gem in your shell or terminal:

gem install sixarm_ruby_password_salt

Gemfile

To add this gem to your Gemfile:

gem 'sixarm_ruby_password_salt'

Require

To require the gem in your code:

require 'sixarm_ruby_password_salt'

Example

Generate a salt:

require 'sixarm_ruby_password_salt'
PasswordSalt.new => "ezkabtsu"

This generates a secure random 8 character salt of all lowercase letters with 26^8 combinations. This can easily be sent via web URIs, email, etc.

SecureRandom

Ruby 1.8.6 and older does not have a secure random number method, so this gem checks to see if the SecureRandom class is defined; if it is not, then we require our sixarm_ruby_secure_random gem.

About

SixArm.com » Ruby » Password salt to create secure user-friendly passwords

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages