OpenSSL genrsa-out RSAKEY.PEM 1024//Generate RSA key for 1024bit and save to Rsakey.pem where the key is not encrypted
OpenSSL genrsa-aes128-out rsakey.pem-passout pass:123456 1024//generates an RSA key for 1024bit, where the key is encrypted using AES128 and the key password is 123456
OpenSSL rsa-in rsakey.pem-out rsa_pubkey.pem-pubout//Enter a key file to extract the public key file where the output public key file is not encrypted
OpenSSL rsa-in rsakey.pem-out rsa_pubkey.pem-pubout-aes128-passin pass:123456//Use AES128 to encrypt the public key of the output with a key password of 123456
OpenSSL rsautl-in original.txt-out encrypt.txt-inkey rsa_pubkey.pem-pubin-encrypt-passin pass:123456//Using public key to Origi Nal.txt for encryption,-pubin means using the public key
OpenSSL rsautl-in encrypt.txt-out decrypt.txt-inkey rsakey.pem-decrypt-passin pass:123456//decryption of encrypted files
OpenSSL rsautl-in original.txt-out encrypt.txt-inkey rsakey.pem-pubin-encrypt-passin pass:123456//encrypt
OpenSSL rsautl-in original.txt-out sign.txt-inkey rsakey.pem-sign-passin pass:123456//sign
OpenSSL rsautl-in sign.txt-out verify.txt-inkey rsa_pubkey.pem-pubin-verify-passin pass:123456//verify
Generate keys, encryption, and signatures using OpenSSL