I was thinking of it in the opposite way - the number 191 hashes into
LTL or BJL, which is why the encryption produces two different outputs.
The alphabetic value is representing a decimal number, not a decimal
representing an alphabetic value.

That example is convertable both ways = I can convert 191 into either
LTL or BJL, and either one of those two values can be converted back to
191.

Hashing is not always a "theoretically unique" value.  I know of hashes
that will produce the same hash value from different input values, but
those are not typically used in encryption/decryption algorithms, where
recovery of the original form is an issue.  I've seen them in storage
algorithms when I was a student.

In the end, I am not an encryption expert but I play one on TV. :-)  I
was offering the reason I thought it most likely that the encryption
algorithm offers up multiple versions of encrypted text from the same
data.


Matthew Small
IT Supervisor
Showstopper National Dance Competitions
3660 Old Kings Hwy 
Murrells Inlet, SC 29576
843-357-1847
http://www.showstopperonline.com

-----Original Message-----
From: Mosh Teitelbaum [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, November 20, 2002 4:52 PM
To: CF-Talk
Subject: RE: Encryption gurus please read

Err... this way would make it near impossible to decode the value.
Using
your simple example, how would the decryption routine know which value
to
return when decrypting "191?"  Should it return "BJL" or "LTL?"

Also, encrypting should not be confused with hashing.  Encrypting a
value
uses a 2-way algorithm so as to allow the encrypted value to be
decrypted
(i.e., "abc" -> "X%2" -> "abc").  Hashing creates a theoretically unique
value that is difficult to near-impossible to "decrypt" (i.e., "abc" ->
X%2 -> ???).

I have checked out the CustomTags mentioned, but earlier versions of
ColdFusion (and, I suspect, these CustomTags) sometimes add junk on to
the
end of the encryption string (perhaps, to return a fixed length string).
So, depending on whatever internal algorithm is used, encrypting "abc"
with
a key of "123" may randomly produce "xyzpdq123" or "xyzpdq456" or
"xyzpdq789".  Note how in this (admittedly contrived) example, the first
6
characters are the same... only the last 3 differ from outcome to
outcome.
In decrypting, the function/CustomTag somehow detects that only the 1st
6
characters are relevant and uses those to decrypt the string back to its
original value.

--
Mosh Teitelbaum
evoch, LLC
Tel: (301) 625-9191
Fax: (301) 933-3651
Email: [EMAIL PROTECTED]
WWW: http://www.evoch.com/


> -----Original Message-----
> From: Matthew Small [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, November 20, 2002 3:49 PM
> To: CF-Talk
> Subject: RE: Encryption gurus please read
>
>
> I think it's because encrypted values are not evaluated for their own
> value, but are rather hashed - thereby there can be more than one
value
> that hashes out to the same value.
>
> Simple Example: I have a decimal number that needs to be encrypted if
> A=0, b=1,...j = 9, k = 0, l = 1, then I can have multiple values that
> evaluate to the same number.  It's similar to clock or modular
> arithmetic.
>
> BJL = 191
> LTL = 191
>
>
> Matthew Small
> IT Supervisor
> Showstopper National Dance Competitions
> 3660 Old Kings Hwy
> Murrells Inlet, SC 29576
> 843-357-1847
> http://www.showstopperonline.com
>
> -----Original Message-----
> From: Bryan Stevenson [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, November 20, 2002 3:25 PM
> To: CF-Talk
> Subject: Encryption gurus please read
>
> Hey All,
>
> I'm not entirely sure why I'm getting the results I am, so I'll ask
this
> question:
>
> Why is it that the returned encrypted value can vary even though the
> string
> being encrypted and the key used remains constant (i.e. when
encrypting
> "yeehaw" with the key "boohoo" will not always return the same
encrypted
> value)?
>
> BTW I've tested this situation against cf_cryp, cf_crypt, and
Encrypt()
>
> TIA ;-)
>
> Bryan Stevenson B.Comm.
> VP & Director of E-Commerce Development
> Electric Edge Systems Group Inc.
> t. 250.920.8830
> e. [EMAIL PROTECTED]
>
> ---------------------------------------------------------
> Macromedia Associate Partner
> www.macromedia.com
> ---------------------------------------------------------
> Vancouver Island ColdFusion Users Group
> Founder & Director
> www.cfug-vancouverisland.com
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

Reply via email to