<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2026-11-01T23:28:37+00:00</updated><id>/feed.xml</id><title type="html">Filip’s Blog</title><author><name>filiptronicek</name></author><entry><title type="html">Saying no to free unlimited cloud storage</title><link href="/nas/" rel="alternate" type="text/html" title="Saying no to free unlimited cloud storage" /><published>2026-05-30T00:00:00+00:00</published><updated>2026-05-30T00:00:00+00:00</updated><id>/nas</id><content type="html" xml:base="/nas/"><![CDATA[<div class="flash mb-3">TL;DR: I built a NAS to back up terabytes of data from my Google Drive, and had a bunch of fun doing it.</div>

<div class="flash flash-warn mb-3">Note: this post was typo-checked by Claude 4.8. Opus. I wrote, though!</div>

<h2 id="preamble">Preamble</h2>

<p>Ever since 2014, schools using Google Workspace for education <a href="https://workspaceupdates.googleblog.com/2014/09/announcing-drive-for-education.html">got free unlimited storage</a> for all their users. In 2018, whilst studying high school, I stumbled upon this fact on the Google Drive page and was awestruck: instead of the usage page citing the regular “2 GB used out of 15 GB”, it simply said “2 GB used”.</p>

<p>This kickstarted an era in my life where I took unlimited storage that I could always access and share with anyone for granted. It was about that time that I was asked to start making videos of the different happenings at my high school, where I’d usually grab the family Sony α5100 and record for hours on end. The unlimited storage deal for Google Drive felt like a match-made-in-heaven at the time for the multi-gigabyte videos<sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">1</a></sup>, and later inspired me to start using tools like <a href="https://rclone.org/"><code class="language-plaintext highlighter-rouge">rclone</code></a> to make mass uploads and backups to this unlimited storage medium robust.</p>

<p>During the COVID-19 pandemic, there wasn’t much opportunity to shoot videos of in-person events, but my Google Drive catalogue kept on growing: I joined the mind virus that is the <a href="https://www.reddit.com/r/DataHoarder/">r/DataHoarder</a> community, and started archiving everything I deemed at least a tiny bit relevant (or just simply cool).</p>

<p>Then, in February of 2021, following the <a href="https://blog.google/products-and-platforms/products/photos/storage-changes/">November 2020 announcement</a> that Google Photos would no longer offer free unlimited storage for everyone when using their “high quality” compression<sup id="fnref:2"><a href="#fn:2" class="footnote" rel="footnote" role="doc-noteref">2</a></sup>, Google once again reminded us that there is <a href="https://en.wikipedia.org/wiki/No_such_thing_as_a_free_lunch">no such thing as a free lunch</a> by declaring a hard limit of 100 TB for the entire school as a new storage quota<sup id="fnref:3"><a href="#fn:3" class="footnote" rel="footnote" role="doc-noteref">3</a></sup>. Given the size of our institution, this was not a big deal at all, but a certified capitalism moment nonetheless.</p>

<p>Though the global limits didn’t pose any big issues to me or my school, another thought started lurking in my mind: I’ll <a href="/high-school-graduation/">be graduating</a> in not so long, and probably should have a backup of all of this.</p>

<h2 id="project-dedrivifi">Project DeDriviFi</h2>

<p>When finally I started having these semi-smart ideas about backups and data management, it was December of 2023. That gave me about 10 months to get the whole ordeal done. As the first solution for my then-current problem of not having a single backup of all of the Google Drive data, I started looking into <a href="https://www.backblaze.com/cloud-backup/personal">Backblaze Personal Computer backups</a>, which promised unlimited storage for about $7.80 when billed bi-annually. The catch? The data you’re backing up is only mirrored, so all your files need to be physically present on your source (drives) and you can’t just clean them up after you’re done. Because of this, you also can’t back up larger amounts of data than the sum of your disks.</p>

<p>Also, there is no API access and their clients are only available for macOS and Windows, making server backups infeasible<sup id="fnref:4"><a href="#fn:4" class="footnote" rel="footnote" role="doc-noteref">4</a></sup>.</p>

<h2 id="the-cost-argument">The cost argument</h2>

<p>Even with that catch, Backblaze seemed like the obvious choice in the beginning. It allowed me to scale the amount of data without paying the heavy pricing fees of Cloud storage providers.</p>

<p>For my backup, I’m sure Google would love to force me into paying $160/month for their 30 TB plan. Microsoft would not even let me do it under one personal account and S3 would unsurprisingly charge me crazy sums of money, billed every month<sup id="fnref:5"><a href="#fn:5" class="footnote" rel="footnote" role="doc-noteref">5</a></sup><sup id="fnref:6"><a href="#fn:6" class="footnote" rel="footnote" role="doc-noteref">6</a></sup>.</p>

<p>The result of all that deep thinking? A 20 TB Seagate HDD for about $450, a year’s worth of Backblaze for $120 and my old MacBook for running the backup. This, at least, was the temporary solution that would help me get things out of Google Drive onto another service.</p>

<h2 id="the-big-download">The big download</h2>

<p>When the whole setup was complete, I was able to actually start downloading the files – after some server-side cleanup, the total amount I needed to fetch ended up hovering just shy of 6 TB. Because of my aforementioned experience with <code class="language-plaintext highlighter-rouge">rclone</code> (which admittedly ended up being a bit of a golden hammer for me), I chose it to handle the approximately 125K files to download. I ran the first command on March 27th, 2024.</p>

<p>This process ended up taking  much longer than I thought: first, things started going smoothly, transferring about 1.5 TB in just the first 24 hours. There were some errors, but I was hopeful that re-trying the same <code class="language-plaintext highlighter-rouge">rclone</code> command would resolve those. This is where things started to become slow. It took another 3 days to download another 1,200 GB, which turned out to have been caused by my dataset of tens of thousands of pictures of food I used a couple years prior to teach a neural network – downloading that many files is just bound to make the whole transfer unbearably slow.</p>

<p>After overcoming that bottleneck (by waiting for it to finish), another issue came up: larger files kept failing to download, which I assumed was because of them not being able to be downloaded effectively in parallel with everything else. This meant that I split the download into two passes, in which I deferred files larger than 5 GB for later. After firing off the first batch again, I went to sleep. Then, the next day, on June 1st, right after I moved my backup setup into another room, I got a friendly macOS notification:</p>

<p><a href="/img/nas/drive-failure-notification.png"><picture><source srcset="/generated/img/nas/drive-failure-notification-600-6921e1fc5.webp 600w, /generated/img/nas/drive-failure-notification-744-6921e1fc5.webp 744w" type="image/webp"><source srcset="/generated/img/nas/drive-failure-notification-600-6921e1fc5.png 600w, /generated/img/nas/drive-failure-notification-744-6921e1fc5.png 744w" type="image/png"><img src="/generated/img/nas/drive-failure-notification-744-6921e1fc5.png" alt="macOS notification: macOS can't repair the disk You can still open or copy files on the disk, but you can't save changes to files on the disk. Back up the disk and reformat it as soon as you can." width="744" height="748"></picture></a></p>

<p>I thought to myself that this was a matter of <a href="https://youtu.be/nn2FB1P_Mn8">unplugging it and plugging it back in again</a> a couple of times, but it was not. No worries, I thought to myself, I’ll just copy the backup as-is to another drive and go return the new one. So I did, and a couple days later, I got a message saying I’ll be getting a replacement.</p>

<p>When I picked up my replacement unit, I was kind of worried this would happen again. That fear ended up being the wrong fear to have. Just after unpacking the drive, I saw a couple of dents in it. I figured that is no good for a brand new hard drive to have, so I returned it again. Bad luck, I guess.
<a href="/img/nas/dented-replacement-drive.jpg"><picture><source srcset="/generated/img/nas/dented-replacement-drive-600-0083bd741.webp 600w, /generated/img/nas/dented-replacement-drive-800-0083bd741.webp 800w, /generated/img/nas/dented-replacement-drive-1200-0083bd741.webp 1200w, /generated/img/nas/dented-replacement-drive-1800-0083bd741.webp 1800w" type="image/webp"><source srcset="/generated/img/nas/dented-replacement-drive-600-0083bd741.jpg 600w, /generated/img/nas/dented-replacement-drive-800-0083bd741.jpg 800w, /generated/img/nas/dented-replacement-drive-1200-0083bd741.jpg 1200w, /generated/img/nas/dented-replacement-drive-1800-0083bd741.jpg 1800w" type="image/jpeg"><img src="/generated/img/nas/dented-replacement-drive-800-0083bd741.jpg" alt="My brand new replacement hard drive, dented" width="4032" height="3024"></picture></a>
Another few days passed, and I got a package with my 3rd brand new Seagate Exos X20 20 TB. And because jokes are funnier when you repeat them over and over, that one had manufacturing defects as well.</p>

<p>This was not very motivating, and halted my progress quite a bit: nothing happened for about 2 months and so suddenly, we find ourselves in August of 2024. I searched around for second-hand hard drives and ended up finding a 16 TB Western Digital drive for about $146. I pulled the already-done backup from my secondary drive to the new one, and started <code class="language-plaintext highlighter-rouge">rclone</code> again.</p>

<p>Since I was doing this on my M1 MacBook Pro, <code class="language-plaintext highlighter-rouge">caffeinate</code> was very helpful when running these transfers for days on end: phase 1 of the download (the one for all files under 5 GB) took about 46 hours. I then bumped the <code class="language-plaintext highlighter-rouge">--max-size</code> to 20 GB and ran it again. This ended up bringing us from 4.1 TB to about 4.5 (note that this required many retries, as something always went wrong with the Google Drive download on every session).</p>

<h2 id="giving-up-on-open-source-software">Giving up on open-source software</h2>

<p>Given the issues with the third-party integration of Google Drive into <code class="language-plaintext highlighter-rouge">rclone</code>, I figured I’d try removing the middle man. I begrudgingly installed <a href="https://support.google.com/drive/answer/10838124?sjid=5558807274599011115-EU#zippy=%2Cinstall-on-macos">Drive for desktop</a> and turned on their local mirroring feature. This method seemed to show promise: in just a couple hours, I managed to download over 950 GB into a fresh data folder. The next day, we were already at 3.5 TB! Unfortunately, that excitement did not last: the synchronization progress slowed down significantly and couldn’t get past 3,700 GB, or just over 65% of the way there. 12 days later, I pulled the plug on this little side experiment.</p>

<p>I was not totally desperate yet, though: Google Takeout was not <a href="https://killedbygoogle.com/">killed by Google</a> yet, and from a zoomed-out perspective seemed like the ideal tool for an export as large as this. I chose the option to download the data as <code class="language-plaintext highlighter-rouge">.zip</code>s each with the size of 50 GB at most (the largest option). Despite basic arithmetic, the fact that 120 download links showed up on the takeout page surprised me.</p>

<p><a href="/img/nas/google-takeout-links.png"><picture><source srcset="/generated/img/nas/google-takeout-links-600-072771a6f.webp 600w, /generated/img/nas/google-takeout-links-768-072771a6f.webp 768w" type="image/webp"><source srcset="/generated/img/nas/google-takeout-links-600-072771a6f.png 600w, /generated/img/nas/google-takeout-links-768-072771a6f.png 768w" type="image/png"><img src="/generated/img/nas/google-takeout-links-768-072771a6f.png" alt="Google Takeout page showing 120 separate download links" width="768" height="1570"></picture></a></p>

<p>Because takeouts are supposed to be used as a web GUI, downloading each new file got really tedious – I had to stop whatever I was doing every 30 minutes or so, just to go click on a download link and confirm the download destination on 3 more zips. I also had a deadline: you get just 7 days to download everything, no matter the total size of the data. Because I had other things to do in life than just to be at home all the time, I ended up having to use <a href="https://rustdesk.com/">RustDesk</a> from my phone to finish all the downloads in time.</p>

<p>Alas, the download was finished. I started backing up all the zips to Backblaze, and once that was done, I settled on extracting them into a single folder structure with <code class="language-plaintext highlighter-rouge">7z x 'takeout-*.zip'</code>. Many hours later, we got an exit code 0. Yess!!!!</p>

<p>So now we have the unarchived data, but where do we actually sustainably store it long-term?</p>

<h2 id="the-nas">The NAS</h2>

<p>I’ve been thinking about NASes for many years prior to 2024, but they always felt super un-sexy: you either buy something managed, and pay a bazillion dollars for it, or you spend months of your life scavenging the web for cheap parts, and end up building something that will break every 2 weeks<sup id="fnref:7"><a href="#fn:7" class="footnote" rel="footnote" role="doc-noteref">7</a></sup>.</p>

<p>I think what broke the fear of building my own NAS was getting <a href="https://www.youtube.com/@LinusTechTips">LTT</a> and <a href="https://www.youtube.com/@WolfgangsChannel">Wolfgang</a>-pilled into having an adoration for everything that rhymes with home lab. After some more months, I decided to give the build showcased <a href="https://youtu.be/Jr5MjhgPz_c">in this video</a> a shot.</p>

<p>I started compiling a <a href="#addendum-2-the-parts-list">list of parts</a> I’d need, and as I began ordering from all over Europe, it was time to finally settle on the software unknowns.</p>

<p>For one, the OS. Was I going to stick to my roots and just install Ubuntu server, or be brave enough to embrace the <a href="/nix/">coolness of Nix</a>? I for sure did not want to go down the super-managed and proprietary route of <a href="https://unraid.net/">Unraid</a>. At least that’s what I thought at first…</p>

<p>After further consideration, I realized that pursuing a more managed and easy-to-maintain operating system wouldn’t be as bad as I always thought – yes, I wouldn’t be as cool as I’d be maintaining some unstable Arch installation, and yea, I’d also be limited in what all such a machine could do, but maybe, just maybe, that would be for the better.</p>

<p>What I ended up choosing is TrueNAS Scale, an <a href="https://github.com/truenas/scale-build">open-source</a> and Debian-based OS, which is super easy to set up and frankly makes all the hard parts really simple. Everything is web-based, so as you are initially setting up, there’s no need to even connect a display (provided you can figure out your IP from your router’s admin interface).</p>

<p>The “making the hard parts simple” included the second big software choice, which was the disk setup. I was very new to RAID, and have never heard of wild abbreviations such as ZFS, but thankfully, Louis Rossmann (and in no small part, Claude) were there <a href="https://youtu.be/3fW9TV1WQi8?t=9377">to teach me</a>. Long story short, I chose a 4-wide array of RAIDZ2.
And it turns out, TrueNAS now lets you add drives to RAIDZ arrays when you go out and buy more.</p>

<p>This was actually my first computer build, and I was pleasantly surprised at how easy it actually is to put a computer together without any experience or advanced tools. The only scary part was slotting the CPU into the motherboard and applying thermal paste onto it. I watched like 5 YouTube videos on it and spent like 90 minutes trying to figure out the perfect spread<sup id="fnref:8"><a href="#fn:8" class="footnote" rel="footnote" role="doc-noteref">8</a></sup>.</p>

<p>After some not-so-careful cable management, I pressed the power button. To my surprise, it worked!
<a href="/img/nas/drive-bays.jpg"><picture><source srcset="/generated/img/nas/drive-bays-600-fba03eb6f.webp 600w, /generated/img/nas/drive-bays-800-fba03eb6f.webp 800w, /generated/img/nas/drive-bays-1200-fba03eb6f.webp 1200w, /generated/img/nas/drive-bays-1800-fba03eb6f.webp 1800w" type="image/webp"><source srcset="/generated/img/nas/drive-bays-600-fba03eb6f.jpg 600w, /generated/img/nas/drive-bays-800-fba03eb6f.jpg 800w, /generated/img/nas/drive-bays-1200-fba03eb6f.jpg 1200w, /generated/img/nas/drive-bays-1800-fba03eb6f.jpg 1800w" type="image/jpeg"><img src="/generated/img/nas/drive-bays-800-fba03eb6f.jpg" alt="The NAS drive bays populated with hard drives" width="4284" height="5712"></picture></a></p>

<p><a href="/img/nas/build.jpg"><picture><source srcset="/generated/img/nas/build-600-6ae2b8e4c.webp 600w, /generated/img/nas/build-800-6ae2b8e4c.webp 800w, /generated/img/nas/build-1200-6ae2b8e4c.webp 1200w, /generated/img/nas/build-1800-6ae2b8e4c.webp 1800w" type="image/webp"><source srcset="/generated/img/nas/build-600-6ae2b8e4c.jpg 600w, /generated/img/nas/build-800-6ae2b8e4c.jpg 800w, /generated/img/nas/build-1200-6ae2b8e4c.jpg 1200w, /generated/img/nas/build-1800-6ae2b8e4c.jpg 1800w" type="image/jpeg"><img src="/generated/img/nas/build-800-6ae2b8e4c.jpg" alt="The NAS computer build with components installed" width="5712" height="4284"></picture></a></p>

<h2 id="all-them-apps">All them apps</h2>

<p>Installing and running new apps on TrueNAS is a breeze, and when a platform lets you install apps a little bit too easily, you get an <a href="https://www.vocabulary.com/articles/wordroutes/how-we-got-an-app-for-that">apps craze</a>. At least that’s what happened to me.</p>

<p>I first started migrating apps from my previous home server, along with all the data where applicable: I moved my Jellyfin library over with little to no issues<sup id="fnref:9"><a href="#fn:9" class="footnote" rel="footnote" role="doc-noteref">9</a></sup>, set up Home Assistant anew and made sure that services not tunnelled through <a href="https://github.com/cloudflare/cloudflared"><code class="language-plaintext highlighter-rouge">cloudflared</code></a> were accessible on my <a href="https://tailscale.com/docs/concepts/tailnet">Tailnet</a><sup id="fnref:10"><a href="#fn:10" class="footnote" rel="footnote" role="doc-noteref">10</a></sup>.</p>

<p>Next up was setting up <a href="https://immich.app/">Immich</a>, which I got really excited about thanks to my friend Honza Černý of <a href="https://blackblog.cz/">blackblog.cz</a>. Not only did a backup of all my pictures seem like a good use of all that hard drive space I had lying around, but it also felt natural given all the <a href="https://www.eff.org/deeplinks/2022/08/googles-scans-private-photos-led-false-accusations-child-abuse">horror</a> <a href="https://piunikaweb.com/2026/02/03/google-photos-false-csam-flags-users-locked-out/">stories</a> I’ve heard of Google false-positively flagging people’s uploaded content as CSAM and restricting all access to their data.</p>

<p>In the year since initially setting it up, the hardest parts were always database migrations. The good news is that if you haven’t set up Immich yourself yet, I’d expect there to be way fewer breaking changes since their <a href="https://immich.app/blog/stable-release">first stable release</a> from October 2025. See the <a href="#addendum-3-seeding-immich">third addendum</a> below for how I managed to actually get photos onto there.</p>

<p>Similarly to Immich replacing Google Photos, I set up <a href="https://github.com/nextcloud/server">Nextcloud</a> as the replacement for Google Drive. Unsurprisingly, a lot of the SaaS functionality that Google is able to offer, Nextcloud just can’t keep up with, but for some things, the opposite is actually true. Like, for instance, you get to manage file encryption (which I did on the TrueNAS dataset side), you get actually fast local downloads that don’t have to go over the WAN, and there’s native integration with the macOS Finder (via WebDAV). I’ve also found it quite useful to mass-upload things onto Nextcloud either via <code class="language-plaintext highlighter-rouge">rclone</code> or a neat macOS GUI called <a href="https://cyberduck.io/">Cyberduck</a>.</p>

<p>I also set up <a href="https://syncthing.net/">Syncthing</a> to help me continuously back up my iCloud Drive contents, and <a href="https://about.gitea.com/">Gitea</a> for backing up my notes that I take with Obsidian<sup id="fnref:11"><a href="#fn:11" class="footnote" rel="footnote" role="doc-noteref">11</a></sup>.</p>

<p>I couldn’t forget running <a href="https://pi-hole.net/">Pi-hole</a>, <a href="https://github.com/redlib-org/redlib">redlib</a> and <a href="https://www.qbittorrent.org/">qBittorrent</a> for the times I want to download <a href="https://xcancel.com/GeoffreyHuntley/status/1461322836165885954#m">19.5 TiB of NFTs</a>.</p>

<h2 id="summimg-up">Summimg up</h2>

<p>Building a NAS ended up being a bunch of fun, and as a big surprise to me, the only big issues of the whole process I had were with the parts I was more versed in (the Google Drive downloads). Admittedly, having this NAS isn’t the end all be all for backups, but it’s a an ok-ish first step. I’ll keep you posted once I set up a second one for an off-site backup :).</p>

<p>I think that’s it for now. If you’re curious about anything I didn’t mention, <a href="https://bsky.app/profile/trnck.dev">ATProto me</a>!</p>

<hr />

<h2 id="addendum-1-downloading-google-classroom-files">Addendum 1: downloading Google Classroom files</h2>

<p>When attending high school, I was fortunate enough that we used Google Classroom in lieu of Microsoft Teams for homework, assignments and all that sort of jazz. Since files that are shared in the class stream do not get added to “Shared with you” files in Google Drive, persisting them required more effort.</p>

<p>What I ended up doing was pretty simple: go to each class’ page in my browser, open Dev Tools, and execute a script to collect file IDs. Then, with <code class="language-plaintext highlighter-rouge">rclone</code>, download those files by ID to a directory. The next time I attend high school and they have Google Workspace going, I’d likely automate a browser or something, now that Claude 4.8 runs my life.
You can find the source of the scripts here: <a href="https://github.com/filiptronicek/google-classroom-files-export">filiptronicek/google-classroom-files-export</a>.</p>

<h2 id="addendum-2-the-parts-list">Addendum 2: the parts list</h2>

<table>
  <thead>
    <tr>
      <th>Component</th>
      <th>Name</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Case</td>
      <td>8-drive bay ATX case from Aliexpress</td>
    </tr>
    <tr>
      <td>Case fans</td>
      <td>5x ARCTIC P12 PWM PST</td>
    </tr>
    <tr>
      <td>CPU</td>
      <td>AMD Ryzen 5 PRO 4650G</td>
    </tr>
    <tr>
      <td>CPU Cooler</td>
      <td>Thermalright AXP90-X36</td>
    </tr>
    <tr>
      <td>PSU</td>
      <td>Cooler Master MWE Full Modular</td>
    </tr>
    <tr>
      <td>RAM</td>
      <td>2x32 GB Kingston FURY Beast 3200 MHz DDR4</td>
    </tr>
    <tr>
      <td>HDDs</td>
      <td>4x12 TB HGST WD Ultrastar DC HC520 HDD<sup id="fnref:12"><a href="#fn:12" class="footnote" rel="footnote" role="doc-noteref">12</a></sup><sup id="fnref:13"><a href="#fn:13" class="footnote" rel="footnote" role="doc-noteref">13</a></sup></td>
    </tr>
    <tr>
      <td>SSD (for OS)</td>
      <td>512 GB Verbatim Vi3000</td>
    </tr>
    <tr>
      <td>Cables</td>
      <td>- A <a href="https://www.amazon.co.uk/dp/B000067SLY">molex splitter</a><br />- Some <a href="www.amazon.co.uk/dp/B09Q1CZ8G3">SATA cables</a></td>
    </tr>
    <tr>
      <td>Motherboard</td>
      <td>ASROCK B550M Pro4 <sup id="fnref:14"><a href="#fn:14" class="footnote" rel="footnote" role="doc-noteref">14</a></sup></td>
    </tr>
  </tbody>
</table>

<h2 id="addendum-3-seeding-immich">Addendum 3: seeding Immich</h2>

<p>The first phase of my Immich backup was very simple: get their <a href="https://github.com/immich-app/immich/tree/main/mobile">iOS app</a> and turn on background uploads. This took many, many days, but finished crunching through the ~19,000 photos and ~2,500 videos eventually.
When downloading the app initially, it wasn’t the most native-feeling and some of the core functionality was really not on par with Google Photos, but that’s since improved, a lot<sup id="fnref:15"><a href="#fn:15" class="footnote" rel="footnote" role="doc-noteref">15</a></sup>.</p>

<p>To actually prevent myself from getting locked out of my digital picture memories, I had to move all of Google Photos, my source of truth for everything I ever shot up until that point, to Immich.
Since I was not about to sift through 460 GB of pictures and put them into albums myself, I recruited the help of <a href="https://github.com/simulot/immich-go">simulot/immich-go</a>, which advertised first-class support for Google Takeout archives. Unlike the Google Drive export, the size here was under a terabyte, which meant that after requesting the Takeout, I could just get Google to save it onto my personal Google Drive and download the 50 GB zips from there.
After downloading all the archives all onto the NAS, I downloaded the <code class="language-plaintext highlighter-rouge">immich-go</code> binary and have set up an Immich API key. Then, I ran this command that went through all of the archives and uploaded the assets onto my local Immich instance.</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>../immich-go upload from-google-photos <span class="nt">--server</span><span class="o">=</span>http://localhost:30041 <span class="nt">--api-key</span><span class="o">=</span>&lt;my-api-key&gt; <span class="nt">--concurrent-tasks</span><span class="o">=</span>4 <span class="nt">--client-timeout</span><span class="o">=</span>60m <span class="nt">--pause-immich-jobs</span><span class="o">=</span><span class="nb">true</span> <span class="nt">--on-errors</span><span class="o">=</span><span class="k">continue</span> <span class="nt">--manage-raw-jpeg</span><span class="o">=</span>StackCoverJPG <span class="nt">--manage-burst</span><span class="o">=</span>Stack /mnt/main/media/throwaway/takeout
</code></pre></div></div>

<p>I <code class="language-plaintext highlighter-rouge">tmux</code>ed this and let it run, and after checking back in a couple hours, it was completed with little to no errors. De-duplication seemed to work flawlessly – I expected most pictures to be re-uploaded because of checksum mismatches between the iCloud originals and Google Photos optimized pictures, but it ended up not being an issue at all.
Just like that, almost 5,000 new videos and 50,000 pictures were happily sitting on my ever-growing timeline of life.</p>

<h2 id="addendum-4-the-ai-hardware-cost-crisis">Addendum 4: the AI hardware cost crisis</h2>

<p>As you’ve probably heard, we’re finding ourselves in the middle of a <a href="https://en.wikipedia.org/wiki/2024%E2%80%93present_global_memory_supply_shortage">memory supply shortage</a>, which caused RAM sticks to be about 400% of their prices just a year ago, and caused related components, such as SSDs and even HDDs, to go a similar route. This is why I could buy the 64 GB of DDR4 RAM for €111 and the 48 TBs worth of HDDs for €622.07. Today, the HDDs alone would cost me more than double, but even if I wanted to buy them anyway, <a href="https://wccftech.com/western-digital-has-no-more-hdd-capacity-left-out/">they’d be all out of stock</a>.</p>

<p>As we’ve made more short films over at <a href="https://www.youtube.com/@tagtram">TagTram Studios</a>, space on those hard drives has begun to tighten. I’m currently looking at about 6 TB free out of the original 24, but just can’t justify buying any new hardware at this moment. Really hoping for all this to be over within a year or two – it’s a <a href="https://youtu.be/zyQwAhppWj8">really bad time for personal computing</a> right now.
Telling my friends and family to hold on for dear life on all hardware they have today, is, as a computer nerd, tough. Things are what they are, though, and let’s see what comes up from all of this.</p>

<h2 id="footnotes">Footnotes</h2>

<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:1">
      <p>At the time, a 50 Mb/s XAVC video stream seemed bonkers large to me. <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:2">
      <p>This, in turn, forced some of my classmates to start backing up their photos to their school Google account. Similar to using your corporate email inbox for personal matters, a really bad idea considering what happens when you get fired. <a href="#fnref:2" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:3">
      <p>Fun fact: at that time, my Google Drive hovered around 12-13 TB, which meant I was using about an eighth of the entire school’s quota. <a href="#fnref:3" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:4">
      <p>Although you can likely make it work, <a href="https://www.backblaze.com/company/policy/acceptable-use-policy#:~:text=outside%20of%20supported-,devices.,-Use%20the%20Service">they really don’t want you to</a>. <a href="#fnref:4" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:5">
      <p>It’s the classic cloud data storage problem LTT ran into some years back: <a href="https://youtu.be/y2F0wjoKEhg">I Hope Google Doesn’t Ban Us… - Abusing Unlimited Google Drive - YouTube</a> <a href="#fnref:5" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:6">
      <p>The Backblaze Personal backup offering surprisingly also beats Amazon Glacier Deep Archive costs (with no monthly retrieval allowance). Quite cool. <a href="#fnref:6" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:7">
      <p>A <a href="https://reddit.fufik.eu/img/8ncinjy26cof1.jpeg">Linux moment</a> <a href="#fnref:7" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:8">
      <p>If you’re struggling yourself, first, don’t worry about it so much, and second, go watch <a href="https://youtu.be/Sog0M9OrlME?t=143">this video on it</a>. <a href="#fnref:8" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:9">
      <p>Though this was just the media files, all user data was set up from scratch, so I lost things like watch history / playlists. <a href="#fnref:9" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:10">
      <p>The Tailscale integration in TrueNAS is like any other app, which means isolated in a Docker container without many system-wide privileges. This makes things like passwordless SSH harder. <a href="#fnref:10" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:11">
      <p>I am actually using Obsidian to write this blog post! <a href="#fnref:11" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:12">
      <p>I got these refurbished from Amazon.de, and they reported pretty good results on all SMART tests I’ve run on them. All 4 came with about 32K power-on hours and no bad sectors, which boosted confidence. <a href="#fnref:12" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:13">
      <p>In RAIDZ2, this means about 24 TB of usable capacity <a href="#fnref:13" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:14">
      <p>Initially, I was really keen to find a good deal on the Gigabyte MC12-LE0, which Wolfgang featured in <a href="https://youtu.be/Jr5MjhgPz_c">his video</a> as a super cheap option for a perfectly good motherboard with support for <abbr title="Error Correction Code">ECC</abbr> memory. I am unsure if it was just due to his showoff, but it left the stock of the MC12-LE0 in shambles, with extreme price hikes ever since. I found the ASROCK B550M Pro4 to be a good, even if ECC-incompatible replacement. <a href="#fnref:14" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:15">
      <p>It’s still written in Flutter, so manage your expectations <a href="#fnref:15" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name>filiptronicek</name></author><summary type="html"><![CDATA[TL;DR: I built a NAS to back up terabytes of data from my Google Drive, and had a bunch of fun doing it.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="/nas.png" /><media:content medium="image" url="/nas.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Instant Messaging apps: an overview of Discord, Signal and Matrix</title><link href="/instant-messaging/" rel="alternate" type="text/html" title="Instant Messaging apps: an overview of Discord, Signal and Matrix" /><published>2025-11-30T00:00:00+00:00</published><updated>2025-11-30T00:00:00+00:00</updated><id>/instant-messaging</id><content type="html" xml:base="/instant-messaging/"><![CDATA[<p>As part of <a href="https://4iz110.vse.cz/">4IZ110</a> at my bachelor’s programme at the Prague University of Business and Economics, I chose the topic of Instant Messaging for my term paper. In it, I wanted to focus on three distinct approaches to instant messaging today:</p>

<ul>
  <li>Centralized without <abbr title="End-to-End Encryption">E2EE</abbr>, where I chose Discord as a well-known example</li>
  <li>Centralized with E2EE: this was represented by the Signal protocol, which powers apps like Signal, WhatsApp or Messenger</li>
  <li>Decentralized with E2EE: the example given in the term paper is the federated Matrix protocol</li>
</ul>

<p>I chose to focus mainly on the encryption and data formats behind these protocols, as I thought the three would make an interesting comparison. Learning about how Signal does key derivation and how it can guarantee both forward secrecy and post-compromise security, my mind was truly boggled (in other words, I learned a lot).</p>

<p>You can find the paper as PDF [in Czech] <a href="/static/Instant%20Messaging.pdf">here</a>.</p>

<p>The scope of the paper sadly limited the space to dive too deep into all of the protocols, but I was at least glad I was able to connect instant messaging with my love for <abbr title="Post-Quantum">PQ</abbr> cryptography – not only was I able to talk about <abbr title="Post-Quantum Extended Diffie-Hellman">PQXDH</abbr>, the quantum-resistant key agreement protocol we briefly touched on <a href="/hello-internet/">more than 2 years back</a>, but as it turns out, there is a new way the brilliant engineers behind the Signal messenger created to make messaging even more complex.</p>

<h2 id="addendum-1-the-triple-ratchet">Addendum 1: The Triple Ratchet</h2>

<p>As Signal outlined in <a href="https://signal.org/blog/spqr/">their blog post</a> from early October, PQXDH is cool ‘n all, but does not address the full scope of post-quantum cryptographic problems with the Signal protocol: one of its core guarantees, post-compromise security, can be broken if the attacker can break <abbr title="Elliptic-curve Diffie–Hellman">ECDH</abbr>.</p>

<p>The team designed a way to use the ML-KEM 768 standard with a concept of epochs, where each epoch between Alice and Bob (our two chatty friends) starts when they agree on a shared secret and mix it into their conversation’s encryption key. This shared secret is based on Alice’s asymmetric keypair and Bob’s generated secret. Whenever a new epoch starts, the protocol guarantees both forward secrecy (no one who compromises the conversation today can decrypt messages from the last epoch) and post-compromise security (compromising the keys of one side of the conversation today will not help you decrypt the next epoch).</p>

<p>The Sparse Post-Quantum Ratchet, as the team calls it, offers two very important attributes:</p>

<ul>
  <li>At least as secure as double ratcheting: the SPQR is an additional ratcheting mechanism running besides the Double Ratchet. Keys from both ratchets are then mixed together with a <abbr title="Key Derivation Function">KDF</abbr> so that they don’t accidentally create a big security hole in their messaging app with a new encryption scheme</li>
  <li>The per-message key material size isn’t much different from the Diffie-Hellman ratchet of 32 bytes per message <sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">1</a></sup>. The 1184 bytes for the initial encapsulation key are not sent all at once by Alice, but in chunks, each delivered with every message to Bob.
    <ul>
      <li>The chunks are split using Reed–Solomon erasure codes, which guarantee that if you need <code class="language-plaintext highlighter-rouge">n</code> chunks to construct the entire ML-KEM <abbr title="Encapsulation Key">EK</abbr>, you can do so with <em>any</em> <code class="language-plaintext highlighter-rouge">n</code> chunks from a chunk stream, no matter the order or whether the stream is continuous. The same goes for sharing the resulting ciphertext from Bob back to Alice.</li>
    </ul>
  </li>
</ul>

<p>The algorithm is also optimized for efficiency: sharing a large key chunk-by-chunk is a very one-sided operation, so the Signal team took advantage of how ML-KEM keys are structured: because most bytes of the large key are just used for describing the lattice structure of the key, we can initially just send a small portion (a 32 byte seed for our lattice space generation and a 32 byte hash of <code class="language-plaintext highlighter-rouge">EK</code>) for the other side to be able to construct the majority of the final ciphertext (<code class="language-plaintext highlighter-rouge">CT</code>), so that we can start doing ping-pong earlier (and conversely, get a shared secret sooner and start more epochs more often).</p>

<p>The Signal team is rolling this out to conversations in their messenger app right now, and will start working when both devices have an up-to-date version of Signal<sup id="fnref:2"><a href="#fn:2" class="footnote" rel="footnote" role="doc-noteref">2</a></sup>.</p>

<h2 id="footnotes">Footnotes</h2>

<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:1">
      <p>The encapsulation key size of ML-KEM reaching over a kilobyte has been a problem ever since the <abbr title="Key Exchange">KEX</abbr> algorithm was first introduced into the networking stack: because these keys do not fit into a single packet, they’ve caused incompatible servers to fail quantum-secure connections. This problem even has a <a href="https://tldr.fail/">website</a>! <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:2">
      <p>Although the SPQR was introduced in <a href="https://github.com/signalapp/libsignal/releases/tag/v0.74.0">libsignal v0.74.0</a> in early June, it started rolling out some time after <a href="https://github.com/signalapp/Signal-iOS/commit/636875907b3325746ae9aef19cfdc4f4a7d02298">August 20</a>. <a href="#fnref:2" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name>filiptronicek</name></author><summary type="html"><![CDATA[As part of 4IZ110 at my bachelor’s programme at the Prague University of Business and Economics, I chose the topic of Instant Messaging for my term paper. In it, I wanted to focus on three distinct approaches to instant messaging today:]]></summary></entry><entry><title type="html">How that ML-KEM is doing</title><link href="/ciphertrails-checkin/" rel="alternate" type="text/html" title="How that ML-KEM is doing" /><published>2025-10-10T00:00:00+00:00</published><updated>2025-10-10T00:00:00+00:00</updated><id>/ciphertrails-checkin</id><content type="html" xml:base="/ciphertrails-checkin/"><![CDATA[<p>Hey all! Some time has passed already and I felt like giving you all an update about how the adoption of Encrypted Client Hello and ML-KEM is doing. There’s not too much I need you tell in long sentences, so let’s do bullet-points this time around instead:</p>

<h2 id="post-quantum-adoption">Post-quantum adoption</h2>

<ul>
  <li>today, close to 50% of human internet traffic that routes through Cloudflare is using ML-KEM or X25519Kyber768 (for HTTP3 traffic, this jumps to about 65%!) <sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">1</a></sup></li>
  <li>since last time, both Chrome and Firefox made the switch to the <a href="https://csrc.nist.gov/pubs/fips/203/final">now standardized ML-KEM</a>. If you’re not into threat actors harvesting your pre-quantum Safari traffic, upgrade your software to <code class="language-plaintext highlighter-rouge">(mac|i|iPad|tv|watch|vision)OS</code> 26.</li>
  <li>OpenSSL 3.5.0 <a href="https://github.com/openssl/openssl/releases/tag/openssl-3.5.0">shipped</a> with native support for ML-KEM</li>
  <li>from a dataset of 10 000 most popular domains according to Cloudflare Radar, about 52% of them connect using ML-KEM</li>
</ul>

<h2 id="encrypted-client-hello">Encrypted Client Hello</h2>

<ul>
  <li>using ECH is now possible in <code class="language-plaintext highlighter-rouge">curl</code> when building from <a href="https://github.com/defo-project/openssl">DEfO’s OpenSSL</a> fork. Instructions are <a href="https://github.com/sftcd/curl/blob/ECH-experimental/docs/ECH.md">on GitHub</a></li>
  <li>even though Safari is <a href="https://github.com/WebKit/standards-positions/issues/46#issuecomment-1334681742">supportive of the idea of ECH</a>, the lack of first-party support of DOH in the browser is likely holding back any innovation on this front</li>
  <li>in Firefox, ECH’s default enabled state can be tweaked by enterprises or parents using policies for content filtering</li>
  <li>the Russian government is taking an official stance against ECH, stating it’s “circumventing restrictions on access to information”<sup id="fnref:2"><a href="#fn:2" class="footnote" rel="footnote" role="doc-noteref">2</a></sup> [<a href="https://portal.noc.gov.ru/ru/news/2024/11/07/%D1%80%D0%B5%D0%BA%D0%BE%D0%BC%D0%B5%D0%BD%D0%B4%D1%83%D0%B5%D0%BC-%D0%BE%D1%82%D0%BA%D0%B0%D0%B7%D0%B0%D1%82%D1%8C%D1%81%D1%8F-%D0%BE%D1%82-cdn-%D1%81%D0%B5%D1%80%D0%B2%D0%B8%D1%81%D0%B0-cloudflare/">source</a>]</li>
  <li>in June, we’ve gotten our 25th revision of the <a href="https://datatracker.ietf.org/doc/draft-ietf-tls-esni/">ECH draft</a>, with reports pointing to an upcoming official RFC publication – is this perhaps the motivation that the Safari team needed? [<a href="https://www.feistyduck.com/newsletter/issue_127_encrypted_client_hello_approved_for_publication">source</a>]</li>
  <li>from the same dataset of 10 000 most popular domains, only about 5,4% offered and accepted an ECH connection</li>
</ul>

<h2 id="footnotes">Footnotes</h2>

<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:1">
      <p>Data from <a href="https://radar.cloudflare.com/explorer?dataSet=http&amp;groupBy=post_quantum&amp;filters=botClass%253DLikely_Human&amp;dt=1d">Cloudflare Radar</a> <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:2">
      <p>And even worse, they miscapitalized Cloudflare in the official statement :( <a href="#fnref:2" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name>filiptronicek</name></author><summary type="html"><![CDATA[Hey all! Some time has passed already and I felt like giving you all an update about how the adoption of Encrypted Client Hello and ML-KEM is doing. There’s not too much I need you tell in long sentences, so let’s do bullet-points this time around instead:]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="/ciphertrails_4.webp" /><media:content medium="image" url="/ciphertrails_4.webp" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">A little bit of Nix-based fun</title><link href="/nix/" rel="alternate" type="text/html" title="A little bit of Nix-based fun" /><published>2025-02-01T00:00:00+00:00</published><updated>2025-02-01T00:00:00+00:00</updated><id>/nix</id><content type="html" xml:base="/nix/"><![CDATA[<p>I discovered Nix quite a while ago: I remember it was in 2022 when I saw <a href="https://ghuntley.com/">@ghuntley</a> praise it publicly and at the time, I didn’t pay too much attention to it or to what it even was, since I was scared of bringing more complexity into my already hacky and complicated setups, in which I juggled between using Windows and my new MacBook, which I was still getting accustomed to (as one does being a lifelong victim of Microsoft’s OS dominance over the PC market).</p>

<p>2022 was also the year dotfiles became a first-class citizen in Gitpod and I wanted to try it out so bad: I had so many ideas what to do with them ranging from funny <a href="/terminal-tricks">login messages</a> through setting up <a href="https://github.com/gitpod-io/gitpod/issues/666">gpg commit signing</a>. Unfortunately, none of my original intentions with dotfiles went through: in the end, I was just frustrated that I couldn’t easily debug my setup and gave up (also since they weren’t crucial for my day-to-day anyway).</p>

<p>Fast forward to last October, when I saw nix mentioned again in a video in my YouTube recommended. All of a sudden, the whole appeal of Nix clicked: I love my local macOS setup, but I’ve always feared messing something up and not being able to revert it, like I’m used to with all my other work. Now, after watching <a href="https://www.youtube.com/watch?v=Z8BL8mdzWHI">that amazing video</a> I had to at least give it a shot: after not even an hour, I had a working <code class="language-plaintext highlighter-rouge">nix-darwin</code> setup with all my homebrew casks and brews migrated to a single nix flake, which I was able to manage all from with my text editor - wow! No more <code class="language-plaintext highlighter-rouge">brew install</code>s and <code class="language-plaintext highlighter-rouge">uninstall</code>s, just change a text file, run a command, and this magic little fairy called Nix will take care of the entire reconciliation for me.</p>

<p>This was also around the time the <a href="https://offthemainthread.tech/episode/nix/">Nix episode</a> of the Off The Main Thread podcast was released, and that further pushed me to not give up on advancing my cool little declarative flake.</p>

<p>Then, recently, I’ve also converted my zsh aliases and init commands to that very same Nix flake, which means that when I run a single command<sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">1</a></sup> on a new machine, I get:</p>

<ul>
  <li>most of my system preferences set up, including 24-hour time, my (controversial) preferred scrolling direction, and all of my persisted apps in the app dock</li>
  <li>close to all of my apps: some through Nix packages directly, and some using <a href="https://github.com/zhaofengli/nix-homebrew">nix-homebrew</a> (mostly for GUIs, which tend to be angry when not having write permissions to their binaries and hence not being able to auto-update)</li>
  <li>my favorite fonts</li>
  <li>my default browser is set up as the default HTTP handler (through <a href="https://github.com/kerma/defaultbrowser">defaultbrowser</a>)</li>
  <li>my git config, with my name, e-mail address, and GPG signing setup (although I still have to generate and import keys manually)</li>
  <li>a fully set-up <a href="https://github.com/ajeetdsouza/zoxide">zoxide</a> (if you don’t know what this is, you <strong>have</strong> to check it out, it will change the way you traverse folders on your system)</li>
  <li>declaratively-managed login items (startup apps) for apps like Monitor Control, which I need to control the brightness on my external monitor</li>
</ul>

<p>If you’re curious, you can check out my setup <a href="https://github.com/filiptronicek/nix/blob/main/flake.nix">on GitHub</a>. I feel like it’s almost perfect, but it has some limitations:</p>

<ul>
  <li>Some apps just aren’t on either Homebrew or Nix packages (like my video editing software of choice, Davinci Resolve)</li>
  <li>Some customizations aren’t very straightforward (like maintaining the aforementioned login items or setting a screensaver, which I still wasn’t able to figure out)</li>
  <li>The per-app setup sometimes isn’t granular enough and you still have to do a lot of setup within the packages you install<sup id="fnref:2"><a href="#fn:2" class="footnote" rel="footnote" role="doc-noteref">2</a></sup> (this is not an issue of Nix though)</li>
</ul>

<p>Next on my list is to integrate the Nix package manager into my Gitpod dotfiles so that I have a consistent toolset for all my projects, no matter which one I’m working on.</p>

<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:1">
      <p>It’s not really a single command (because you have to first set up nix on the machine), but it’s close to it and becomes a single command after Nix is set up <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:2">
      <p>For example, I would love to declaratively specify which of my Epic Games and Steam library items should automatically be installed on my machine <a href="#fnref:2" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name>filiptronicek</name></author><summary type="html"><![CDATA[I discovered Nix quite a while ago: I remember it was in 2022 when I saw @ghuntley praise it publicly and at the time, I didn’t pay too much attention to it or to what it even was, since I was scared of bringing more complexity into my already hacky and complicated setups, in which I juggled between using Windows and my new MacBook, which I was still getting accustomed to (as one does being a lifelong victim of Microsoft’s OS dominance over the PC market).]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="/nix.avif" /><media:content medium="image" url="/nix.avif" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Cloudflare with the ECH again</title><link href="/cloudflare-with-ech-again/" rel="alternate" type="text/html" title="Cloudflare with the ECH again" /><published>2024-09-29T00:00:00+00:00</published><updated>2024-09-29T00:00:00+00:00</updated><id>/cloudflare-with-ech-again</id><content type="html" xml:base="/cloudflare-with-ech-again/"><![CDATA[<p>Three months ago, I promised to <em>let you know</em> if anything ever changed about the Cloudflare and <abbr title="Encrypted Client Hello">ECH</abbr> situation - and here we are. As of at least a couple of weeks back, Cloudflare has been re-enabling ECH on all free-tier websites. Just. Lovely.</p>

<p>It looks like I was also right in my guesses around the reasoning behind the initial disabling of ECH - <a href="https://developers.cloudflare.com/ssl/edge-certificates/ech/">Cloudflare’s official docs</a> now have an entire section called “Enterprise network applicability”, aiming to document what companies can do to disable ECH on their networks (the tl;dr is that you just drop the <code class="language-plaintext highlighter-rouge">HTTPS</code> DNS record types from your corporate DNS resolver<sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">1</a></sup>).</p>

<p>So, after nearly one year of my <a href="/hello-internet/">initial ECH and ML-KEM blog</a>, here is the updated table of adoption of some arbitrarily chosen domains:</p>

<table>
  <thead>
    <tr>
      <th>Domain</th>
      <th>Protocol</th>
      <th>Key exchange</th>
      <th>ECH support</th>
      <th>Cloudflare?</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">tiktok.com</code></td>
      <td>TLS 1.3</td>
      <td>X25519</td>
      <td>No</td>
      <td>❌</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">twitter.com</code></td>
      <td>TLS 1.3</td>
      <td>X25519</td>
      <td>No</td>
      <td>❌</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">github.com</code></td>
      <td>TLS 1.3</td>
      <td>X25519</td>
      <td>No</td>
      <td>❌</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">npmjs.com</code></td>
      <td>TLS 1.3</td>
      <td>X25519Kyber768Draft00</td>
      <td>No</td>
      <td>✅</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">cloudflare.com</code></td>
      <td>QUIC</td>
      <td>X25519Kyber768Draft00</td>
      <td>No</td>
      <td>✅</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">apple.com</code></td>
      <td>TLS 1.3</td>
      <td>X25519</td>
      <td>No</td>
      <td>❌</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">netflix.com</code></td>
      <td>TLS 1.3</td>
      <td>X25519</td>
      <td>No</td>
      <td>❌</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">vercel.com</code></td>
      <td>TLS 1.3</td>
      <td>X25519</td>
      <td>No</td>
      <td>❌</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">google.com</code></td>
      <td>QUIC</td>
      <td>X25519Kyber768Draft00</td>
      <td>No</td>
      <td>❌</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">instagram.com</code></td>
      <td>QUIC</td>
      <td>X25519</td>
      <td>No</td>
      <td>❌</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">shopify.com</code></td>
      <td>TLS 1.3</td>
      <td>X25519Kyber768Draft00</td>
      <td>No</td>
      <td>✅</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">drive.google.com</code></td>
      <td>QUIC</td>
      <td>X25519Kyber768Draft00</td>
      <td>No</td>
      <td>❌</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">youtube.com</code></td>
      <td>TLS 1.3</td>
      <td>X25519Kyber768Draft00</td>
      <td>No</td>
      <td>❌</td>
    </tr>
    <tr>
      <td><code class="language-plaintext highlighter-rouge">interclip.app</code></td>
      <td>QUIC</td>
      <td>X25519Kyber768Draft00</td>
      <td>Yes</td>
      <td>✅</td>
    </tr>
  </tbody>
</table>

<p>Damn, besides Shopify and YouTube defaulting to TLS 1.3 instead of QUIC on Chrome now for some reason, literally nothing has changed when compared to the table from October 2023 - no big domain I visit daily supports the Encrypted Client. Hello goodness. We’re still far from ECH being standard, so I guess, see you in 2025?</p>

<p>If we analyze the top 10,000 requested domains on Cloudflare, many have ECH configured in their DNS. To my surprise, this included the very popular torrent trackers 1337x, KickassTorrents, and BadassTorrents (although on second thought, these websites tend to be on Cloudflare’s free tier, so it makes sense). Some other notable adopters include:</p>

<ul>
  <li><a href="https://www.curseforge.com/">curseforge.com</a></li>
  <li>gitlab.io</li>
  <li><a href="https://www.jsdelivr.com/">jsdelivr.com</a></li>
  <li>returnyoutubedislikeapi.com</li>
</ul>

<p>Of the 10,000, 349 domains have ECH enabled, which is a ~3.5% starting adoption rate. Let’s see if Cloudflare continues the rollout as promised and if we see adoption among the giants.</p>

<h2 id="footnotes">Footnotes</h2>

<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:1">
      <p>Of course, if you as an employee have access to the browser settings, you can change your DNS resolver to a public one like Cloudflare’s <a href="https://one.one.one.one/">1.1.1.1</a> or Google’s <a href="https://developers.google.com/speed/public-dns/">8.8.8.8</a> to skip these restrictions. <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name>filiptronicek</name></author><summary type="html"><![CDATA[Three months ago, I promised to let you know if anything ever changed about the Cloudflare and ECH situation - and here we are. As of at least a couple of weeks back, Cloudflare has been re-enabling ECH on all free-tier websites. Just. Lovely.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="/cloudflare-with-ech-again.png" /><media:content medium="image" url="/cloudflare-with-ech-again.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Go 1.23 adds support for ECH and Kyber</title><link href="/go-ech-kyber/" rel="alternate" type="text/html" title="Go 1.23 adds support for ECH and Kyber" /><published>2024-08-18T00:00:00+00:00</published><updated>2024-08-18T00:00:00+00:00</updated><id>/go-ech-kyber</id><content type="html" xml:base="/go-ech-kyber/"><![CDATA[<p>Go 1.23 <a href="https://go.dev/blog/go1.23">is out</a> and it brings many new features. In the beginning of the release notes there’s a bunch to read about the range over function iterators functionality or the new <code class="language-plaintext highlighter-rouge">unique</code>, <code class="language-plaintext highlighter-rouge">structs</code> and <code class="language-plaintext highlighter-rouge">iter</code> packages, but given the fact I’m no go expert, I won’t go into any of those.</p>

<p>The thing that stuck out to me were the changes to <code class="language-plaintext highlighter-rouge">crypto/tls</code>, which this time around were quite fruitful:</p>

<h2 id="ech"><abbr title="Encrypted Client Hello">ECH</abbr></h2>

<p>Starting with this release, Go adds support for client-side ECH, which is a great step forward with potential adoption. Before its inclusion in the standard library, one would have to use third-party options, such as a custom library for making network requests or a custom build of Go (such as <a href="https://github.com/cloudflare/go">cloudflare/go</a>). Having it in the standard library also means we’re one step closer to <a href="https://github.com/caddyserver/caddy/issues/4221">support with Caddy</a>.</p>

<p>A simple example which checks if a website supports ECH could look like this:</p>

<div class="language-go highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">package</span> <span class="n">main</span>

<span class="k">import</span> <span class="p">(</span>
    <span class="s">"crypto/tls"</span>
    <span class="s">"fmt"</span>
    <span class="s">"net/http"</span>
    <span class="s">"time"</span>
<span class="p">)</span>

<span class="k">func</span> <span class="n">main</span><span class="p">()</span> <span class="p">{</span>
    <span class="n">domain</span> <span class="o">:=</span> <span class="s">"crypto.cloudflare.com"</span>
    <span class="n">req</span><span class="p">,</span> <span class="n">err</span> <span class="o">:=</span> <span class="n">http</span><span class="o">.</span><span class="n">NewRequest</span><span class="p">(</span>
        <span class="s">"GET"</span><span class="p">,</span>
        <span class="s">"https://"</span><span class="o">+</span><span class="n">domain</span><span class="p">,</span>
        <span class="no">nil</span><span class="p">,</span>
    <span class="p">)</span>
    <span class="k">if</span> <span class="n">err</span> <span class="o">!=</span> <span class="no">nil</span> <span class="p">{</span>
        <span class="k">return</span>
    <span class="p">}</span>

    <span class="n">http</span><span class="o">.</span><span class="n">DefaultTransport</span><span class="o">.</span><span class="p">(</span><span class="o">*</span><span class="n">http</span><span class="o">.</span><span class="n">Transport</span><span class="p">)</span><span class="o">.</span><span class="n">TLSClientConfig</span> <span class="o">=</span> <span class="o">&amp;</span><span class="n">tls</span><span class="o">.</span><span class="n">Config</span><span class="p">{</span>
        <span class="n">EncryptedClientHelloConfigList</span><span class="o">:</span> <span class="n">echConfigList</span><span class="p">,</span>
    <span class="p">}</span>

    <span class="n">resp</span><span class="p">,</span> <span class="n">err</span> <span class="o">:=</span> <span class="p">(</span><span class="o">&amp;</span><span class="n">http</span><span class="o">.</span><span class="n">Client</span><span class="p">{</span><span class="n">Timeout</span><span class="o">:</span> <span class="m">5</span> <span class="o">*</span> <span class="n">time</span><span class="o">.</span><span class="n">Second</span><span class="p">})</span><span class="o">.</span><span class="n">Do</span><span class="p">(</span><span class="n">req</span><span class="p">)</span>
    <span class="k">if</span> <span class="n">err</span> <span class="o">!=</span> <span class="no">nil</span> <span class="p">{</span>
        <span class="n">fmt</span><span class="o">.</span><span class="n">Println</span><span class="p">(</span><span class="s">"ECH support: "</span><span class="p">,</span> <span class="n">resp</span><span class="o">.</span><span class="n">TLS</span><span class="o">.</span><span class="n">ECHAccepted</span><span class="p">)</span>
    <span class="p">}</span>
<span class="p">}</span>
</code></pre></div></div>

<p>Alright, let’s just run this and…</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>undefined: echConfigListBytes
</code></pre></div></div>

<p>Damn it, we need some <code class="language-plaintext highlighter-rouge">EncryptedClientHelloConfigList</code> to let the client know about the public key with which to encrypt the <abbr title="Server Name Indication">SNI</abbr>. But how do we get that? Well, if you by chance stumbled upon <a href="https://datatracker.ietf.org/doc/rfc9460/">RFC 9460</a> section 14.3.2 you could read that the DNS record type 65 (HTTPS) has a field called <code class="language-plaintext highlighter-rouge">ech</code>, which contains just that: the key to give to <code class="language-plaintext highlighter-rouge">EncryptedClientHelloConfigList</code> - yay! This means that to make a proper ECH-enabled HTTP request, we need to first query DNS, parse the response, and then use the key to give to <code class="language-plaintext highlighter-rouge">http.Client.Do</code>.</p>

<p>Knowing this, we can now write a more complete example:</p>

<div class="language-go highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">package</span> <span class="n">main</span>

<span class="k">import</span> <span class="p">(</span>
    <span class="s">"crypto/tls"</span>
    <span class="s">"encoding/base64"</span>
    <span class="s">"fmt"</span>
    <span class="s">"log/slog"</span>
    <span class="s">"net"</span>
    <span class="s">"net/http"</span>
    <span class="s">"regexp"</span>
    <span class="s">"time"</span>

    <span class="s">"github.com/miekg/dns"</span>
<span class="p">)</span>

<span class="c">// extractECH extracts the ECH value from the input string using regular expressions.</span>
<span class="k">func</span> <span class="n">extractECH</span><span class="p">(</span><span class="n">input</span> <span class="kt">string</span><span class="p">)</span> <span class="p">(</span><span class="kt">string</span><span class="p">,</span> <span class="kt">error</span><span class="p">)</span> <span class="p">{</span>
    <span class="n">re</span> <span class="o">:=</span> <span class="n">regexp</span><span class="o">.</span><span class="n">MustCompile</span><span class="p">(</span><span class="s">`ech="([^"]+)"`</span><span class="p">)</span>
    <span class="n">matches</span> <span class="o">:=</span> <span class="n">re</span><span class="o">.</span><span class="n">FindStringSubmatch</span><span class="p">(</span><span class="n">input</span><span class="p">)</span>
    <span class="k">if</span> <span class="nb">len</span><span class="p">(</span><span class="n">matches</span><span class="p">)</span> <span class="o">&lt;</span> <span class="m">2</span> <span class="p">{</span>
        <span class="k">return</span> <span class="s">""</span><span class="p">,</span> <span class="n">fmt</span><span class="o">.</span><span class="n">Errorf</span><span class="p">(</span><span class="s">"ech value not found"</span><span class="p">)</span>
    <span class="p">}</span>
    <span class="k">return</span> <span class="n">matches</span><span class="p">[</span><span class="m">1</span><span class="p">],</span> <span class="no">nil</span>
<span class="p">}</span>

<span class="k">func</span> <span class="n">main</span><span class="p">()</span> <span class="p">{</span>
    <span class="n">domain</span> <span class="o">:=</span> <span class="s">"crypto.cloudflare.com"</span>
    <span class="n">req</span><span class="p">,</span> <span class="n">err</span> <span class="o">:=</span> <span class="n">http</span><span class="o">.</span><span class="n">NewRequest</span><span class="p">(</span>
        <span class="s">"GET"</span><span class="p">,</span>
        <span class="s">"https://"</span><span class="o">+</span><span class="n">domain</span><span class="p">,</span>
        <span class="no">nil</span><span class="p">,</span>
    <span class="p">)</span>
    <span class="k">if</span> <span class="n">err</span> <span class="o">!=</span> <span class="no">nil</span> <span class="p">{</span>
        <span class="n">fmt</span><span class="o">.</span><span class="n">Printf</span><span class="p">(</span><span class="s">"Error: %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">err</span><span class="p">)</span>
    <span class="p">}</span>

    <span class="n">config</span><span class="p">,</span> <span class="n">_</span> <span class="o">:=</span> <span class="n">dns</span><span class="o">.</span><span class="n">ClientConfigFromFile</span><span class="p">(</span><span class="s">"/etc/resolv.conf"</span><span class="p">)</span>
    <span class="n">c</span> <span class="o">:=</span> <span class="nb">new</span><span class="p">(</span><span class="n">dns</span><span class="o">.</span><span class="n">Client</span><span class="p">)</span>

    <span class="n">existsMsg</span> <span class="o">:=</span> <span class="nb">new</span><span class="p">(</span><span class="n">dns</span><span class="o">.</span><span class="n">Msg</span><span class="p">)</span>
    <span class="n">existsMsg</span><span class="o">.</span><span class="n">SetQuestion</span><span class="p">(</span><span class="n">dns</span><span class="o">.</span><span class="n">Fqdn</span><span class="p">(</span><span class="n">domain</span><span class="p">),</span> <span class="n">dns</span><span class="o">.</span><span class="n">TypeA</span><span class="p">)</span>
    <span class="n">existsMsg</span><span class="o">.</span><span class="n">RecursionDesired</span> <span class="o">=</span> <span class="no">true</span>

    <span class="n">_</span><span class="p">,</span> <span class="n">_</span><span class="p">,</span> <span class="n">err</span> <span class="o">=</span> <span class="n">c</span><span class="o">.</span><span class="n">Exchange</span><span class="p">(</span><span class="n">existsMsg</span><span class="p">,</span> <span class="n">net</span><span class="o">.</span><span class="n">JoinHostPort</span><span class="p">(</span><span class="n">config</span><span class="o">.</span><span class="n">Servers</span><span class="p">[</span><span class="m">0</span><span class="p">],</span> <span class="n">config</span><span class="o">.</span><span class="n">Port</span><span class="p">))</span>
    <span class="k">if</span> <span class="n">err</span> <span class="o">!=</span> <span class="no">nil</span> <span class="p">{</span>
        <span class="n">fmt</span><span class="o">.</span><span class="n">Printf</span><span class="p">(</span><span class="s">"Error: %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">err</span><span class="p">)</span>
    <span class="p">}</span>

    <span class="n">m</span> <span class="o">:=</span> <span class="nb">new</span><span class="p">(</span><span class="n">dns</span><span class="o">.</span><span class="n">Msg</span><span class="p">)</span>
    <span class="n">m</span><span class="o">.</span><span class="n">SetQuestion</span><span class="p">(</span><span class="n">dns</span><span class="o">.</span><span class="n">Fqdn</span><span class="p">(</span><span class="n">domain</span><span class="p">),</span> <span class="n">dns</span><span class="o">.</span><span class="n">TypeHTTPS</span><span class="p">)</span>
    <span class="n">m</span><span class="o">.</span><span class="n">RecursionDesired</span> <span class="o">=</span> <span class="no">true</span>

    <span class="k">var</span> <span class="n">echConfigListBytes</span> <span class="p">[]</span><span class="kt">byte</span>

    <span class="n">r</span><span class="p">,</span> <span class="n">_</span><span class="p">,</span> <span class="n">err</span> <span class="o">:=</span> <span class="n">c</span><span class="o">.</span><span class="n">Exchange</span><span class="p">(</span><span class="n">m</span><span class="p">,</span> <span class="n">net</span><span class="o">.</span><span class="n">JoinHostPort</span><span class="p">(</span><span class="n">config</span><span class="o">.</span><span class="n">Servers</span><span class="p">[</span><span class="m">0</span><span class="p">],</span> <span class="n">config</span><span class="o">.</span><span class="n">Port</span><span class="p">))</span>
    <span class="k">if</span> <span class="n">r</span> <span class="o">==</span> <span class="no">nil</span> <span class="p">{</span>
        <span class="n">slog</span><span class="o">.</span><span class="n">Warn</span><span class="p">(</span><span class="s">"DNS: error: %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">err</span><span class="o">.</span><span class="n">Error</span><span class="p">())</span>
    <span class="p">}</span> <span class="k">else</span> <span class="k">if</span> <span class="n">r</span><span class="o">.</span><span class="n">Rcode</span> <span class="o">!=</span> <span class="n">dns</span><span class="o">.</span><span class="n">RcodeSuccess</span> <span class="p">{</span>
        <span class="n">slog</span><span class="o">.</span><span class="n">Warn</span><span class="p">(</span><span class="s">"DNS: invalid answer name %s after MX query for %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">domain</span><span class="p">,</span> <span class="n">domain</span><span class="p">)</span>
    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
        <span class="k">for</span> <span class="n">_</span><span class="p">,</span> <span class="n">a</span> <span class="o">:=</span> <span class="k">range</span> <span class="n">r</span><span class="o">.</span><span class="n">Answer</span> <span class="p">{</span>
            <span class="k">if</span> <span class="n">a</span><span class="o">.</span><span class="n">Header</span><span class="p">()</span><span class="o">.</span><span class="n">Rrtype</span> <span class="o">==</span> <span class="n">dns</span><span class="o">.</span><span class="n">TypeHTTPS</span> <span class="p">{</span>
                <span class="n">echConfigListBase64</span><span class="p">,</span> <span class="n">err</span> <span class="o">:=</span> <span class="n">extractECH</span><span class="p">(</span><span class="n">a</span><span class="o">.</span><span class="n">String</span><span class="p">())</span>
                <span class="k">if</span> <span class="n">err</span> <span class="o">!=</span> <span class="no">nil</span> <span class="p">{</span>
                    <span class="n">slog</span><span class="o">.</span><span class="n">Debug</span><span class="p">(</span><span class="s">"Failed to extract ECH value"</span><span class="p">,</span> <span class="s">"err"</span><span class="p">,</span> <span class="n">err</span><span class="p">)</span>
                    <span class="k">break</span>
                <span class="p">}</span>

                <span class="n">slog</span><span class="o">.</span><span class="n">Debug</span><span class="p">(</span><span class="s">"ECH Value:"</span><span class="p">,</span> <span class="n">echConfigListBase64</span><span class="p">)</span>
                <span class="n">echConfigListBytes</span><span class="p">,</span> <span class="n">err</span> <span class="o">=</span> <span class="n">base64</span><span class="o">.</span><span class="n">StdEncoding</span><span class="o">.</span><span class="n">DecodeString</span><span class="p">(</span><span class="n">echConfigListBase64</span><span class="p">)</span>
                <span class="k">if</span> <span class="n">err</span> <span class="o">!=</span> <span class="no">nil</span> <span class="p">{</span>
                    <span class="n">slog</span><span class="o">.</span><span class="n">Error</span><span class="p">(</span><span class="s">"Failed to decode ECH config"</span><span class="p">,</span> <span class="s">"err"</span><span class="p">,</span> <span class="n">err</span><span class="p">)</span>
                    <span class="k">break</span>
                <span class="p">}</span>

                <span class="k">break</span>
            <span class="p">}</span>
        <span class="p">}</span>
    <span class="p">}</span>

    <span class="n">http</span><span class="o">.</span><span class="n">DefaultTransport</span><span class="o">.</span><span class="p">(</span><span class="o">*</span><span class="n">http</span><span class="o">.</span><span class="n">Transport</span><span class="p">)</span><span class="o">.</span><span class="n">TLSClientConfig</span> <span class="o">=</span> <span class="o">&amp;</span><span class="n">tls</span><span class="o">.</span><span class="n">Config</span><span class="p">{</span>
        <span class="n">EncryptedClientHelloConfigList</span><span class="o">:</span> <span class="n">echConfigListBytes</span><span class="p">,</span>
    <span class="p">}</span>

    <span class="n">resp</span><span class="p">,</span> <span class="n">err</span> <span class="o">:=</span> <span class="p">(</span><span class="o">&amp;</span><span class="n">http</span><span class="o">.</span><span class="n">Client</span><span class="p">{</span><span class="n">Timeout</span><span class="o">:</span> <span class="m">5</span> <span class="o">*</span> <span class="n">time</span><span class="o">.</span><span class="n">Second</span><span class="p">})</span><span class="o">.</span><span class="n">Do</span><span class="p">(</span><span class="n">req</span><span class="p">)</span>
    <span class="k">if</span> <span class="n">err</span> <span class="o">!=</span> <span class="no">nil</span> <span class="p">{</span>
        <span class="n">fmt</span><span class="o">.</span><span class="n">Printf</span><span class="p">(</span><span class="s">"Error: %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">err</span><span class="p">)</span>
    <span class="p">}</span>

    <span class="k">if</span> <span class="n">resp</span><span class="o">.</span><span class="n">TLS</span><span class="o">.</span><span class="n">ECHAccepted</span> <span class="p">{</span>
        <span class="n">fmt</span><span class="o">.</span><span class="n">Printf</span><span class="p">(</span><span class="s">"Domain %s supports ECH</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">domain</span><span class="p">)</span>
    <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
        <span class="n">fmt</span><span class="o">.</span><span class="n">Printf</span><span class="p">(</span><span class="s">"Domain %s does not support ECH</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">domain</span><span class="p">)</span>
    <span class="p">}</span>
<span class="p">}</span>
</code></pre></div></div>

<p>Wow, this got lengthy. Did it pay off? Let’s see:</p>

<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$ </span>go run main.go
Domain crypto.cloudflare.com supports ECH
</code></pre></div></div>

<p>Nice. Online privacy achieved. What’s next?</p>

<h2 id="kyber">Kyber</h2>

<p>The other big addition to <code class="language-plaintext highlighter-rouge">crypto/tls</code> this time around is the support for the first post-quantum key exchange curve: X25519Kyber768Draft00. This key exchange is used by default when no <code class="language-plaintext highlighter-rouge">CurvePreferences</code> are set and you can specify it explicitly if you want to force its use.</p>

<div class="language-go highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">const</span> <span class="p">(</span>
    <span class="n">x25519Kyber768Draft00</span> <span class="n">tls</span><span class="o">.</span><span class="n">CurveID</span> <span class="o">=</span> <span class="m">0x6399</span> <span class="c">// X25519Kyber768Draft00</span>
<span class="p">)</span>

<span class="n">http</span><span class="o">.</span><span class="n">DefaultTransport</span><span class="o">.</span><span class="p">(</span><span class="o">*</span><span class="n">http</span><span class="o">.</span><span class="n">Transport</span><span class="p">)</span><span class="o">.</span><span class="n">TLSClientConfig</span> <span class="o">=</span> <span class="o">&amp;</span><span class="n">tls</span><span class="o">.</span><span class="n">Config</span><span class="p">{</span>
    <span class="n">EncryptedClientHelloConfigList</span><span class="o">:</span> <span class="n">echConfigListBytes</span><span class="p">,</span>
    <span class="n">CurvePreferences</span><span class="o">:</span>               <span class="p">[]</span><span class="n">tls</span><span class="o">.</span><span class="n">CurveID</span><span class="p">{</span><span class="n">x25519Kyber768Draft00</span><span class="p">},</span>
<span class="p">}</span>
</code></pre></div></div>

<p>As you can see from the example above, the kyber curve is not exported from <code class="language-plaintext highlighter-rouge">crypto/tls</code> like the other curves, so we have to define it ourselves.</p>

<p>That’s good and all, but the only thing this gives us is the binary ability to see whether the server accepts the kyber curve or not — the request will simply fail with <code class="language-plaintext highlighter-rouge">remote error: tls: illegal parameter</code>. It would be super great if there was an actual way to determine the negotiated key exchange group, but unfortunately that’s behind an internal <code class="language-plaintext highlighter-rouge">tls.ConnectionState.testingOnlyCurveID</code>. For now, the best way to get this information is still to use Cloudflare’s Go fork.</p>

<p>Alright, coool, awesome, bingo, huzzah, this is all very exciting. I guess, if you take anything from this post, let it be that Go 1.23 is worth upgrading to (and not just because the version string is ordered in ascending order). In fact, it’s <a href="https://github.com/gitpod-io/workspace-images/pull/1403">already enabled</a> by default in any new Gitpod workspace based on gitpod-provided workspace images.</p>

<p>Thumnail is <a href="https://creativecommons.org/licenses/by/4.0/">CC BY 4.0</a> Renée French. I am very sorry for what I’ve done to the little gopher.</p>]]></content><author><name>filiptronicek</name></author><summary type="html"><![CDATA[Go 1.23 is out and it brings many new features. In the beginning of the release notes there’s a bunch to read about the range over function iterators functionality or the new unique, structs and iter packages, but given the fact I’m no go expert, I won’t go into any of those.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="/go1.23.jpg" /><media:content medium="image" url="/go1.23.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">I Was Developers</title><link href="/i-was-developers/" rel="alternate" type="text/html" title="I Was Developers" /><published>2024-07-21T00:00:00+00:00</published><updated>2024-07-21T00:00:00+00:00</updated><id>/i-was-developers</id><content type="html" xml:base="/i-was-developers/"><![CDATA[<p>Last week, I crossed a thing off my bucket list by attending a real developer-focused conference. Together with <a href="https://x.com/morning4coffe">@morning4coffe</a> I attended the WeAreDevelopers World Congress in Berlin. I must say, I had a blast, even when I was starving and sleep-deprived.</p>

<p>Here are some of the cool talks I really liked:</p>

<ul>
  <li><em>AI: Superhero or Supervillain? How and Why</em> by Scott Hanselman
    <ul>
      <li>It included an interesting thought about us already having the technology people imagined in movies from the 90s, but we just decided not to use it because it’s uncanny.</li>
    </ul>
  </li>
  <li><em>Fireside Chat with Kris Rasmussen, CTO at Figma</em></li>
  <li><em>The Future of Open Source</em> by Scott Chacon
    <ul>
      <li>The talk went in depth about the rules of calling something a marmalade in Germany while pointing out the similarities to the question of what actually constitutes an “open-source” project and explaining the reasons behind choosing the <a href="https://fsl.software/">Functional Source License</a> for GitButler<sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">1</a></sup></li>
      <li>Scott also mentioned that GitButler takes part in something called the OSS Pledge, which makes participating companies contribute money to open-source projects depending on the amount of engineers they have. This is another super cool idea, IMO.</li>
    </ul>
  </li>
  <li><em>JSON and beyond</em> by its inventor, Douglas Crockford
    <ul>
      <li>JSON always needs to stay as a subset of JavaScript, it’s one of its core principles</li>
      <li><code class="language-plaintext highlighter-rouge">null</code> in JS is a mistake. It is also a mistake that it’s not included in JSON</li>
      <li>YAML was designed purposefully so that it’s a direct superset of JSON, and JSON was tweaked to be a subset of YAML</li>
      <li>There are no comments in JSON because it was originally designed to be a data exchange format</li>
      <li>Douglas also mentioned his new(er) data exchange format, dubbed Nota<sup id="fnref:2"><a href="#fn:2" class="footnote" rel="footnote" role="doc-noteref">2</a></sup></li>
    </ul>
  </li>
</ul>

<p>One final thought that came to me on my way back from the conference: if the before of something great is shitty and the after of something great is shitty, it’s still worth it. Sometimes, you know what parts will be shitty beforehand, and sometimes you don’t. But, at the end of the day, there’s probably going to be something you will at least remember from it all (and if it’s a conference, you might make some new friends and get some new swag along the way).</p>

<p><img src="/img/json-and-beyond.avif" alt="Douglas Crockford presenting his talk with &quot;And finally, one piece of advice: Don't make bugs&quot; written behind him" /></p>

<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:1">
      <p>FWIW, GitButler seems incredibly cool, and having chatted to their CTO <a href="https://github.com/krlvi">@krlvi</a> about it, I have to try it out. <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:2">
      <p>Nota allegedly got its name from the “notation” part of JavaScript Object Notation, because that is the only actually meaningful part of the original JSON name, according to Crockford. <a href="#fnref:2" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name>filiptronicek</name></author><summary type="html"><![CDATA[Last week, I crossed a thing off my bucket list by attending a real developer-focused conference. Together with @morning4coffe I attended the WeAreDevelopers World Congress in Berlin. I must say, I had a blast, even when I was starving and sleep-deprived.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="/i-was-developers.jpg" /><media:content medium="image" url="/i-was-developers.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Kyber kexes</title><link href="/kyber-kexes/" rel="alternate" type="text/html" title="Kyber kexes" /><published>2024-06-29T00:00:00+00:00</published><updated>2024-06-29T00:00:00+00:00</updated><id>/kyber-kexes</id><content type="html" xml:base="/kyber-kexes/"><![CDATA[<p>It’s been a while since we last took a look at the two new promising technologies on the web - post-quantum key exchange with Kyber<sup id="fnref:1"><a href="#fn:1" class="footnote" rel="footnote" role="doc-noteref">1</a></sup> and <abbr title="Encrypted Client Hello">ECH</abbr>, so it makes sense to revisit them and see what’s up.</p>

<h2 id="kyber">Kyber</h2>

<p>For securing our modern internet traffic against <a href="https://en.wikipedia.org/wiki/Harvest_now,_decrypt_later">Harvest now/Decrypt later</a> attacks, we have seen quite nice adoption of X25519Kyber512Draft00 and X25519Kyber768Draft00 globally. Thanks to increased support with recent additions to tools like <a href="https://x.com/bwesterb/status/1748017372764475519">Firefox</a> or <a href="https://docs.rs/rustls-post-quantum/latest/rustls_post_quantum/">rustls</a> and Chrome 124 enabling Kyber by default, much of the world’s internet traffic is now secure against quantum adversaries. According to <a href="https://radar.cloudflare.com/adoption-and-usage?dateRange=52w">Cloudflare Radar</a>, Kyber is now used in 17.6% of connections going through Cloudflare’s network, which is only expected to increase<sup id="fnref:2"><a href="#fn:2" class="footnote" rel="footnote" role="doc-noteref">2</a></sup>. The big puzzle piece missing here is support in Safari, which is responsible for about 15% of the web traffic.</p>

<p>Of course, this is mostly thanks to most of the most-visited websites either being operated by Google or proxied by Cloudflare. For independently operated websites and services, even if hosted on public clouds, the key to adoption is inclusion in proxy software like Nginx, Apache, or Caddy<sup id="fnref:3"><a href="#fn:3" class="footnote" rel="footnote" role="doc-noteref">3</a></sup>, as well as people simply updating their browsers.</p>

<h2 id="ech">ECH</h2>

<p>Unfortunately, despite being around since all the way in 2018 (then known as <abbr title="Encrypted server name indication">ESNI</abbr>) and hence being a lot older than Kyber, ECH is still not really used anywhere. Since last October, Cloudflare <a href="/cloudflare-disabled-ech/">has disabled</a> ECH on all of their customers’ websites for “reasons”. Although both Chrome and Firefox support the technology and are very happy to utilize it (we even <a href="https://github.com/golang/go/issues/63369">got support</a> for it in Go), the only place you will bump into it is on testing websites like <a href="https://defo.ie/ech-check.php">defo.ie</a> or Cloudflare’s <a href="https://encryptedsni.com">encryptedsni.com</a>. If this ever changes, you can be sure to read about it here, because I personally believe this to be one of the most interesting and important developments in TLS in the last decade.</p>

<h2 id="additional-tidbits">Additional tidbits</h2>

<ul>
  <li>If you operate a website and would like to check its support for Kyber and ECH, you can use the <a href="https://github.com/filiptronicek/ech-check">ech-check</a> CLI tool I wrote for this purpose.</li>
  <li>A very nice report on how things are going in the <abbr title="Post-quantum cryptography">PQC</abbr> world is Bas Westerbaan’s piece <a href="https://blog.cloudflare.com/pq-2024">The state of the post-quantum Internet</a></li>
</ul>

<p>Thanks for sticking around; see ya next time!</p>

<h2 id="footnotes">Footnotes</h2>

<div class="footnotes" role="doc-endnotes">
  <ol>
    <li id="fn:1">
      <p>Since <a href="/hello-internet">last time</a>, Kyber has been renamed to <a href="https://csrc.nist.gov/pubs/fips/203/ipd">ML-KEM</a>, but for the purposes of this post, I will keep calling it Kyber, because both of its derived key exchanges use that name. <a href="#fnref:1" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:2">
      <p>This number gets even more impressive when you take into account that when part one of this series was published, Kyber was only used in 0.2% of connections. <a href="#fnref:2" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
    <li id="fn:3">
      <p>If you want to try Caddy or nginx with Kyber today, there are guides provided for both: <a href="https://gist.github.com/bwesterb/2f7bfa7ae689de0d242b56ea3ecac424">Caddy</a> and <a href="https://blog.centminmod.com/2023/10/03/2860/how-to-enable-cloudflare-post-quantum-x25519kyber768-key-exchange-support-in-centmin-mod-nginx/">nginx</a>. <a href="#fnref:3" class="reversefootnote" role="doc-backlink">&#8617;</a></p>
    </li>
  </ol>
</div>]]></content><author><name>filiptronicek</name></author><summary type="html"><![CDATA[It’s been a while since we last took a look at the two new promising technologies on the web - post-quantum key exchange with Kyber1 and ECH, so it makes sense to revisit them and see what’s up. Since last time, Kyber has been renamed to ML-KEM, but for the purposes of this post, I will keep calling it Kyber, because both of its derived key exchanges use that name. &#8617;]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="/ciphertrails_3.png" /><media:content medium="image" url="/ciphertrails_3.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Graduating from high school</title><link href="/high-school-graduation/" rel="alternate" type="text/html" title="Graduating from high school" /><published>2024-05-25T00:00:00+00:00</published><updated>2024-05-25T00:00:00+00:00</updated><id>/high-school-graduation</id><content type="html" xml:base="/high-school-graduation/"><![CDATA[<p>On May 21st, I graduated from high school, and as per some of my friends and relatives, I finally became an “adult”. I could imagine doing something more productive in two and a half weeks than just learning geography trivia, but I can finally rest easy knowing that I will most likely never have to do that ever again.</p>

<p>For those wondering, for Czech literature, I drew a question about Boule de Suif by Guy de Maupassant, and for geography, I talked about the geographical and socio-economical features of the region of North Africa and Southwestern Asia. The topic for English is probably not even worth mentioning, considering it was among the most straight-forward ones (it was food).</p>

<p>I did not do much on the coding front this month, but there are a few highlights I can share:</p>

<ul>
  <li>The project I described in my graduation paper from ICT, seminare, was open-sourced. You can read more about it in its dedicated <a href="/seminare">blog post</a>.</li>
  <li>open-vsx.org’s <a href="https://github.com/open-vsx/publish-extensions/">publish-extensions repo</a> got proper target platform support for building different flavors of extensions for different architectures and OSes.</li>
  <li>The <a href="https://open-vsx.org/extension/sswg/swift-lang">Swift extension</a> was published to open-vsx.org!</li>
</ul>

<p>Now, to address the elephant in the room: what will I do after high school? To be honest, not much will change. I am staying at Gitpod, building the future of development™, where I’ll get to spend considerably more time than I used to. It’s an exciting time to be alive :).</p>

<p>With that, I’ve said all I wanted to. See you later, folks!</p>]]></content><author><name>filiptronicek</name></author><summary type="html"><![CDATA[On May 21st, I graduated from high school, and as per some of my friends and relatives, I finally became an “adult”. I could imagine doing something more productive in two and a half weeks than just learning geography trivia, but I can finally rest easy knowing that I will most likely never have to do that ever again.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="/graduation.jpg" /><media:content medium="image" url="/graduation.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Semináře</title><link href="/seminare/" rel="alternate" type="text/html" title="Semináře" /><published>2024-05-25T00:00:00+00:00</published><updated>2024-05-25T00:00:00+00:00</updated><id>/seminare</id><content type="html" xml:base="/seminare/"><![CDATA[<p>When <a href="/high-school-graduation">graduating</a> earlier this week, I had to defend my thesis, which aimed to discuss the tools I used while developing a registration system for students of my high school, which can be used to sign up to various types of events that are made available to the students throughout the year.</p>

<h2 id="why-not-just-use-google-forms-for-signups">Why not just use Google Forms for signups?</h2>

<p>It’s true that solutions like Google Forms provide a very simple and elegant solution to many requirements educational institutions have, for instance, easy user management (since they most likely already are on Google Workspace) or ease-of-use for the teachers taking care of organizing the events. The problems arise when you want to have anything dynamic in your form, which our school encountered in multiple ways. Firstly, none of the aforementioned solutions allow you to have proper “capacity” fields on options, which would let certain options (like an arts project at a “Project week”) be exhausted after a certain amount of users join them. There are ways to work around this, like <a href="https://workspace.google.com/marketplace/app/choice_eliminator_for_google_forms_choic/451642192898">Choice Eliminator for Google Forms</a>, but setting it up is not straight-forward. Another issue we encountered is selection logic: it is very nice if you can limit some events to only some classes and/or have custom logic for allowing or disallowing certain combinations of options.</p>

<p>This took me a year to build, but we had our first successful test of the app in April and are planning to have all events managed and organized through it going forward.</p>

<p>If you like reading and are fine with Czech, feel free to <a href="/static/MMP%20-%20Maturitni%CC%81%20pra%CC%81ce.pdf">read the thesis through</a>, but if you prefer the code, visit the <a href="https://github.com/filiptronicek/seminare">repo</a>.</p>]]></content><author><name>filiptronicek</name></author><summary type="html"><![CDATA[When graduating earlier this week, I had to defend my thesis, which aimed to discuss the tools I used while developing a registration system for students of my high school, which can be used to sign up to various types of events that are made available to the students throughout the year.]]></summary></entry></feed>