Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Password Generator
#1
Code:
[code]
print "How many characters do you want in your password?: "
characters = gets.chomp
puts "1) Yes"
puts "2) No"
print "Do you want numbers?: "
numbers = gets.chomp
characters = characters.to_i
numbers = numbers.to_i
if numbers == 2
    while 0 < characters
        characters = characters - 1
        password = (?a.ord + rand(26)).chr
        print password
    end
end
if numbers == 1
    characters = characters / 2
    while 0 < characters
        characters = characters - 1
        password = (?a.ord + rand(26)).chr
        passwordnumber = rand(10)
        print password, passwordnumber
    end
end
puts ""
Reply
#2
Sorry for bumping, but this is useful thanks !
Reply
#3
I'll try it. Thanks for it ;)
Reply
#4
I will try for sure. Thanks for the share.
(05-24-2010, 06:15 PM)Omniscient Wrote: We take HF refugees in bulk.
Lol
Reply
#5
(03-23-2010, 10:16 PM)nevets04 Wrote:
Code:
[code]
print "How many characters do you want in your password?: "
characters = gets.chomp
puts "1) Yes"
puts "2) No"
print "Do you want numbers?: "
numbers = gets.chomp
characters = characters.to_i
numbers = numbers.to_i
if numbers == 2
    while 0 < characters
        characters = characters - 1
        password = (?a.ord + rand(26)).chr
        print password
    end
end
if numbers == 1
    characters = characters / 2
    while 0 < characters
        characters = characters - 1
        password = (?a.ord + rand(26)).chr
        passwordnumber = rand(10)
        print password, passwordnumber
    end
end
puts ""

good work friend! Blackhat
My informational thread on how to become HQ
[Image: 3af27e76.png]
"An eye for an eye and the whole world would be blind"
Reply
#6
Thank you man, I am going to check it out.
Reply
#7
This is very usefull thanks for the source code.
Reply
#8
I am trying now, but so far it seems like there have been good results.
Reply
#9
I'm going to check and test it out soon, but thanks for sharing. Much appreciated!
Reply
#10
Good work keep it up
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)