tessl install tessl/npm-crypto-browserify@3.12.0Browser-compatible implementation of Node.js crypto module providing cryptographic operations in web environments.
Agent Success
Agent success rate when using this tile
100%
Improvement
Agent success rate improvement when using this tile compared to baseline
1x
Baseline
Agent success rate without this tile
100%
A library that implements two distinct patterns of RSA encryption for different security goals: confidential messaging and authenticated messaging.
@generates
/**
* Encrypts a message for confidentiality. Only the holder of the corresponding
* private key can decrypt this message.
*
* @param {string|Buffer} publicKey - PEM-encoded RSA public key
* @param {Buffer} message - The message to encrypt
* @returns {Buffer} The encrypted message
*/
function encryptConfidential(publicKey, message) {
// IMPLEMENTATION HERE
}
/**
* Decrypts a confidentially encrypted message using the recipient's private key.
*
* @param {string|Buffer} privateKey - PEM-encoded RSA private key
* @param {Buffer} encryptedMessage - The encrypted message
* @returns {Buffer} The decrypted message
*/
function decryptConfidential(privateKey, encryptedMessage) {
// IMPLEMENTATION HERE
}
/**
* Encrypts a message for authenticity verification. This proves the sender
* owns the private key. Anyone with the public key can decrypt and verify.
*
* @param {string|Buffer} privateKey - PEM-encoded RSA private key
* @param {Buffer} message - The message to encrypt
* @returns {Buffer} The encrypted message
*/
function encryptAuthenticated(privateKey, message) {
// IMPLEMENTATION HERE
}
/**
* Decrypts an authenticated message using the sender's public key.
* Successful decryption proves the message came from the private key holder.
*
* @param {string|Buffer} publicKey - PEM-encoded RSA public key
* @param {Buffer} encryptedMessage - The encrypted message
* @returns {Buffer} The decrypted message
*/
function decryptAuthenticated(publicKey, encryptedMessage) {
// IMPLEMENTATION HERE
}
module.exports = {
encryptConfidential,
decryptConfidential,
encryptAuthenticated,
decryptAuthenticated,
};Provides cryptographic operations including RSA encryption and decryption.