From: Jan Svitok Date: 2007-01-13T22:51:08+09:00 Subject: Re: MD5 BSD like passwords On 1/13/07, Felipe Cruxen wrote: > I'm coding a "postfixadmin" using ruby, so, all the passwords are stored > in DB using a bsd like md5 hash. Is there any simple way I could > generate passwords like that (the same hash could be used to generate > shadow pass?)?. > > Really sorry for my lame english, and if the question is stupid, but I'm > a real newbie to ruby. you can generate MD5 with: require 'digest/md5' hash = Digest::MD5.digest(data) # binary or hash = Digest::MD5.hexdigest(data) #hexa