問題描述
如何使用算法 RSA/ECB/PKCS1Padding 通過 JavaScript 解密加密字符串 (How to decrypt through JavaScript of encrypted string using algorithm RSA/ECB/PKCS1Padding)
I have encrypted string using algorithm RSA/ECB/PKCS1Padding through java code now the same need to be decrypted using javascript. There are some information regarding RSA on net but still not able to get logic to decrypt through javascript. Need to decrypt string with no server intervention.
I am well versed with java hence i know how to apply symmetric and asymmetric cryptography through java code. That's why encryption part is already done by me. I can decrypt the same through java code.
Requirement is to do decryption through javascript (i.e. at browser) without server intervention. Here I am not asking for code but looking for material to implement the same as I am not able to find anything in concrete.
參考解法
方法 1:
You may want to check out forge, there are lots of examples for decrypting (or encrypting) on the README:
https://github.com/digitalbazaar/forge
It's unclear what you mean by RSA/ECB/PKCS1Padding ‑‑ but forge has support for RSA encryption /decryption using PKCS#1 padding and AES and 3DES CBC encryption/decryption. Hopefully it will work for you.