views:

68

answers:

3

How do I encrypt something in jQuery?
I want to have the option to encrypt via
SHA1 or MD5.

How do I do that?

A: 

have list of plugins in this link :

http://plugins.jquery.com/taxonomy/term/1575

i think you want something like :

http://plugins.jquery.com/project/sha256

Haim Evgi
A: 

You can use this proven library: http://pajhome.org.uk/crypt/md5

It's not a jQuery plugin - just call the functions as needed.

johans
+1  A: 

This isn't a direct answer to the question, but considerations you should take into account with the overall approach:

Though you could do something in jQuery, you should use SSL if at all possible, this is a much more secure way of passing information back and forth to the server if that's your goal.

Encrypting content via JavaScript but still sending it in plain-text really does nothing to thwart man-in-the-middle attacks, which while some people imagine to be rare because you must control some point in the connection...how many people use third-party WiFi, at the coffee house, etc? Anywhere with a public hotspot is easy game for a man-in-the middle, just something to keep in mind.

Nick Craver