<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Teoman</title>
    <description>The latest articles on DEV Community by Teoman (@teooman).</description>
    <link>https://dev.to/teooman</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1227244%2F660cc3b2-7547-4d82-a3ee-2209e0433c27.jpeg</url>
      <title>DEV Community: Teoman</title>
      <link>https://dev.to/teooman</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/teooman"/>
    <language>en</language>
    <item>
      <title>GnuPG and Digital Signatures</title>
      <dc:creator>Teoman</dc:creator>
      <pubDate>Mon, 19 Aug 2024 07:36:05 +0000</pubDate>
      <link>https://dev.to/teooman/gnupg-and-digital-signatures-5dh8</link>
      <guid>https://dev.to/teooman/gnupg-and-digital-signatures-5dh8</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Getting software off the internet is great, until you're not getting it from the actual distributor. Being able to securely transmit data and verify the entity you're receiving it from is a major issue that is solved by PKI (Public Key Infrastructure).&lt;/p&gt;

&lt;p&gt;GPG (GnuPG) is a utility that is based on OpenPGP (Pretty Good Privacy) which is an encryption standard for signing and encrypting data.&lt;/p&gt;

&lt;p&gt;So basically we're able to sign, encrypt, decrypt data with gpg. Unlike SSL/TLS, there are no "Authorities" that you put your trust in  by default, rather, a "web of trust". I might generate a key pair and stating it belongs to me, but you might not trust me. You may trust a friend of mine who signed my key, if not, you can always trust a friend of his and so on. &lt;a href="https://en.wikipedia.org/wiki/Key_signing_party" rel="noopener noreferrer"&gt;Key Signing Parties&lt;/a&gt; are events that people coming together in person with their legal documents stating their identity and then proceed to sign other people's keys and getting theirs signed.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gpg&lt;/code&gt; key pairs are used to identify a person. Private keys are kept in secret, public ones shared to anyone to be communicated with. A message signed by private key can only be encrypted by the corresponding public key, and vice versa. This is called asymmetric encryption, in contrast to symmetric encryption, where a single key is used to encrypt and decrypt data. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;gpg&lt;/code&gt; keys come with a bundle where the person has a primary and subordinate key pairs. To make the key management easy this bundle is just called a key pair.&lt;/p&gt;

&lt;p&gt;Generating a GPG key pair is fairly simple: &lt;/p&gt;

&lt;p&gt;&lt;code&gt;gpg --full-gen-key&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gpg (GnuPG) 2.4.4; Copyright (C) 2024 g10 Code GmbH
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Please select what kind of key you want:
   (1) RSA and RSA
   (2) DSA and Elgamal
   (3) DSA (sign only)
   (4) RSA (sign only)
   (9) ECC (sign and encrypt) *default*
  (10) ECC (sign only)
  (14) Existing key from card
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For most use cases, the default option which is Elliptic Curve Cryptography should suffice.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Please select which elliptic curve you want:
   (1) Curve 25519 *default*
   (4) NIST P-384
   (6) Brainpool P-256
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Proceeding with the default:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Please specify how long the key should be valid.
         0 = key does not expire
      &amp;lt;n&amp;gt;  = key expires in n days
      &amp;lt;n&amp;gt;w = key expires in n weeks
      &amp;lt;n&amp;gt;m = key expires in n months
      &amp;lt;n&amp;gt;y = key expires in n years
Key is valid for? (0) 3y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should choose a expiration date greater than zero, but you can always update this later as well for the key.&lt;/p&gt;

&lt;p&gt;Now, you have generated a gpg key pair for yourself! Which is visible with &lt;code&gt;gpg --list-keys&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Digital Signatures
&lt;/h2&gt;

&lt;p&gt;Now that we have key pair, we can start to sign any kind of message we'd like. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;echo "Some important message" &amp;gt; message.txt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now, at a later point in time, we'll want to make sure of this messages integrity. Thus, let's get the hash of the file as well:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sha256sum message.txt&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;31d1104978e7f73a0da6375f1b0d9add90bf96fbc5ef4dc9fb16804697ef2894  message.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The process of digitally signing messages includes hashing the content and then encrypting this hash with the private key. If one trusts my public key belongs to me, they will be able to verify that this message belongs to me and has not been tampered with. &lt;/p&gt;

&lt;h3&gt;
  
  
  Signing a message
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;gpg --sign message.txt&lt;/code&gt; will produce a &lt;code&gt;message.txt.gpg&lt;/code&gt;. The message is compressed then signed, this signature file is in binary format and includes the message signed.&lt;/p&gt;

&lt;p&gt;The signature can be verified with &lt;code&gt;gpg --verify message.txt.gpg&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Clearsign
&lt;/h3&gt;

&lt;p&gt;Another way of signing a message is clearsign:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gpg --clearsign message.txt&lt;/code&gt; &lt;br&gt;
which outputs the signature in ASCII armored plaintext format, thus the &lt;code&gt;.asc&lt;/code&gt; extension. This doesn't compress the message and is in human readable format.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

S1ome important message
-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQRBrsRfnEkrg1+zF5+Om9gJHQccpwUCZsL1FgAKCRCOm9gJHQcc
p1AXAQCgkI3FykZdG1S1+X5lejmjMRFCuEkKVniMKNXZIFZjLgD/S/WrpuLA2Q0t
D17oNhH13r5v5c9j0lpfMfhrEJS8awc=
=G5hr
-----END PGP SIGNATURE-----
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Detached signatures
&lt;/h3&gt;

&lt;p&gt;The previous 2 signatures include the actual message within the signature. There is this 3rd method where the signature does not include the messsage, meaning you would need the actual message content as well in order to verify the message. This is created with:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;gpg --detach-sign message.txt&lt;/code&gt; which outputs &lt;code&gt;message.txt.sig&lt;/code&gt;.&lt;br&gt;
Now, with &lt;code&gt;message.txt&lt;/code&gt; and &lt;code&gt;message.txt.sig&lt;/code&gt; at hand, the signature can be verified: &lt;code&gt;gpg --verify message.txt.sig message.txt&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gpg: Signature made Mon 19 Aug 2024 10:00:40 AM +03
gpg:                using EDDSA key 41AEC45F9C492B835FB3179F8E9BD8091D071CA7
gpg: Good signature from "Teoman Yuksel &amp;lt;root@teoman.sh&amp;gt;" [ultimate]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Try to change the content of &lt;code&gt;message.txt&lt;/code&gt; and then verify the signature.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gpg: Signature made Mon 19 Aug 2024 10:00:40 AM +03
gpg:                using EDDSA key 41AEC45F9C492B835FB3179F8E9BD8091D071CA7
gpg: BAD signature from "Teoman Yuksel &amp;lt;root@teoman.sh&amp;gt;" [ultimate]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;gpg&lt;/code&gt; will no longer verify the signature.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;gpg&lt;/code&gt; is a great tool utilizing PKI in the real world making possible secure communication that is still used by masses today.  &lt;/p&gt;

</description>
      <category>gpg</category>
      <category>pki</category>
      <category>cryptography</category>
      <category>security</category>
    </item>
    <item>
      <title>Earning the first bucks on Upwork</title>
      <dc:creator>Teoman</dc:creator>
      <pubDate>Thu, 02 May 2024 19:44:11 +0000</pubDate>
      <link>https://dev.to/teooman/earning-the-first-bucks-on-upwork-2a5f</link>
      <guid>https://dev.to/teooman/earning-the-first-bucks-on-upwork-2a5f</guid>
      <description>&lt;p&gt;Getting started with side gigs can be quite a hassle at first, but I think they just depend on few simple factors. I believe following through them should get you started rather quickly. My first advice is actually lays in the title: focusing on one major platform: Upwork. In the last several years, I've tried multiple platforms, and got the most interaction there. So, I will leave my focus for this article on Upwork only.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who am I
&lt;/h2&gt;

&lt;p&gt;I am a 22 years old who do DevOps &amp;amp; Linux administration work on the office and occasionally freelance as well. &lt;/p&gt;

&lt;p&gt;I'm sure there are lots of successful freelancer 16 year olds out there, but when I was 16, things didn't work out as wished them to be on Upwork. That made me focus on my skills rather than keep trying on the market, but I wish I stuck around longer while I was working on. &lt;/p&gt;

&lt;h2&gt;
  
  
  Having the right portfolio
&lt;/h2&gt;

&lt;p&gt;Being clear on the description is the key: what are your daily responsibilities, what have you worked on, tech stack, maybe some future goals and that should be it. This brief and precise description is more than enough. &lt;/p&gt;

&lt;h2&gt;
  
  
  Choosing the right jobs
&lt;/h2&gt;

&lt;p&gt;You should be selective of your jobs to apply for a lot of reasons: you don't want to pay for connects, you actually want to get hired for the project, better the gig better the pay, etc. My criteria is usually: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Less than 5 applicants&lt;/li&gt;
&lt;li&gt;Well-rated client&lt;/li&gt;
&lt;li&gt;Payment verified&lt;/li&gt;
&lt;li&gt;Precise description of the job&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The money mostly doesn't matter, you should focus on having satisfied clients. Even if you spend much time than you expected at first, making the client happy will have your profile rated better and they WILL want to work with you again, in the future.&lt;/p&gt;

&lt;h2&gt;
  
  
  Proposals
&lt;/h2&gt;

&lt;p&gt;Proposals maybe play the biggest role on getting the job or not. I have friends who are great in what they do but simply don't get much action just because they're not expressing themselves the right way.&lt;/p&gt;

&lt;p&gt;Read the job post thoroughly. Understand the objective clearly. I believe the ideal proposal looks something like this (what worked well for me so far):&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Hi!&lt;/p&gt;

&lt;p&gt;I have worked with X before, and manage Y at my full time job. I believe this should take 2-3 depending on your other environmental factors and my availability. We can have a meet and I can start immediately.&lt;/p&gt;

&lt;p&gt;Thanks! &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Having a blog &amp;amp; media presence
&lt;/h2&gt;

&lt;p&gt;Well, this is what I currently work on.  I think it'd People want to work with people who share their expertise in various media channels. So putting in the time to create blog posts that show technical skills won't hurt. This also being my first blog post!&lt;/p&gt;

</description>
      <category>career</category>
      <category>upwork</category>
      <category>freelance</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
