<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Oneth Kahandawa on Medium]]></title>
        <description><![CDATA[Stories by Oneth Kahandawa on Medium]]></description>
        <link>https://medium.com/@onethkahandawa?source=rss-b1fe83f9196b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*W-NcloV7PHqi9yxnonApbQ.jpeg</url>
            <title>Stories by Oneth Kahandawa on Medium</title>
            <link>https://medium.com/@onethkahandawa?source=rss-b1fe83f9196b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 16:29:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@onethkahandawa/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[That little padlock in your browser? Here’s the whole story behind it.]]></title>
            <link>https://medium.com/@onethkahandawa/that-little-padlock-in-your-browser-heres-the-whole-story-behind-it-a7f73cc52c8f?source=rss-b1fe83f9196b------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7f73cc52c8f</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[public-key]]></category>
            <category><![CDATA[tls]]></category>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[https]]></category>
            <dc:creator><![CDATA[Oneth Kahandawa]]></dc:creator>
            <pubDate>Tue, 31 Mar 2026 12:14:17 GMT</pubDate>
            <atom:updated>2026-03-31T12:14:17.270Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Certificates, certificate authorities, and the chain of trust explained from scratch.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_gcB-driQHQ7rT5YxfS5Ig.jpeg" /></figure><p>You know that little padlock in your browser? I never really understood what it meant, so I tracked down a senior engineer and made them explain it to me. Here’s what I learned, sharing it with y’all.</p><h3>First, what are we even protecting against?</h3><p>When your browser connects to a bank’s website, two things need to be true before any sensitive data can flow:</p><p><strong>You need to know you’re talking to the real bank, </strong>not an impostor sitting in the middle of the network. And <strong>the traffic needs to be encrypted</strong> so nobody on the wire can read it.</p><p>HTTPS solves both with a protocol called TLS (Transport Layer Security). Certificates are the foundation of how TLS proves identity.</p><h3>Step 1: Your key pair and the CSR</h3><p>It starts on your server. You generate a key pair, a public key and a private key. These are mathematically linked: anything encrypted with the public key can only be decrypted with the private key, and a signature made with the private key can be verified by anyone who has the public key.</p><p>Next, you create a <strong>Certificate Signing Request</strong> (CSR). Think of it as a form you fill out saying: “Here is my public key. Here is my domain name and organisation. Please certify that this key belongs to me.” The CSR is then sent to a <strong>Certificate Authority (CA), </strong>a trusted organisation like GoDaddy, DigiCert, or Let’s Encrypt — whose whole job is to verify your identity and vouch for your certificate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2oTij6khk7jrCPi1jM5OgQ.png" /></figure><p>One important clarification: the certificate is not your public key plus a separate signature sitting next to it. It is a standardised document (X.509 format) that <em>contains</em> your public key alongside your domain name, validity dates, and the CA’s digital signature over all of that. You hand the certificate to clients, the public key comes along for the ride, embedded inside it.</p><h3>Step 2: Why should the client trust the CA?</h3><p>So the CA signed your certificate using their private key. When a browser receives your certificate, it can verify that signature but only if it already trusts the CA. How does that trust get established?</p><p>Your operating system and browser come pre-installed with a list of trusted root certificates from well-known Certificate Authorities, organisations like DigiCert, Let’s Encrypt, Sectigo, and others. When a certificate arrives with a valid signature from one of these, the browser says: “I already trust the signer, so I trust this certificate.”</p><p><em>Root CA certificates are pre-installed in your OS and browser. This is the ultimate source of trust, there is nothing above it.</em></p><h3>Step 3: The chain of trust (and why the root CA stays offline)</h3><p>Here is where it gets interesting. In practice, the root CA almost never signs your certificate directly. Instead, there are one or two <strong>intermediate CAs</strong> in between.</p><p>Why? Because the root CA’s private key is extraordinarily valuable. If it ever leaked, every certificate in the entire chain would be untrustworthy. So root CAs keep their private keys in hardware security modules, often kept physically offline, and sign as infrequently as possible.</p><p>Instead, the root CA signs an intermediate CA’s certificate, authorising it to issue certificates on the root’s behalf. The intermediate CA is online and does the day-to-day signing work. If the intermediate CA is compromised, the root CA can revoke it, limiting the blast radius to only those certificates that intermediate issued, not the entire internet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b_nGptgUA56edEoOOJmJGw.png" /></figure><p>This chain, your certificate, the intermediate CA certificate, and the root CA is called the <strong>certificate chain</strong>. Your server sends its cert and the intermediate cert together when a client connects. The root cert doesn’t need to be sent because the client already has it.</p><h3>Step 4: The TLS handshake</h3><p>Now we can put it all together. When a client (your browser) connects to a server over HTTPS, there is a brief negotiation before any data flows. This is the <strong>TLS handshake</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AsGAoCXfmXcz8XzMJTbJQA.png" /></figure><p>When the server sends its certificate, the public key is embedded inside it, the client extracts it after verification. Both sides then use it to participate in a key exchange, independently arriving at the same <strong>session key, </strong>a symmetric key that is never transmitted over the wire. From that point, all traffic is encrypted symmetrically, which is dramatically faster than asymmetric encryption.</p><h3>Putting it all together</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KQfHAju1DW2C5i0M8OWeDw.png" /></figure><p>HTTPS is one of those systems that looks like magic until you understand the parts. A certificate is just a signed document. The chain of trust is just a hierarchy of signers. The handshake is just a careful negotiation of who is who and what key to use. Once each piece clicks, the whole picture becomes surprisingly clean.</p><p>If you want to dig deeper, the best next steps are: look at a real certificate in your browser (click the padlock → Certificate), read RFC 5246 for TLS 1.2 or RFC 8446 for TLS 1.3, and try generating a self-signed cert with openssl to see the full CSR flow in practice.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7f73cc52c8f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Invisible NUL Character That dos2unix Fixed in Seconds]]></title>
            <link>https://medium.com/@onethkahandawa/the-invisible-nul-character-that-dos2unix-fixed-in-seconds-5b0b0e6e843f?source=rss-b1fe83f9196b------2</link>
            <guid isPermaLink="false">https://medium.com/p/5b0b0e6e843f</guid>
            <category><![CDATA[shell]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[dos2unix]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Oneth Kahandawa]]></dc:creator>
            <pubDate>Fri, 27 Mar 2026 16:24:21 GMT</pubDate>
            <atom:updated>2026-03-27T16:24:21.180Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZwuYhylXUIoVM8aKzj6AGQ.png" /></figure><p>🔍<strong>The Scenario</strong></p><p>I had a plain text file with three passwords stored on separate lines, which I was loading into a CI/CD pipeline. The file looked completely fine in my editor, but when the pipeline read the values, each password had a NUL character appended to it:</p><pre>DB_PASSWORD=superSecretDbPass123NUL<br>API_SECRET=myApiSecretValue456NUL<br>SERVICE_TOKEN=myServiceToken789NUL</pre><p>The passwords themselves were correct, but the hidden NUL at the end of each line caused authentication to fail every time. The file had been created on Windows, which uses \r\n (carriage return + newline) at the end of each line. Linux only expects\n, so the leftover \r was showing up as a NUL byte in the pipeline. That&#39;s when I came across <strong>dos2unix, </strong>a simple utility that fixed it instantly.</p><p>🛠️<strong>What is dos2unix?</strong></p><p>dos2unix is a small command-line utility that converts text files from Windows format to Unix format. Windows ends each line with\r\n, while Unix systems only use \n. When a Windows-created file is used on Linux, that extra \r can cause unexpected behaviour showing up as garbage characters, broken values, or, in this case, NUL bytes. dos2unix simply strips out all those carriage returns, leaving a clean Unix-compatible file.</p><p><strong>💡The fix</strong></p><p>Running a single dos2unix command on the env file stripped out all the hidden \r characters instantly:</p><pre>dos2unix passwords.env</pre><p>Once the command ran, the NUL characters were gone. The output then looked like:</p><pre>DB_PASSWORD=superSecretDbPass123<br>API_SECRET=myApiSecretValue456<br>SERVICE_TOKEN=myServiceToken789</pre><p>If dos2unix isn’t installed: sudo apt install dos2unix on Ubuntu/Debian, or brew install dos2unix on macOS. A simple one-liner, but it saved a lot of head-scratching.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5b0b0e6e843f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>