https://github.com/sixarm/sixarm_ruby_password_hash
SixArm.com » Ruby » Password Hash to do secure SHA256 passwords.
https://github.com/sixarm/sixarm_ruby_password_hash
authentication gem password ruby security
Last synced: over 1 year ago
JSON representation
SixArm.com » Ruby » Password Hash to do secure SHA256 passwords.
- Host: GitHub
- URL: https://github.com/sixarm/sixarm_ruby_password_hash
- Owner: SixArm
- License: other
- Created: 2010-05-24T00:03:50.000Z (about 16 years ago)
- Default Branch: main
- Last Pushed: 2023-09-15T19:28:44.000Z (almost 3 years ago)
- Last Synced: 2025-02-06T00:24:48.591Z (over 1 year ago)
- Topics: authentication, gem, password, ruby, security
- Language: Ruby
- Homepage: http://sixarm.com
- Size: 396 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 »
PasswordHash class to generate secure SHA256 passwords
* Doc:
* Gem:
* Repo:
## Introduction
Password hash tool to create secure passwords,
This uses SHA256 hexdigest for the cryptographic hash,
and authenticates a password, salt, and hash.
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_hash
### Gemfile
To add this gem to your Gemfile:
gem 'sixarm_ruby_password_hash'
### Require
To require the gem in your code:
require 'sixarm_ruby_password_hash'
## Examples
To create a password:
require "sixarm_ruby_password_hash"
text = "mysecret"
salt = "azsxdcfv"
hash = PasswordHash.new(text,salt)
To create a password using our helpers:
require "sixarm_ruby_password_hash"
require "sixarm_ruby_password_salt"
require "sixarm_ruby_password_text"
text = PasswordText.new
salt = PasswordSalt.new
hash = PasswordHash.new(text,salt)
To verify a password:
hash.valid?(text,salt)
To verify a password from a web form for a user:
user = User.find(params[:id]) or raise "user not found"
user.hash.valid?(params[:password],user.salt)