An open API service indexing awesome lists of open source software.

https://github.com/sixarm/sixarm_ruby_password_salt

SixArm.com » Ruby » Password salt to create secure user-friendly passwords
https://github.com/sixarm/sixarm_ruby_password_salt

authentication gem password ruby security

Last synced: over 1 year ago
JSON representation

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

Awesome Lists containing this project

README

          

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

* Doc:
* Gem:
* Repo:

## Introduction

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

For docs go to

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.