Encrypted files using Cygwin and OpenSSL

Using Cygwin, the free open-source terminal emulator, in coordination with OpenSSL, you can create cross-platform encrypted files. The files created using Cygwin can be exported using mobile media including thumb drives, CDs, external hard drives, etc. Cygwin and OpenSSL are bundled in the download of Cygwin. The following tutorial (although demonstrated using Windows Vista) can be applied to Windows XP, Linux, and Mac OS.

Download Cygwin from the project homepage. Cygwin is the executable located approximately half-way down the page.

Double-click setup.exe to begin the installation and click Next.

Cygwin1 small

Choose Install from Internet and click Next.

Cygwin2 small

Leave the installation directory as C:’cygwin and leave the Default Text File Type set as Unix/binary and click Next.

Cygwin3 small

Change the local package directory path to C:’Users’USERNAME’ and click Next.

Cygwin4 small

On the Select Your Internet Connection dialog, select Direct Connection and click Next.

Cygwin5 small

Select a mirror and click Next.

cygwin6 small

Untie the “Net” tab, double-click openssl and click Next.

Cygwin7 small

It will take a few minutes for Cygwin to install.

Cygwin8 small

Leave the default icon selections and click Finish.

Cygwin9 small

Congratulations, the installation of Cygwin is complete. Double-click the icon on your desktop to launch Cygwin.

Cygwin10 small

Cygwin will create several personalization files and will launch the default window (shown below).

Cygwin11 small

In order to create an encrypted version of a file enter the following command:

​openssl des3 -salt -in UnencryptedFile.html -out EncryptedFile.html.des3

Replace “unencryptedFile.html” with the name of a file you would like to encrypt. OpenSSL will prompt you to create a password for the file.

Cygwin12 small

You will now notice an encrypted version of your file was created in the same directory and named “EncryptedFile.html.des3.” If you try to open this file without first entering the password, you will get incoherent output. To decrypt your file, enter the following command:

​openssl des3 -d -salt -in EncryptedFile.html.des3 -out NewUnencryptedFile.html

OpenSSL will once again prompt you to enter your password. Upon successful authentication, OpenSSL will create a new, decrypted version of your file in the same directory.

Cygwin13 small

Once your file is encrypted, you can transport the file onto portable media in the same way that you would transfer any other file. You will be able to decrypt your file on any computer with OpenSSL installed including Linux, Windows Vista or Windows XP, or Mac OS.

Related Articles

Recent Security Forum threads

Got a question? Post it on our Security Forums!