<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.johnlradford.io/index.php?action=history&amp;feed=atom&amp;title=GPG_Encryption</id>
	<title>GPG Encryption - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.johnlradford.io/index.php?action=history&amp;feed=atom&amp;title=GPG_Encryption"/>
	<link rel="alternate" type="text/html" href="https://wiki.johnlradford.io/index.php?title=GPG_Encryption&amp;action=history"/>
	<updated>2026-05-05T14:46:27Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://wiki.johnlradford.io/index.php?title=GPG_Encryption&amp;diff=66&amp;oldid=prev</id>
		<title>Admin at 16:56, 23 September 2024</title>
		<link rel="alternate" type="text/html" href="https://wiki.johnlradford.io/index.php?title=GPG_Encryption&amp;diff=66&amp;oldid=prev"/>
		<updated>2024-09-23T16:56:22Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:56, 23 September 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l70&quot;&gt;Line 70:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 70:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  gpg --send-keys 156DF784C8EACD80    # OpenPGP&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  gpg --send-keys 156DF784C8EACD80    # OpenPGP&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  gpg --keyserver &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pgp&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mit&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;edu &lt;/del&gt;--send-keys 156DF784C8EACD80    # &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Mit&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  gpg --keyserver &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;keys&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;openpgp&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;org &lt;/ins&gt;--send-keys 156DF784C8EACD80    # &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;OpenGPG&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  gpg --keyserver keyserver.ubuntu.com --send-keys 156DF784C8EACD80    # Ubuntu&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  gpg --keyserver keyserver.ubuntu.com --send-keys 156DF784C8EACD80    # Ubuntu&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Search a keystore for a persons key.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Search a keystore for a persons key.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  gpg --keyserver &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pgp&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mit&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;edu &lt;/del&gt;--search-keys email@example.com&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  gpg --keyserver &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;keys&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;openpgp&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;org &lt;/ins&gt;--search-keys email@example.com&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Signing &amp;amp;amp; Encrypting ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Signing &amp;amp;amp; Encrypting ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
	<entry>
		<id>https://wiki.johnlradford.io/index.php?title=GPG_Encryption&amp;diff=14&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;= GPG - GNU Privacy Guard =  == Overview ==  GPG is an alternative implementation of the OpenPGP standard. GPG/PGP uses asymmetric encryption to generate a public / private key pair. With asymmetric encryption, any data encrypted by the public key can only be decrypted by the private key and vice versa.  The intention is to make your public key known and freely available while keeping your private k...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.johnlradford.io/index.php?title=GPG_Encryption&amp;diff=14&amp;oldid=prev"/>
		<updated>2023-10-04T11:13:21Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;= GPG - GNU Privacy Guard =  == Overview ==  GPG is an alternative implementation of the OpenPGP standard. GPG/PGP uses &lt;a href=&quot;/index.php?title=Encoding_vs_Encryption_vs_Hashing#Symmetric_vs_Asymmetric_Encryption&quot; title=&quot;Encoding vs Encryption vs Hashing&quot;&gt;asymmetric encryption&lt;/a&gt; to generate a public / private key pair. With asymmetric encryption, any data encrypted by the public key can only be decrypted by the private key and vice versa.  The intention is to make your public key known and freely available while keeping your private k...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= GPG - GNU Privacy Guard =&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
GPG is an alternative implementation of the OpenPGP standard. GPG/PGP uses [[Encoding_vs_Encryption_vs_Hashing#Symmetric_vs_Asymmetric_Encryption|asymmetric encryption]] to generate a public / private key pair. With asymmetric encryption, any data encrypted by the public key can only be decrypted by the private key and vice versa.&lt;br /&gt;
&lt;br /&gt;
The intention is to make your public key known and freely available while keeping your private key secret. Other’s can then use your public key to encrypt some data and send it to you, knowing that only you can decrypt it with your private key.&lt;br /&gt;
&lt;br /&gt;
== Common Commands ==&lt;br /&gt;
&lt;br /&gt;
Note: We&amp;#039;ll be using email@example.com as a stand in for a key&amp;#039;s identifier. The GPG tool will let you use a few different things in place of email@example.com to work as a key&amp;#039;s identifier.&lt;br /&gt;
&lt;br /&gt;
To create a new key pair run the command below and follow the dialogue options.&lt;br /&gt;
&lt;br /&gt;
 gpg --full-generate-key&lt;br /&gt;
&lt;br /&gt;
After generating your keys you can list them with the command below.&lt;br /&gt;
&lt;br /&gt;
 gpg --list-keys&lt;br /&gt;
&lt;br /&gt;
You can list the secret keys you have with the command below.&lt;br /&gt;
&lt;br /&gt;
 gpg --list-secret-keys&lt;br /&gt;
&lt;br /&gt;
Immediately after creating a new keypair you’ll want to sign your own key.&lt;br /&gt;
&lt;br /&gt;
 gpg --sign-key email@example.com&lt;br /&gt;
&lt;br /&gt;
From there you’re ready to export your public key and give it to others.&lt;br /&gt;
&lt;br /&gt;
 gpg --output ~/gpg_key.pub --armor --export email@example.com&lt;br /&gt;
&lt;br /&gt;
Once your friend has your public gpg key they can import it using the command below.&lt;br /&gt;
&lt;br /&gt;
 gpg --import ~/gpg_key.pub&lt;br /&gt;
&lt;br /&gt;
Then to encrypt something with your public key your friend can run the below with your public key.&lt;br /&gt;
&lt;br /&gt;
 gpg --encrypt --sign --armor -r email@example.com file.txt&lt;br /&gt;
&lt;br /&gt;
That will generate a file.txt.gpg which is the encrypted copy of the message.&lt;br /&gt;
&lt;br /&gt;
Once your friend sends you the encrypted file.txt.gpg back you can verify its authenticity by running the commmand below.&lt;br /&gt;
&lt;br /&gt;
 gpg --always-trust --verify file.txt.gpg&lt;br /&gt;
&lt;br /&gt;
Finally you can decrypt it with the below command.&lt;br /&gt;
&lt;br /&gt;
 gpg --decrypt file.txt.gpg&lt;br /&gt;
&lt;br /&gt;
Here are some additional commands.&lt;br /&gt;
&lt;br /&gt;
To delete someone else&amp;#039;s public key from your keychain.&lt;br /&gt;
&lt;br /&gt;
 gpg --delete-key email@example.com&lt;br /&gt;
&lt;br /&gt;
To delete your own secret key.&lt;br /&gt;
&lt;br /&gt;
 gpg --delete-secret-key email@example.com &amp;amp;&amp;amp; gpg --delete-key email@example.com&lt;br /&gt;
&lt;br /&gt;
To see how much GPG clout a particular key has check the number of signatures.&lt;br /&gt;
&lt;br /&gt;
 gpg --list-sig email@example.com&lt;br /&gt;
&lt;br /&gt;
To list the longform keyid format ([https://phar.io/howto/uploading-public-keys.html#:~:text=Alternate%20way%20to%20submit%20your%20public%20key%20to%20the%20key%20servers%20using%20the%20CLI needed to get sub fingerprint for later upload]).&lt;br /&gt;
&lt;br /&gt;
 gpg --keyid-format LONG --list-keys email@example.com&lt;br /&gt;
&lt;br /&gt;
To send a key to the three major key stores out there.&lt;br /&gt;
&lt;br /&gt;
 gpg --send-keys 156DF784C8EACD80    # OpenPGP&lt;br /&gt;
 gpg --keyserver pgp.mit.edu --send-keys 156DF784C8EACD80    # Mit&lt;br /&gt;
 gpg --keyserver keyserver.ubuntu.com --send-keys 156DF784C8EACD80    # Ubuntu&lt;br /&gt;
&lt;br /&gt;
Search a keystore for a persons key.&lt;br /&gt;
&lt;br /&gt;
 gpg --keyserver pgp.mit.edu --search-keys email@example.com&lt;br /&gt;
&lt;br /&gt;
== Signing &amp;amp;amp; Encrypting ==&lt;br /&gt;
&lt;br /&gt;
GPG offers the ability to sign data and to encrypt data. Message signing ensures data integrity (aka the message has not been changed) and message authenticity (aka the message came from where it says it came from). Where as encryption ensure confidentiality (aka that the data cannot be read in transit).&lt;br /&gt;
&lt;br /&gt;
In reality, signing is just encrypting a message using the private key. Then it can only be decrypted by the corresponding public key. Anyone can with the public key can decrypt and read a signed message. They know since they used the public key to decrypt it that it must have been encrypted (aka signed) with the private key and therefore must have come from the private key holder.&lt;br /&gt;
&lt;br /&gt;
Signing and encryption are not mutually exclusive. With GPG its possible for data to be, encrypted and signed; encrypted and not signed; and signed but not encrypted.&lt;br /&gt;
&lt;br /&gt;
The most secure method is to first encrypt a message with the recipient’s public key and then sign the message using your private key before sending it. That way on the receiving side anyone can verify that the message came from you because it can only be decrypted with your public key. Likewise, they can know that the message has not been altered in transit because again the signed file could only have been created by your private key.&lt;br /&gt;
&lt;br /&gt;
The signature on a message becomes invalid if the message is altered, even if the message is sent in plain text. If someone changed the message the signature file would also need changed and the only person who can change the signature file is the private key holder.&lt;br /&gt;
&lt;br /&gt;
Finally once the recipient receives the message and verifies its authenticity they can then decrypt it using their private key.&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
&lt;br /&gt;
https://gist.github.com/F21/b0e8c62c49dfab267ff1d0c6af39ab84&lt;br /&gt;
&lt;br /&gt;
https://www.digitalocean.com/community/tutorials/how-to-use-gpg-to-encrypt-and-sign-messages&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>