On May 19, 2006, at 1:08 PM, Phil M wrote:

On May 19, 2006, at 9:48 AM, Maarten de Vries wrote:

I need a free encryption method, a good, stable one. It doesn't need a Decrypt method, but it wouldn't matter. I must use a key to encrypt the string, and it only needs to work on minwods. I tried Aaron Ballman's Cryptografy module, but it didn't always work. Only some passwords worked :-S. So, you know/got a good free encryptiong method, preferably not plugin? Let me know.

Since you don't need a decrypt, you can use a simple hash method.

Easiest would be an MD5 since it is built into REALbasic, and it would work something like this:

    hash = Md5(secret_phrase + user_password + user_id)

adding the user_id in there means that even if two users have exactly the same password, they would not have the same password hash.

Using MD5 like this to make a stream cipher does require a bit more care. If you encrypt two strings with the same key, then an attacker can XOR the encrypted strings and get the XOR of the two unencrypted strings. With a bit of text guessing, it may then be possible to recover the original text. I'm sure that a web search will turn up ways to work around this.

Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to