How can I trick the -in argument of the OpenSSL command line tool in order to get data from string instead a file?
Normally, I could use echo command to do it:
echo 'test string 1' | openssl enc -aes-256-cbc -a -salt -pass pass:mypassword
Is there a way I can do it without echo and pipe? Similar to the -pass pass: argument?
Thanks in advance!
I found a way to go around this! Instead of passing everything before and since openssl has an interactive mode, it’s possible to run the command without input:
And OpenSSL will be waiting for data to encrypt. This can be also useful for streams!
Then type in the string or data you want to encrypt and send a
EOT(End of Transmission) in Terminal is usual^DControl+Dit it will output tostdoutthe encrypted string!Hope this may help someone some day!