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

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

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).