Sathish Ganesh
Sathish Ganesh

Reputation: 23

How to encrypt a file with AES using OpenSSL?

I am new to shell script. In my project there is a requirement to keep all the sensitive data in encrypted format. For to achieve this I need to openssl in command line tool. I tried the following command openssl aes-256-cbc -a -salt -in secrets.txt -out secrets.txt.enc It is not asking me to enter password. And it is not showing anything. Please help me to solve this problem. Clik here to see the screen shot

Upvotes: 2

Views: 6916

Answers (2)

Xanothos
Xanothos

Reputation: 458

I had the same issue with openssl not providing any output. Executed the same using winpty and it worked as expected:

$ winpty openssl enc -salt -aes-256-cbc -in file -out file.enc
enter aes-256-cbc encryption password:
Verifying - enter aes-256-cbc encryption password:

$ git --version
git version 2.14.1.windows.1

Upvotes: 3

Tom
Tom

Reputation: 3368

If the question is indeed, "How do I encrypt a file with AES" then I think this line might work, found from either here, or here.

openssl enc -aes-256-cbc -salt -in secrets.txt -out secrets.txt.enc

Upvotes: 0

Related Questions