I wish to encrypt credit card numbers one by one using asymmetric encryption on the command line. My current approach is this…
/usr/bin/openssl rsautl -encrypt -inkey 'myKey.pub' -pubin | /usr/bin/openssl enc -base64
openssl enc -base64 -d | openssl rsautl -decrypt -inkey myKey.pem
It is my understanding that this is secure, even when using the same key for each number, because rsautl introduces randomization to prevent finding patterns in the cyphertext.
Am I correct, and is the approach therefore secure?