How to Encrypt Files from the Command Line
How to encrypt files from the command line

We all increasingly depend on the cloud to store and back up files, and that means in some cases we need additional protection. Password-protecting a zip of our content is a great first step, but if you're thinking about a more robust option, you might want to encrypt files from the command line using the open source tool Kryptor.

Dropbox provides 2 GB of online space for free accounts. Google Drive raises that to a respectable 15 GB. OneDrive offers 5 GB for new users, but those with older profiles have 25 GB at their disposal. There are very good reasons to take advantage of that online space, but at the same time we must be careful. After all, a leak could expose a good part of our digital life...

What can we do to avoid it? A solid line of defense is file encryption. Directly syncing your content is convenient, but encrypting files adds an extra layer of protection that should thwart more than one attacker. The web offers all sorts of tools for this, and today we're going to explore one that is free, portable, open source, and offline: Kryptor.

How to Encrypt Files with Kryptor

How to Encrypt Files from the Command Line
Don't worry, it's easy to use!

The only thing Kryptor asks in return is to run it from the command line. Its earlier versions had a GUI, but the developer seems to have decided to focus on the CLI edition, improving its security. Fortunately, there's nothing to worry about: Kryptor is very easy to master once you know its flags.

For example, to encrypt a folder with all its contents, it's enough to use the command kryptor -e -p "fileorfoldername". Kryptor recommends that paths to files and folders with spaces in their names be enclosed in quotes to avoid confusion, and it also has an automatic backup generator, thus preventing encrypted files from overwriting the originals (this can be forced with the -o option, but I don't recommend it).

How to Encrypt Files from the Command Line
You can tell Kryptor to include the names in the encryption

Entering the password to encrypt files and folders is interactive. This follows UNIX style, so you won't see the password or its confirmation while typing. To decrypt files, the command changes slightly to kryptor -d -p "fileorfoldername", always without overwriting (encrypted and decrypted files will share the same folder).

Kryptor has additional functions to generate public and private keys, use keyfiles, and encrypt file names during the process, but if all you care about is encrypting files from the command line, you don't need to do anything else. Kryptor was recently updated, and its website has extensive documentation that you should study more closely if you have questions. Give it a try!

Official site and download: Click here