Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const generateKeys4096Demo = async () => {
console.log('generateKeys4096Demo')
const keys = await RSA.generateKeys(4096)
console.log('4096 private:', keys.private) // the private key
console.log('4096 public:', keys.public) // the public key
const encodedMessage = await RSA.encrypt('4096', keys.public)
console.log('4096 encoded message:', encodedMessage)
const message = await RSA.decrypt(encodedMessage, keys.private)
console.log('4096 decoded message:', message);
}