Dropbox Encryption: Encrypted Cloud Storage – Linux – EncFS

Almost all cloud storage services encrypt customers data, however this doesn’t mean that the privacy of this data is protected enough.

The most of those services also manage the keys used for encryption, that means that your encrypted folder can be decrypted not only by you.

In this article i will show make a private encrypted cloud storage solution based on Dropbox with on-the-fly encryption.

I will show how to encrypt files and folders in Dropbox by yourself using EncFS for Linux. (more…)

HowTo: Create a Password Protected ZIP File in Linux

This is a small note that describes how to encrypt and decrypt a ZIP file from the Linux command line.

I’ll show how to create a password protected ZIP archive from one or several unprotected files or folders.

Warning! The standard ZIP encryption is very weak and could be cracked easily.

Password Protected ZIP File in Linux

Create an encrypted ZIP file secure.zip from some file:

$ zip --encrypt secure.zip file
Enter password: 
Verify password: 
  adding: file (deflated 8%)

Create password protected ZIP archive secure.zip from the several files:

$ zip --encrypt secure.zip file1 file2 file3
Enter password: 
Verify password: 
  adding: file1 (stored 15%)
  adding: file2 (deflated 30%)
  adding: file3 (deflated 45%)

Create an encrypted ZIP archive secure.zip from a folder /var/log/:

$ zip --encrypt -r secure.zip /var/log/
Enter password: 
Verify password: 
  adding: var/log/ (stored 0%)
  adding: var/log/dmesg.0 (deflated 74%)
  adding: var/log/dpkg.log.9.gz (deflated 0%)
  adding: var/log/samba/log.asc-nb (deflated 96%)
***

Use the following command to uncompress a ZIP file:

$ unzip secure.zip
Enter password:
***

Encrypt and Decrypt ZIP Archive in Linux

You were interactively prompted for the password in the examples above.

If you want to create a password protected ZIP file from some shell script, you may want to do it non-interactively.

This method is more insecure, as the password is entered as plain text.

You can easily encrypt and decrypt ZIP files from the Linux command line without being prompted for the password.

Do it as follows:

$ zip -P passw0rd secure.zip file
$ zip -P passw0rd secure.zip file1 file2 file3
$ zip -P passw0rd -r secure.zip /var/log/

Uncompress a password protected ZIP archive:

$ unzip -P passw0rd secure.zip

Encrypt DNS Traffic With DNSCrypt

This tutorial describes how to install and set up DNSCrypt on Debian based systems, like Linux Mint, Ubuntu etc.

DNSCrypt Proxy – is a tool for securing communications between a client and a DNS resolver.

It encrypts DNS requests using the DNSCrypt Protocol and pass them to an upstream server, by default OpenDNS.

Resolving dependencies

Install the packages necessary to compile DNSCrypt.

$ sudo apt-get install build-essential

Download and extract the latest libsodium library:

$ wget http://download.libsodium.org/libsodium/releases/libsodium-0.4.2.tar.gz  -O - | tar -xz

Install the library:

$ cd libsodium-0.4.2/
$ ./configure && make
$ sudo make install
$ sudo ldconfig
$ cd ..
$ rm -rf libsodium*

DNSCrypt Proxy Installation

Download and extract the latest DNSCrypt Proxy:

$ wget http://download.dnscrypt.org/dnscrypt-proxy/dnscrypt-proxy-1.3.3.tar.gz  -O - | tar -xz

Install the DNSCrypt Proxy:

$ cd dnscrypt-proxy-1.3.3/
$ ./configure  && make
$ sudo make install
$ cd ..
$ rm -rf dnscrypt-proxy*

Run the following command to start DNSCrypt:

$ sudo /usr/local/sbin/dnscrypt-proxy --daemonize --pidfile=/run/dnscrypt-proxy.pid --edns-payload-size=4096

Reconfigure Network Manager to use DNSCrypt:

  • Open Network Connections from the menu.
  • On the Wired or Wireless tab highlight your active Internet connection.
  • Click “Edit”.
  • On the IPv4 Settings tab, set Method to “Automatic (DHCP) addresses only” and set DNS servers to “127.0.0.1”.
  • Click “Save”.
  • Click “Close”.

Restart Network Manager:

$ sudo restart network-manager

Final Test

Visit http://www.opendns.com/welcome page to test your connection.

You should be welcomed to OpenDNS.

Run DNSCrypt Proxy at System Startup

Once everything works as expected, it is necessary to include dnscrypt-proxy to our rc.local to run automatically whenever the system boots.

To do this open the /etc/rc.local file:

$ sudo vi /etc/rc.local

Paste the following line before the line where exit 0 appears.

exec /usr/local/sbin/dnscrypt-proxy --daemonize --pidfile=/run/dnscrypt-proxy.pid --edns-payload-size=4096

More info about DNSCrypt

Encrypt & Decrypt Files With Password Using OpenSSL

OpenSSL is a powerful cryptography toolkit that can be used for encryption of files and messages.

If you want to use the same password for both encryption of plaintext and decryption of ciphertext, then you have to use a method that is known as symmetric-key algorithm.

From this article you’ll learn how to encrypt and decrypt files and messages with a password from the Linux command line, using OpenSSL. (more…)