Encrypt / decrypt a string


Is there a way in jquery to decrypt and encrypt a string? I’d rather not use a plugin if can be avoided as just want it for this one task. It doesn’t need to be water tight secure, but reasonably secure.


I know of crypto.js. maybe someone wrote a jQuery-plugin as well, but de-/encryption is not something you can write (natively) in a couple of lines.

Thanks, looks like i’ll have to use a pluging.

This looks good but hasn’t been updated in years https://github.com/gabrieleromanato/jQuery-MD5

you are aware that MD5 is not encryption?


I’m curious. Could you elaborate on what you need to do this for?

Nothing is watertight secure - encryption was invented to make things reasonably secure. The crypto.js library is the most effective way to implement reasonable security because with it hosted by Google there is a better chance of people already having it cached than if you use any of the alternatives.