Is encrypting credit card numbers one by one with rsautl secure? I wish to encrypt credit card numbers one by one using asymmetric encryption on the command line. My current approach is this…

Encrypt:

/usr/bin/openssl rsautl -encrypt -inkey 'myKey.pub' -pubin | /usr/bin/openssl enc -base64


Decrypt:

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?
As long as you use a secure padding mode (i.e. -pkcs or -oaep, not -raw).  The default padding mode for openssl rsautl is -pkcs (i.e. PKCS#1 v1.5), so you should be OK.  That said, OAEP is recommended over PKCS#1 v1.5 padding, so you might want to use the -oaep switch.