Skip to content

CodingChatRoom/Encryption-Decryption-Basic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” GPG Encryption & Decryption Bash Script

This simple yet powerful Bash script allows you to securely encrypt and decrypt files using GPG (GNU Privacy Guard) with a passphrase.

Perfect for cybersecurity beginners, ethical hackers, or privacy-conscious users who want a quick CLI tool to protect sensitive files.


πŸ“œ Features

βœ… Encrypt any file with GPG
βœ… Decrypt any .gpg encrypted file
βœ… User-friendly menu
βœ… Minimal and clean Bash scripting
βœ… Great for learning encryption basics


πŸš€ How to Use

1. πŸ“₯ Clone or Copy the Script

Create a new file and paste the script:

touch test.sh
nano test.sh

Paste Code in it ( test.sh )

Make the script executable:

chmod +x test.sh
  1. πŸ” Run the Script
./test.sh

Choose one of the options:

1 to encrypt a file using a passphrase.

2 to decrypt a .gpg file using the passphrase.

πŸ“¦ Example

βœ… Encrypt

./test.sh

Encrypt or Decrypt

1. Encrypt File

2. Decrypt File

Enter Choice: 1

Choose File to Encrypt: secrets.txt

➑️ You’ll be prompted for a passphrase. GPG will create secrets.txt.gpg.

πŸ”“ Decrypt

./test.sh

Encrypt or Decrypt

1. Encrypt File

2. Decrypt File

Enter Choice: 2

Choose File to Decrypt (.gpg): secrets.txt.gpg

➑️ Enter the same passphrase to decrypt. The original content will display in the terminal.


⚠️ Tips & Warnings

Keep your passphrase strong and secret πŸ”‘

Do not delete the original file manually before testing the .gpg file

This script uses symmetric encryption (gpg -c), which is simple and fast

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages