Decryption

In order to decrypt the RSA-encrypted file, the following command can be used:

$ openssl rsautl -decrypt -inkey privatekey.pem -in message.rsa \  -out message.dec  

Now, if the file is read using cat, decrypted plaintext can be seen as shown here:

$ cat message.dec 
datatoencrypt  

Get Mastering Blockchain - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.