- Advanced Blockchain Development
- Imran Bashir Narayan Prusty
- 86字
- 2021-06-24 14:04:58
Encryption
Taking the private key generated in the previous example, the command to encrypt a text file message.txt can be constructed as shown here:
$ echo datatoencrypt > message.txt $ openssl rsautl -encrypt -inkey publickey.pem -pubin -in message.txt \
-out message.rsa
This will produce a file named message.rsa, which is in a binary format. If you open message.rsa in the nano editor or any other text editor of your choice, it will show some garbage as shown in the following screenshot:

message.rsa showing garbage (encrypted) data