Skip to main content

Encrypt a file in Linux



# vim test.txt (write something here)
 
This is a Test file
 
:wq
Now see the Content of the file using cat command
 
# cat test.txt
 
This is Test file
 
Now we are going to Encrypt the file with gpg
 
# gpg -c test.txt
 
Enter Pass-phrase : <YOUR-PASSWORD>
Repeat Pass-phrase : <YOUR-PASSWORD>
 
You can see one more file create
 
# ls -l test*
-rw-rr 1 root root 59 2011-03-02 17:20 test.txt
-rw-rr 1 root root 97 2011-03-02 17:23 test.txt.gpg
 
Lets try to see encrypt file with cat command
 
# cat test.txt.gpg
i+`P$@CoEkW%>o
8*zbB`EA9{7
IW
 
Delete original File
 
# rm test.txt
 
Now we are going to decrypt the encrypted file
 
# gpg test.txt.gpg
Enter Pass-phrase : <YOUR-PASSWORD>
 
See decrypted file content
 
# cat test.txt
This is a Test file

Comments

Popular posts from this blog

How to lock any file or folder without any software.

  With this trick, you can create a secure password protected  folder  in Windows which no one except you can access. To use this trick, follow the instructions given below:-   1.  Open  Notepad . 2.   Copy and paste  the exact code given below:- cls @ECHO OFF title computer-tricks-corner.blogspot.com if  EXIST  "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto  UNLOCK if NOT EXIST MyFolder goto MDMyFolder :CONFIRM echo Are you sure to lock this folder? (Y/N) set/p "cho=>" if %cho%==Y goto LOCK if %cho%==y goto LOCK if %cho%==n goto END if %cho%==N goto END echo  Invalid  choice. goto CONFIRM :LOCK ren MyFolder "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" echo Folder locked goto End :UNLOCK echo Enter password to Unlock Your Secure Folder set/p "pass=...

How to install Bash on Windows 11

Microsoft’s Windows Subsystem for Linux 2 was released nearly 3 years ago. This brought the ability to run the Bash shell and run Linux binary executables that you’d be able to run on Ubuntu Linux. Microsoft has since only continued to improve its Windows Subsystem for Linux, and an update in a Windows 10 preview build back in mid-2020 made it easier to install Bash. That method carried over to Windows 11. To install Bash, open Windows Terminal as an admin. You can do this by right-clicking the Windows icon and selecting “Windows Terminal (Admin)” from the power user menu. (If you’re on Windows 10, you may see it listed as “Windows Powershell (Admin)” in the menu.) Run Windows Terminal as an admin In Windows Terminal, run this command: wsl --install The command to install WSL Windows will then begin downloading and installing Virtual Machine Platform, Windows Subsystem for Linux, WSL Kernel, and GUI App Support. It will also download Ubuntu, but will install it after a re...

The Best Free Tools for Encrypting your Data

The Internet world revolves around two important terms:  security  and  privacy . Data encryption is probably the best solution to get both of these necessities, as you can not only password protect your files, but you also have the option of masking and denying the fact that you've got something to conceal. Unfortunately, not everyone can afford to spend money on premium software, so I've decided to offer you a list with the best free encryption tools that you can find on the market. Each of the applications included in this collection is focused on a specific task, so no matter what your encryption needs are, you will most likely find something suitable for your purposes. In case you are completely new to this field, I will start by telling you that encryption is considered to be the most efficient method of keeping your data private. When a file is encrypted, the data inside it is scrambled and only someone with the right password (and the same encryption applica...