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
- Host: GitHub
- URL: https://github.com/sixarm/sixarm_ruby_password_salt
- Owner: SixArm
- License: other
- Created: 2010-05-24T00:06:37.000Z (about 16 years ago)
- Default Branch: main
- Last Pushed: 2023-09-15T19:28:45.000Z (almost 3 years ago)
- Last Synced: 2025-02-06T00:24:38.178Z (over 1 year ago)
- Topics: authentication, gem, password, ruby, security
- Language: Ruby
- Homepage: http://sixarm.com
- Size: 337 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Codeowners: CODEOWNERS
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.