I have a base64 encoded string that contains a 3DES encrypted png file. I need to show this image on the client side provided the right password is given by the client. I have been searching for some crypto library with this functionality but could not find any (or at least none with some documentation or examples). I know of many nice libraries that support AES encryption, but ATM my input is 3des encrypted and I can't change that. Could someone point me to a library with built in 3des decryption ? Also an example would be great.
Asked
Active
Viewed 3,405 times
2 Answers
0
Have you checked jscryptolib? They provide:
- Symmetric encryption: AES, DES, 3DES
- Encryption mode: ECB, CBC, CTR
- Digest algorithm: SHA-1, SHA256
- Message Authentication Code (MAC): HMAC, CBCMAC, CMAC
- Random number generator (RNG): FIPS186, X9.17
- Public key cryptography: RSA, DSA, ECC, CPK, IBE
It's LGPL licensed, so you should not have problems using it on your project.

Paulo Fidalgo
- 21,709
- 7
- 99
- 115
-
This is what is stated on the front page but I have yet to find any piece of code that relates to 3des encryption. And since there is no documentation for it and the fact that there is an empty `des.js` file makes me believe this library is not complete. I could be wrong ... – drcelus Jun 28 '12 at 13:17
0
So I did the Google search for "javascript 3des" for you. Here's the first result.
http://etherhack.co.uk/symmetric/des_3des/
(JS: http://etherhack.co.uk/symmetric/des_3des/js/dessrc.js)
How this works on binary data is another question - how do you store the binary data in your JS right now anyway?

Mörre
- 5,699
- 6
- 38
- 63
-
I found this link myself the first time I googled, unfortunately, this resource lacks any form of documentation, and I am having a hard time understanding how the function works. But thanks anyway. – drcelus Mar 14 '12 at 10:45