From the course: Linux Tips

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Encrypting files

Encrypting files - Linux Tutorial

From the course: Linux Tips

Encrypting files

- [Instructor] Some files need to be protected, and to protect files from being read, we can use encryption. When we encrypt a file, we run it through an encryption algorithm that makes the contents unreadable without a particular piece of information, a key or password. On a Linux system, we can do this with the GPG tool. First, let's take a look at encrypting a file with a passphrase. This is symmetric encryption. The same piece of information used to encrypt the file is used to decrypt it. Using a passphrase is convenient because you can remember a passphrase or share it with other people you want to be able to decrypt the file. To start out, let's create a file. I'll echo this is secret text to a file called secretfile. Now, I can use gpg -c and the name of the file to encrypt that file. I'm asked to enter a passphrase. So I'll do that, and I'll confirm it. If you're using a remote console, you'll see this prompt in the console. Now, I have a file called secretfile.gpg. Let's take…

Contents