From: Peter Hickman Date: 2010-08-24T22:39:17+09:00 Subject: Re: If input contains.... That is not going to be very secure. This is what I use when I need a username or password for some part of my system #!/usr/bin/env ruby a = [ ('0'..'9').to_a, ('a'..'z').to_a, ('A'..'Z').to_a, "_"].flatten 10.times do puts (0..30).map{a[rand(a.size)]}.join('') end Which gives output like: 0Lqimr_6JWoXvFR_UWA0CZo6J23QFci mwB8_i5N2LPPcHsLQQBfafUUBMZvxxO nhjWija1r2a_1BSpxhuGOyC3eXIQwjd d2Jj1mS6ah_OqmWH0J4wL8lOaugfH6t jZ7_9IYHa9G_JBqha4hMhKo3PnbnMhc vHjIM925PbqrW_1rOvNLtktSIqdQZQU ClxbfZp0dg5oxHstqHgfNJyMnPbQTa7 boODNYczqZoNuFeg_ROQ5fj1BPNg3m4 KlBhifcZy_Sl4mFew2e4PBMQasOuBTL 3RZXBYZfmHxiMx1lfBKMsilmIK5vgzN Pick one for the username and another for the password. Actually I use a slightly more complex script (using more symbols) but rest assured converting ordinary text into 1337 text is old hat and even the dumbest brute force password cracker will try them because people like you think that b00k is more secure than book. Also why did you not try and google for this first?