openSSL crypto library:
Example:
#!/bin/bash
# generate key
openssl genrsa -out rsakey1024.txt 1024
# generate public key
openssl rsa -in rsakey1024.txt -out publickey1024.txt -pubout
# visualize the components rsa (-text)
#openssl rsa -in rsakey1024.txt -text
#openssl rsa -in publickey1024.txt -text -pubin
# ENCRYPT: RSA 1024 bit
openssl pkeyutl -encrypt -in plaintext.txt -out ciphertext.txt -inkey rsakey1024.txt
# DECRYPT: RSA 1024 bit
openssl pkeyutl -decrypt -in ciphertext.txt -out verification.txt -inkey rsakey1024.txt