{"id":989,"date":"2019-12-02T17:36:48","date_gmt":"2019-12-02T04:36:48","guid":{"rendered":"https:\/\/www.ronella.xyz\/?p=989"},"modified":"2024-12-08T17:38:12","modified_gmt":"2024-12-08T04:38:12","slug":"generating-pgp-keys-with-gpg4win","status":"publish","type":"post","link":"https:\/\/www.ronella.xyz\/?p=989","title":{"rendered":"Generating PGP Keys with Gpg4win"},"content":{"rendered":"<h1>Pre-requisite<\/h1>\n<ul>\n<li><strong>Gpg4win<\/strong> <em>(i.e from <a href=\"https:\/\/www.gpg4win.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/www.gpg4win.org\/<\/a>)<\/em>.<\/li>\n<\/ul>\n<h1>Generating Keys<\/h1>\n<ol>\n<li style=\"list-style-type: none;\">\n<ol>\n<li>Run the following command:\n<pre style=\"white-space: pre;\">gpg --full-gen-key<\/pre>\n<\/li>\n<li><strong>Type 1 and press enter<\/strong>\u00a0for the following question:\n<pre style=\"white-space: pre;\">Please select what kind of key you want:\n   (1) RSA and RSA (default)\n   (2) DSA and Elgamal\n   (3) DSA (sign only)\n   (4) RSA (sign only)\nYour selection?<\/pre>\n<\/li>\n<li><strong>Press enter<\/strong> for the following question:\n<pre style=\"white-space: pre;\">RSA keys may be between 1024 and 4096 bits long.\nWhat keysize do you want? (2048)<\/pre>\n<\/li>\n<li><strong>Press enter<\/strong>\u00a0for the following question:\n<pre style=\"white-space: pre;\">Please specify how long the key should be valid.\n         0 = key does not expire\n      &lt;n&gt;  = key expires in n days\n      &lt;n&gt;w = key expires in n weeks\n      &lt;n&gt;m = key expires in n months\n      &lt;n&gt;y = key expires in n years\nKey is valid for? (0)<\/pre>\n<\/li>\n<li><strong>Type y and press enter<\/strong> for the following question:\n<pre style=\"white-space: pre;\">Key does not expire at all\nIs this correct? (y\/N)<\/pre>\n<\/li>\n<li>Fill in the <strong>Real name<\/strong> appropriately and <strong>press enter<\/strong>.<\/li>\n<li>Fill in the <strong>Email address<\/strong> appropriately and <strong>press enter<\/strong>.<\/li>\n<li>The <strong>Comment<\/strong> is optional but don't forget to <strong>press enter<\/strong>.<\/li>\n<li><strong>Type o and press enter<\/strong> for the following question:\n<pre style=\"white-space: pre;\">Change (N)ame, (C)omment, (E)mail or (O)kay\/(Q)uit?<\/pre>\n<\/li>\n<li>Fill-in the <strong>passphrase appropriately<\/strong>.<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<div style=\"padding-left: 40px;\">\n<p>The output will be ending with something like the following:<\/p>\n<pre style=\"white-space: pre;\">pub   rsa2048 2019-11-27 [SC]\n      8C99E30527B112D1CB6D646FE86A4FE7189AADC9\nuid                      Real Name &lt;real_email@email.com&gt;\nsub   rsa2048 2019-11-27 [E]<\/pre>\n<p>The second line is the <strong>PGP key ID<\/strong>. Thus from the output above. The key id is:<\/p>\n<pre style=\"white-space: pre;\">8C99E30527B112D1CB6D646FE86A4FE7189AADC9<\/pre>\n<\/div>\n<h1>Exporting Your Private Key<\/h1>\n<p>The <strong>my-secret-key.pgp<\/strong> file generated by this command can be use for signing your binaries.<\/p>\n<p>Run the following command:<\/p>\n<pre style=\"white-space: pre;\">gpg --export-secret-keys &lt;KEY_ID&gt; &gt; my-secret-key.pgp<\/pre>\n<blockquote><p><strong>DO NOT SHARE THIS FILE OR COMMIT TO YOUR REPOSITORY<\/strong>.<\/p><\/blockquote>\n<h1>Publishing Your Public Key<\/h1>\n<p>Run the following command:<\/p>\n<pre style=\"white-space: pre;\">gpg --keyserver hkp:\/\/keys.openpgp.org --send-keys &lt;KEY_ID&gt;<\/pre>\n<h3>Validating your Published Public Key<\/h3>\n<ol>\n<li>You can validate the upload public key by placing your &lt;KEY_ID&gt; as a <strong>Search String <\/strong>from the following address: <a href=\"https:\/\/keys.openpgp.org\" target=\"_blank\" rel=\"noopener\">https:\/\/keys.openpgp.org<\/a>.<br \/>\n<blockquote><p>This will only work if you submit your keys using the preceding section.<\/p><\/blockquote>\n<\/li>\n<li>Click the <strong>Search<\/strong> button.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>Pre-requisite Gpg4win (i.e from https:\/\/www.gpg4win.org\/). Generating Keys Run the following command: gpg &#8211;full-gen-key Type 1 and press enter\u00a0for the following question: Please select what kind of key you want: (1) RSA and RSA (default) (2) DSA and Elgamal (3) DSA (sign only) (4) RSA (sign only) Your selection? Press enter for the following question: RSA [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[23,28,10],"tags":[],"_links":{"self":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/989"}],"collection":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=989"}],"version-history":[{"count":13,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/989\/revisions"}],"predecessor-version":[{"id":1920,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=\/wp\/v2\/posts\/989\/revisions\/1920"}],"wp:attachment":[{"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=989"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=989"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ronella.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=989"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}