# Create keypair
key <- keygen()
pub <- pubkey(key)
# Basic encryption
msg <- serialize(iris, NULL)
ciphertext <- simple_encrypt(msg, pub)
out <- simple_decrypt(ciphertext, key)
stopifnot(identical(msg, out))
Run the code above in your browser using DataCamp Workspace