incomplete tutorial

This commit is contained in:
cynthia 2025-06-07 17:44:07 +01:00
parent b61c448d96
commit 145ebfa2a4
3 changed files with 37 additions and 5 deletions

BIN
pgp/0a.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View file

@ -4,11 +4,13 @@ date: 2022-12-05
gitea_url: "http://git.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion/nihilist/blog-contributions/issues/85"
xmr: 8AUYjhQeG3D5aodJDtqG499N5jXXM71gYKD8LgSsFB9BUV1o7muLv3DXHoydRTK4SZaaUBq4EAUqpZHLrX2VZLH71Jrd9k8
---
# How to use PGP encryption
# How to encrypt files and messages (Age and PGP)
![](0.png)
In this tutorial we're going to look at how to setup PGP keys, and use them to encrypt messages
![](0a.png)
In this tutorial we're going to look at how to setup Age and PGP keys, and use them to encrypt messages
![](../context/private_remote.png)
@ -22,11 +24,41 @@ Bob wants to send a sensitive message to Alice. Bob intends to send his sensitiv
![](1.png)
Bob then decides that noone other than Alice will be able to decrypt his message. So, Bob decides to use PGP encryption, to be able to send a sensitive message to Alice **on any platform** he wishes, because he knows that only Alice will be able to decrypt it:
Bob then decides that noone other than Alice will be able to decrypt his message. So, Bob decides to use encryption, to be able to send a sensitive message to Alice **on any platform** he wishes, because he knows that only Alice will be able to decrypt it:
![](2.png)
Why should you even care about PGP ? Simple, you only want one person to be able to read your message, so you use PGP. You can use it when you do not trust the chat platform you are using, or the email provider, or any other form of communication with text. PGP gives you a simple way of encrypting your messages with others' public key, so that way you're sure that noone can read your messages.
Why should you even care about encryption? Simple, you only want one person to be able to read your message, so you use PGP or Age. You can use it when you do not trust the chat platform you are using, or the email provider, or any other form of communication with text. Age and PGP give you a simple way of encrypting your messages with others' public key, so that way you're sure that noone can read your messages.
You may be thinking: what's the difference between PGP and Age? PGP is a traditional way of encrypting files and messages, while Age is meant to be a more modern alternative to PGP. Age has really tiny keys (compared to PGP key sizes), uses modern cryptographic algorithms by default, while being more secure and simpler to use than PGP.
### Age
Let's begin by installing age first.
```bash
root@localhost:~# apt install age
```
Generate your key and output the private key into a text file. We will be outputting the private and public key to a file named `key.txt`
```bash
user@localhost:~$ age-keygen -o key.txt
Public key: age1gme6y93jm9nx7thzfu7ma8q7t0qhxae6m4r37m23f83d3phheejs25m8h0
```
Now we can give people the public key that age gave us. It can be put publicly on your website, so that users will be able to encrypt their messages before sending it to you.
The keys are so tiny, that if we want, we can encode the public key into a little QR code for people to scan
```bash
user@localhost:~$ sudo apt install qrencode
user@localhost:~$ qrencode -o pubkey_qr.png age1gme6y93jm9nx7thzfu7ma8q7t0qhxae6m4r37m23f83d3phheejs25m8h0
```
![](qr.png)
### PGP
Let's begin by generating your first key:
@ -38,7 +70,7 @@ Let's begin by generating your first key:
There is NO WARRANTY, to the extent permitted by law.
Note: Use "gpg --full-generate-key" for a full featured key generation dialog.
GnuPG needs to construct a user ID to identify your key.
Real name: nihilist

BIN
pgp/qr.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B