Key Pair
[desktop@luxor RgiEnc]$ openssl version OpenSSL 1.1.1d FIPS 10 Sep 2019 [desktop@luxor RgiEnc]$ openssl genrsa -des3 -out secret.key 2048 Generating RSA private key, 2048 bit long modulus (2 primes) .................................................................................+++++ ......................................................................................+++++ e is 65537 (0x010001) Enter pass phrase for secret.key: Verifying - Enter pass phrase for secret.key: [desktop@luxor RgiEnc]$ openssl rsa -in secret.key -out public.key -outform PEM -pubout Enter pass phrase for secret.key: writing RSA key
Encrypt
[desktop@luxor RgiEnc]$ openssl rand -base64 128 > rgikey [desktop@luxor RgiEnc]$ cat rgikey optygS6e4C23kNgzpelDIG3pza8xAplkyEMXGXzZwIGV7oXyEMVS8ARyiRmJ+9Ea OpSH3dQc1HnzCtXRvs2QaNqxZWWAAxz46MbtYlmFmKdNqad8OVn8GYYHA6h5GKYk emMBxXuaPB3itVqEnIGS76M2sVf9qtZAA9H4VQ24TPE= [desktop@luxor RgiEnc]$ openssl enc -aes-256-cbc -salt -iter 1000 -in FakeNames.txt -out FakeNames.enc1 -pass file:rgikey [desktop@luxor RgiEnc]$ openssl rsautl -encrypt -inkey public.key -pubin -in rgikey -out rgikey.en