mirror of
https://github.com/foo-dogsquared/wiki.git
synced 2025-02-12 09:19:04 +00:00
![Gabriel Arazas](/assets/img/avatar_default.png)
Apparently, the convention (at least starting from 2018) is to make the keywords and block names to be in lowercase as stated from one of the following discussions at https://orgmode.org/list/87tuuw3n15.fsf@nicolasgoaziou.fr/. The files was updated with a one liner of shell. However, this is Emacs and org-mode does have an API to let you do stuff in your config and interact with the documents internally so it is not an elegant solution in any way.
48 lines
1.5 KiB
Org Mode
48 lines
1.5 KiB
Org Mode
#+title: File encryption with GPG
|
|
#+author: "Gabriel Arazas"
|
|
#+email: "foo.dogsquared@gmail.com"
|
|
#+date: "2020-06-12 19:20:15 +08:00"
|
|
#+date_modified: "2020-09-09 05:10:41 +08:00"
|
|
#+language: en
|
|
#+options: toc:t
|
|
#+property: header-args :exports both
|
|
#+roam_tags: tools security
|
|
|
|
|
|
GPG is mostly used for public-key cryptography, allowing you to publicly communicate with the recipient.
|
|
Using GPG boils to generating a key-pair, managing them, and signing and receiving encrypted messages from others and/or to yourself for security purposes.
|
|
|
|
|
|
|
|
|
|
* Basic usage
|
|
|
|
A GPG key-pair is made up of two things: the public key and the private key.
|
|
The public key can be shared... to the public while the private key should be guarded in secret.
|
|
|
|
#+begin_src shell :results silent
|
|
# List out the available keys.
|
|
gpg --list-keys
|
|
|
|
# Generate a new key-pair.
|
|
gpg --full-gen-key
|
|
#+end_src
|
|
|
|
|
|
|
|
|
|
* Encrypting and decrypting files
|
|
|
|
Encrypting and decrypting files are one of the main points of GPG.
|
|
|
|
#+begin_src shell :results silent
|
|
# This will encrypt a file and generate an obscured version of it at <FILE>.gpg.
|
|
gpg --recipient <EMAIL> --encrypt <FILE>
|
|
|
|
# Decrypting is almost the same process.
|
|
gpg --recipient <EMAIL> --output <FILE> --decrypt <FILE>.gpg
|
|
#+end_src
|
|
|
|
You can make more secured versions of encrypted file especially when you intended it to send it to a particular recipient.
|
|
For example, you can encrypt your file with your private key and the public key of your recipient and only both of you know how to receive the file.
|