https://github.com/sixarm/sixarm_ruby_password_text
SixArm.com » Ruby » PasswordText class to generate good secure random password
https://github.com/sixarm/sixarm_ruby_password_text
authentication gem password ruby security
Last synced: 4 months ago
JSON representation
SixArm.com » Ruby » PasswordText class to generate good secure random password
- Host: GitHub
- URL: https://github.com/sixarm/sixarm_ruby_password_text
- Owner: SixArm
- License: other
- Created: 2010-05-24T00:08:58.000Z (about 16 years ago)
- Default Branch: main
- Last Pushed: 2025-04-14T09:20:40.000Z (about 1 year ago)
- Last Synced: 2025-04-14T10:30:33.887Z (about 1 year ago)
- Topics: authentication, gem, password, ruby, security
- Language: Ruby
- Homepage: http://sixarm.com
- Size: 355 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Citation: CITATION.cff
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# SixArm.com → Ruby →
PasswordText class to generate secure user-friendly passwords
* Doc:
* Gem:
* Repo:
## Introduction
Generates strong yet user-friendly passwords using Ruby's secure random cryptographic functions.
You can change how passwords are created using the optional parameters and the return value is a string, so you can do string methods on it.
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_text
### Gemfile
To add this gem to your Gemfile:
gem 'sixarm_ruby_password_text'
### Require
To require the gem in your code:
require 'sixarm_ruby_password_text'
## Details
The default length is 12 characters, which is sufficiently strong for most web applications. You can make this stronger as needed.
The default character array is optimized for usability and accessibility, to help mobile phone users and people with disabilities: all letters are lowercase and letters that look like numbers (specifically, "i", "l", "o") are not used.
## Examples
require "sixarm_ruby_password_text"
password = PasswordText.new => "avzwbnxremcd"
password = PasswordText.new(:length => 4) => "avzw"
password = PasswordText.new(:length => 4, :chars => ['x','y','z']) => "yzyx"
## SecureRandom
Ruby 1.8.6 and older does not include a secure random number method so this gem checks to see if the SecureRandom class is defined and, if not, requires the sixarm_ruby_secure_random gem (http://github.com/sixarm/sixarm_ruby_secure_random).