jsencrypt
jsencrypt copied to clipboard
why the public key only can encrypt not decrypt
in my project use RSA encrypt ,and try use JSEncrypt to decrypt in java all encrypt and decrypt is ok such like private key encrypt => public key decrypt, private key sign => public key verify, public key encrypt => private decrypt. but in JSEncrypt only public key encrypt and in java private decrypt is okey other function always not passed. signature method in java is SHA256withRSA ,and in js is CryptoJS.SHA256 verify not passed, and try not use verify to decrypt also not passed hope someone can help me .
by the way, the RSA certificate is 2048 bit
签名算法格式有很多标准的,你后端可能是jwt,前端可能格式不一样,要么后端用node.js也跑这个库。 中国式英语也不贴代码谁帮得了你
He might want to know the signature format.Is it jwt?
公钥不是用于解密的 用私钥加密[公钥解密]是不可能的。 RSA最初的设计就是为了公钥用于公开的