# Generate keypair
key <- keygen()
pub <- pubkey(key)
# Encrypt message with pubkey
msg <- serialize(iris, NULL)
ciphertext <- simple_encrypt(msg, pub)
# Decrypt message with private key
out <- simple_decrypt(ciphertext, key)
stopifnot(identical(out, msg))
Run the code above in your browser using DataCamp Workspace