GPG

GPG is a tool, that help us, to create an encrypted messages by AES.

[LETS MAKE IT WORK]

#1) Open a terminal & type:
assault@kalivm:~$ sudo gedit
*Inside the editor file, type whatever you want*

*For example*

gpg-a

*Save & close the file*

#2) Let’s navigate to the file location – in our case, it will be under /Documents folder.
assault@kalivm:~$ cd ~/Documents
assault@kalivm:~/Dcouments$ ls

*As you can see, the TXT file is a regular TXT file*

gpg-b

*Take a look, we’ve already checked that by cat command*
*As you can see, the content of the file, is a PLAINTEXT, means that the file is readable*

#3) Open a new terminal tab & type:
assault@kalivm:~/Dcouments$ sudo gpg -c encrypted.txt
*The -c flag means a symmetric encryption*
*Now, enter the password that want for the txt file*

*As you can see, there is a new file that called: encrypted.txt.gpg

gpg-c

*This is the time to delete the original file (encrypted.txt) – If you want*

*Let’s try to open the encrypted.txt.gpg file by double click on the file*

*This is the results*

gpg-d

*Let’s try to open the encrypted.txt.gpg file by cat command*

*This is the results*

gpg-e

*As you can see, there is no way to open the file in the regular way, and read the content of it*

*To make the encrypted.txt.gpg file to be a PLAINTEXT like before, what we need to do is*

#4) At the terminal, type:
assault@kalivm:~/Dcouments$ sudo gpg encrypted.txt.gpg
*Now, enter your gpg password that you’ve added to your txt file, and you will get this output*
gpg: CAST5 encrypted data
gpg: encrypted with 1 passphrase
File ‘encrypted.txt’ exists. Overwrite? [y/N): N
*Let’s hit N, (if you didn’t deleted the original file), and save the new file under a new name*

*Now, Let’s open the new file (decrypted.txt) by cat command. And the result is*

gpg-f

*As you can see, we’ve change the encrypted.txt.gpg to: decrypted.txt. And by the cat command, we’re able to read the content of the encrypted.txt file*

*The Red arrows shows the output, when we tried to view the content, BEFORE the decryption process*
*The Blue arrows shows the output, when we tried to view the content, AFTER the decryption process*

[NOTICE]

After the gpg encrypted process, we love to RENAME the file manually FROM something.txt.gpg TO something.txt
So if someone will try to decipher the file, he will not know, with which encryption system we’ve used, to encrypt the file.
Unless, he know how to mount the file as a BIN, and read a BIN file.
BTW, our favorite software for reading a BIN file, is 010Editor.

 

ENJOY! 🙂

 

Here is an example by Gamer Forever