1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
#!/usr/bin/ruby
# Original Version: # 2002 (c) by Christian Garbs <mitch@cgarbs.de> # Quick pronounceable password generator (Japanese rulez ^^;) # Licensed under GNU GPL. # # $Id: pwd_gen.pl,v 1.2 2002/12/03 22:26:53 mitch Exp $ # # $Log: pwd_gen.pl,v $ # Revision 1.2 2002/12/03 22:26:53 mitch # Update to syllables list (thx to Maxi!) # # Ruby Port and Extension : # zero|seeker <chris@co-i60.com> # $Id: pwd_gen.rb,v 1.0 2003/02/08 04:36:37 zeroseeker Exp $
def pwd_gen( sylamount = 3, numamount = 3, nummax = 10 )
syllables = [ 'a', 'i', 'u', 'e', 'o', 'ka', 'ga', 'ki', 'gi', 'ku', 'gu', 'ke', 'ge', 'ko', 'go', 'sa', 'za', 'shi', 'zi', 'su', 'zu', 'se', 'ze', 'so', 'zu', 'ta', 'da', 'chi', 'di', 'tsu', 'du','te', 'de', 'to', 'do', 'na', 'ni', 'nu', 'ne', 'no', 'ha', 'ba', 'pa', 'hi', 'bi', 'pi', 'fu', 'bu', 'pu', 'he', 'be', 'pe', 'ho', 'bo', 'po', 'ma', 'mi', 'mu', 'me', 'mo', 'ya', 'ya' , 'yu', 'yu', 'yo', 'yo', 'ra', 'ri', 'ru', 're', 'ro', 'wa', 'wa', 'wo', 'n' , 'kya', 'kyu', 'kyo', 'gya', 'gyu', 'gyo', 'sha', 'shu', 'sho', 'ja', 'ju', 'jo', 'cha', 'chu', 'cho', 'nya', 'nyu', 'nyo', 'bya', 'byu', 'byo', 'pya', 'pyu', 'pyo', 'mya', 'myu', 'myo', 'rya', 'ryu', 'ryo' ] passwd = '' sylamount.times { passwd << syllables[rand( syllables.length )] } numamount.times { passwd << rand( nummax ).to_s }
return passwd end
puts pwd_gen()
|