5
$\begingroup$

How to use OpenSSL in windows for encryption and decryption ?

$\endgroup$

1 Answer 1

5
$\begingroup$

First, download OpenSSL for Windows from a reputable source. Here is a good place to start: https://wiki.openssl.org/index.php/Binaries

After installing OpenSSL, open a command prompt. You can chose among the many algorithms, but if you dont know what you want, going with AES-256 in CBC mode is a good start.

C:\Users\admin>openssl aes-256-cbc -a -salt -in file.txt -out encrypted-file.txt.enc
enter aes-256-cbc encryption password:  
Verifying - enter aes-256-cbc encryption password:

C:\Users\admin>type encrypted-file.txt.enc
U2FsdGVkX19v2JTUzRF/BRwy7egsmi+4A1KXyJfQmBF70cg0Go+EvroxvXd8ugiI

C:\Users\admin>openssl aes-256-cbc -d -a -in encrypted-file.txt.enc -out decrypted-file.txt
enter aes-256-cbc decryption password:

Here is a screenshot of what it looks like on Windows 10. Note, you can't see the password being typed, but you will have to type a password to encrypt the file, and the same to decrypt it. Screenshot of OpenSSL on Windows 10

I hope this helps you get started.

$\endgroup$
2
  • $\begingroup$ Note that while this will work, it won't help you detect malicious manipulations of the ciphertext. $\endgroup$
    – SEJPM
    Mar 22, 2017 at 10:38
  • $\begingroup$ Install cygwin, and select openssl package. You can also select gpg in there. And all the other goodies of course. $\endgroup$
    – Maarten Bodewes
    Mar 23, 2017 at 0:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.