securing file using password and GPG

Purpose

some time you want to share a file(s) to other but also want to make it sure that it should not be access by other then whom you want to send,
so GPG is the answer.

What is GPG

according to Wikipedia:

GNU Privacy Guard (GnuPG or GPG) is a free software replacement for Symantec’s PGP cryptographic software suite. GnuPG is compliant with RFC 4880, which is the IETF standards track specification of OpenPGP. Modern versions of PGP and Veridis’ Filecrypt are interoperable with GnuPG and other OpenPGP-compliant systems.

in simple words GPG is used to encrypt and decrypt content using well defined algorithms

How to password protect a file

  • open ‘git bash’ on windows or ‘terminal’ on ubuntu
  • cd into directory where file is located
  • type gpg -c filename replace ‘filename’ with your actual name with extenssion.
    it will ask for password
  • type the password twice to confirm

new file is being generated in the same directory with extenssion ‘.gpg’

  • share the file.

How to open a password protected file

  • open ‘git bash’ on Windows or terminal in ubuntu
  • cd into directory where file is located
  • type
    gpg filename.gpg (replace your filename with extenssion)
  • it will ask you for the password
  • type the password you set up in first phase or provided by file owner/sender.