Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#259·jsencrypt

Can not support PrivateKey encrypt and PublicKey decrypt

Author: jackieonwayCreated Sep 13, 2022Updated Sep 12, 2024

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)

Source: travist/jsencrypt

View original on GitHubView discussion on GitHub