The same set of public and private key encrypted text produces different types of variables?

77 Views Asked by At
function encrypt(encrypted, publicKey) {
    const encrypt = crypto.publicEncrypt(publicKey, Buffer.from(encrypted));
    return encrypt;
}
var ciphertext = this.encrypt("***",key.exportKey('public'))

Use the public and private keys generated by node rsa to encrypt using crypto and public key. How can I solve it?

enter image description here

I tried the conversion between uint8array and buffer, but it's different

0

There are 0 best solutions below