From: W Kent Starr Date: 2002-11-06T05:53:39+09:00 Subject: Re: Ruby encoder On Tue, 2002-11-05 at 14:33, Carl Youngblood wrote: > Question: Has anyone developed a Ruby encoder that would allow me to > encrypt my Ruby code to avoid revealing database passwords or other such > things to a potential hacker? > > Thanks, > Carl > > With regard to passwords, you could embed MD5 hashes into your code and then use MD5.new("password") to check against these.You could also dispense with embedding and read the MD5 hashed passwords from a separate file (which I believe is the preferred way to do this.) As for "other such things") it depends. Md5 is a one-way hashing -- you can't get the original value back out. This works fine for checking input against static values, but not for data that has to be re-ouput into readable form.or for data that goes in and out dynamically. For such needs you should check out the cryptography library section at RAA (Ruby Application Archive). You also might want to take a lokk at Michael Neumann's cryptography page at http://www.s-direktnet.de/homepages/neumann/crypt/en/ Hope this helps. Regards, W. kent Starr