I've got to write a script that will contain a password in it & would
like to make at least a token effort at obfuscating (if not actually
encrypting) it.
It looks to me like the only encrypt-y thing in the standard libs is
String.crypt, which does a one-way hash. Is that right? So it's
looking to me like I can Base64.encode it, or else download crypt-fog
or some such thing.
I've got to write a script that will contain a password in it & would
like to make at least a token effort at obfuscating (if not actually
encrypting) it.
It looks to me like the only encrypt-y thing in the standard libs is
String.crypt, which does a one-way hash. Is that right? So it's
looking to me like I can Base64.encode it, or else download crypt-fog
or some such thing.
I actually just wrote a pure-Ruby Vignere cipher encryption routine for the next version of KirbyBase. The Vignere cipher is a substituion cipher, like rot13, but it is a little more secure because it uses a key to determine substition. Still not very secure, but something about the name and the fact that it was developed hundreds of years ago appealed to me.
Anyway, if you are interested, I could email you the code. It's not pretty, but it works.
Jamey Cribbs
Confidentiality Notice: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. If you are not the intended recipient(s), you are hereby notified that any dissemination, unauthorized review, use, disclosure or distribution of this email and any materials contained in any attachments is prohibited. If you receive this message in error, or are not the intended recipient(s), please immediately notify the sender by email and destroy all copies of the original message, including attachments.
Check out digest and use your choice of md5, sha1, sha2, etc...
Patrick
···
On Apr 1, 2005 3:14 PM, rpardee@comcast.net <rpardee@comcast.net> wrote:
It looks to me like the only encrypt-y thing in the standard libs is
String.crypt, which does a one-way hash. Is that right? So it's
looking to me like I can Base64.encode it, or else download crypt-fog
or some such thing.
Am Samstag, 02. Apr 2005, 05:14:44 +0900 schrieb rpardee@comcast.net:
I've got to write a script that will contain a password in it & would
like to make at least a token effort at obfuscating (if not actually
encrypting) it.
It looks to me like the only encrypt-y thing in the standard libs is
String.crypt, which does a one-way hash. Is that right? So it's
looking to me like I can Base64.encode it, or else download crypt-fog
or some such thing.
There's also 'cyphersaber' on RAA. It adds methods to string to encrypt
and decrypt. I haven't used it much but it seems good (commercial
restrictions though).
Ben
···
On Friday 01 April 2005 15:14, rpardee@comcast.net wrote:
I've got to write a script that will contain a password in it & would
like to make at least a token effort at obfuscating (if not actually
encrypting) it.
It looks to me like the only encrypt-y thing in the standard libs is
String.crypt, which does a one-way hash. Is that right? So it's
looking to me like I can Base64.encode it, or else download crypt-fog
or some such thing.
Hmm... to quote ri: "Nothing known about digest." 8^)
Oh wait, here it is in the pickaxe book. Looks like this only does
hashes tho--I think I'm going to need something 2-way I think. I want
to "encrypt" the pwd & hard-code the "ciphertext" into my script & have
the script "decrypt" said ciphertext at run time.
Aye--thanks. I actually saw that & followed the openssl rabbit down
the hole until I got to the whole "here's the source--get you a
compiler & have at it" part.
I need to run my script from several computers, all of which are
scheduled for OS upgrades (read: hd wipes) in the near future. So I
was hoping for something that comes right out of the box w/ruby, so I
wouldn't have to remember where I got something & how I installed it.
But this is pretty low-priority stuff--I'm just trying to keep out the
shoulder-surfers. So if I have to do base64, that's far from tragic.
So is this a good place to agitate/whine for the inclusion of some of
the all-ruby crypto algorithms out there in the standard lib? Maybe
nothing's ready for prime-time? Maybe it's better to try to get it in
the windows one-click installer, on the theory that the unixies (and
macsters?) all have openssl?
On Apr 2, 2005 3:09 AM, rpardee@comcast.net <rpardee@comcast.net> wrote:
So is this a good place to agitate/whine for the inclusion of some of
the all-ruby crypto algorithms out there in the standard lib? Maybe
nothing's ready for prime-time? Maybe it's better to try to get it in
the windows one-click installer, on the theory that the unixies (and
macsters?) all have openssl?
Aye--thanks. I actually saw that & followed the openssl rabbit down
the hole until I got to the whole "here's the source--get you a
compiler & have at it" part.
I need to run my script from several computers, all of which are
scheduled for OS upgrades (read: hd wipes) in the near future. So I
was hoping for something that comes right out of the box w/ruby, so I
wouldn't have to remember where I got something & how I installed it.
The one-click installer for windows comes with openssl builtin. From
the release notes: