jsencrypt icon indicating copy to clipboard operation
jsencrypt copied to clipboard

Can not support PrivateKey encrypt and PublicKey decrypt

Open jackieonway opened this issue 3 years ago • 3 comments

i can not use this to encrypt data by private key and decrypt data by public key. such as

 const encryptor = new JSEncrypt();
 encryptor.setPrivateKey(privateKey); // set private key;
 return encryptor.encrypt(data);
    const decryptor = new JSEncrypt()
    decryptor.setPublicKey(publicKey)// set public key
    return  decryptor.decrypt(data)

jackieonway avatar Sep 13 '22 00:09 jackieonway

Why not use sign()?

tonychanczm avatar Nov 01 '22 02:11 tonychanczm

What's the point of encrypting something to be decrypted by a public key? Keyword here is public

trasherdk avatar Nov 23 '22 08:11 trasherdk

https://github.com/travist/jsencrypt/issues/2

xujintai123 avatar Sep 12 '24 09:09 xujintai123