Encryption using gpg. [guides]

You have a secret message or file, that you would like to share with a friend, family member or someone else. Something that contains something personal. Either way, you want to be certain that only the recipient is able to acces message.

Requirements

Generate key pair

Key pair is of course two keys there's gonna be a private one and public one. Public key is the one you can show to other pepople. The private one is the one that unlocks everything you lock with that.

				gpg --full-gen-key
			

In the text menu select "RSA and RSA" option. Next it's gonna ask you how many bits are going to be in your key. It's always better to have more bits so 4029 would be extra safe. After that it's gonna ask to choose when your expires. Next you must to put name (you can put fake name) and you also must to give an email, this email is not going to send you email, this email is for identification purposes.

Import someone public key from file

				gpg --import file
			

Export your public key to file

				gpg -a --export key-name > file-name
			

Encrypt file

				gpg -r someone-key-name-or-email -e file
			

Now there's gpg file, this is encrypted version of your's orginal file.

Decrypt file

				gpg -d file.gpg