Well, That's not a hash, that's encryption.
Im not sure how you do that in Javascript without a key, and they key would need to be in the javascript code. I guess you could ajax call back to the server to get the key to encrypt the paramaters, but a sniffer would see the key. If you don't care so much and just want to make it harder to read / tamper with. Just write a function that bit shifts it or similar and back again. Regards Dale Fraser http://dale.fraser.id.au http://cfmldocs.com http://learncf.com http://flexcf.com -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Steve Onnis Sent: Friday, 5 August 2011 12:11 AM To: [email protected] Subject: RE: [cfaussie] JavaScript equivelant to HASH function I just don't want it human readable. Like i have foo.cfm?{"var":"val"} and i just want to encrypt the query string and decrypt it in the foo.cfm page -----Original Message----- From: charlie arehart [mailto:[email protected]] Sent: Thursday, 4 August 2011 10:31 PM To: [email protected] Subject: RE: [cfaussie] JavaScript equivelant to HASH function Steve, you've mentioned 3 really unrelated subjects in this thread: hashing and encoding, and others have mentioned encrypting. So which is it you really need? In your last note, you say "I am passing some JSON strings around which i want to just encode and decode elsewhere". Perhaps if you explain what your goal is, it will help: are you trying to protect the strings from being interpreted by someone between the client and server? That may call for encryption, though as has been noted SSL would solve that, too. Or are you trying to avoid use of some strings that cause a problem with some aspect of what you're doing? In that case, encoding may be the solution. I'd think that whatever creates your JSON strings might already have handled some of that. Hashing is for when you want to take a string and turn it into a new one, where you can't revert back to the original, but you can use that hashed result to compare to later hashing of other strings. So again, what's your real end-goal? Does this help? /charlie > -----Original Message----- > From: [email protected] [mailto:[email protected]] On > Behalf Of Steve Onnis > Sent: Thursday, August 04, 2011 12:58 AM > To: [email protected] > Subject: RE: [cfaussie] JavaScript equivelant to HASH function > > I am passing some JSON strings around which i want to just encode and > decode elsewhere > > -----Original Message----- > From: Zac Spitzer [mailto:[email protected]] > Sent: Thursday, 4 August 2011 2:55 PM > To: [email protected] > Subject: Re: [cfaussie] JavaScript equivelant to HASH function > > bcrypt is pretty good, but the main problem with any decent encryption > in js is as usual IE which is slow and good encryption needs to be > complex... wouldn't using SSL suffice? > > http://code.google.com/p/javascript-bcrypt/ > > On Thu, Aug 4, 2011 at 2:48 PM, Steve Onnis <[email protected]> > wrote: > > Basically i need something that i can use to encode/decode the same > way in > > both cfml and javascript > > > > Any ideas? > > > > > > > > From: Paul Kukiel [mailto:[email protected]] > > Sent: Thursday, 4 August 2011 2:39 PM > > To: [email protected] > > Subject: Re: [cfaussie] JavaScript equivelant to HASH function > > > > hash by default is MD5 as long as you are using md5 then: > > > > http://pajhome.org.uk/crypt/md5/ > > > > Works well. > > > > Paul > > > > On Thu, Aug 4, 2011 at 2:33 PM, Steve Onnis <[email protected]> > wrote: > > > > Does anyone know if there is a JavaScript equivelant to the > coldfusion > > HASH() function? > > > > Steve > > -- You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en. -- You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en. -- You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.
