Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
encryptBufferFunc: (chunk: Buffer) => publicEncrypt_long(chunk, receiverPublicKey, 128, 11, RSA_PKCS1_PADDING),
plainBlockSize: 128 - 11,
encrypt_buffer: function (chunk) {
return crypto_utils.publicEncrypt_long(chunk, receiverPublicKey, 128, 11);
}
};
function RSAOAEP_Encrypt(buffer: Buffer, publicKey: PublicKeyPEM): Buffer {
const keyLength = rsa_length(publicKey);
return publicEncrypt_long(buffer, publicKey, keyLength, 42, RSA_PKCS1_OAEP_PADDING);
}
function RSAPKCS1V15_Encrypt(buffer, publicKey) {
const key_length = crypto_utils.rsa_length(publicKey);
return crypto_utils.publicEncrypt_long(buffer, publicKey, key_length, 11, crypto_utils.RSA_PKCS1_PADDING);
}
function RSAOAEP_Encrypt(buffer, publicKey) {
const key_length = crypto_utils.rsa_length(publicKey);
return crypto_utils.publicEncrypt_long(buffer, publicKey, key_length, 42, crypto_utils.RSA_PKCS1_OAEP_PADDING);
}
function RSAPKCS1V15_Encrypt(buffer: Buffer, publicKey: PublicKeyPEM): Buffer {
const keyLength = rsa_length(publicKey);
return publicEncrypt_long(buffer, publicKey, keyLength, 11, RSA_PKCS1_PADDING);
}