<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mathieu Kerjouan</title>
    <description>The latest articles on DEV Community by Mathieu Kerjouan (@niamtokik).</description>
    <link>https://dev.to/niamtokik</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1302415%2Ff02d4ee9-14d9-45ec-966a-6bb53e0e3240.jpeg</url>
      <title>DEV Community: Mathieu Kerjouan</title>
      <link>https://dev.to/niamtokik</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/niamtokik"/>
    <language>en</language>
    <item>
      <title>WeeklyReview#202647</title>
      <dc:creator>Mathieu Kerjouan</dc:creator>
      <pubDate>Mon, 23 Nov 2026 10:00:00 +0000</pubDate>
      <link>https://dev.to/niamtokik/weeklyreview202647-65a</link>
      <guid>https://dev.to/niamtokik/weeklyreview202647-65a</guid>
      <description>&lt;p&gt;Finally, &lt;a href="https://phrack.org/issues/73/introduction" rel="noopener noreferrer"&gt;&lt;strong&gt;Phrack#73&lt;/strong&gt;&lt;/a&gt; is out, some articles are also available in &lt;a href="https://archives.phrack.org/dl/73/" rel="noopener noreferrer"&gt;PDF&lt;/a&gt;, don't hesitate to check them. In short, my week will be dedicated to read this new issue... And that's a good thing!&lt;/p&gt;




&lt;p&gt;While reading the &lt;a href="https://man.openbsd.org/select" rel="noopener noreferrer"&gt;&lt;code&gt;select(2)&lt;/code&gt;&lt;/a&gt; man page, I discovered it could be used as a kind of timer function. I wanted to use this function instead of &lt;a href="https://man.openbsd.org/poll" rel="noopener noreferrer"&gt;&lt;code&gt;poll(2)&lt;/code&gt;&lt;/a&gt; in &lt;code&gt;chored&lt;/code&gt;, but it has a lot of limitations I don't really like. So, instead, let have some fun with a quick and dirty timer in pure C.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight c"&gt;&lt;code&gt;&lt;span class="cp"&gt;#include &amp;lt;stdio.h&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;#include &amp;lt;stdlib.h&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;#include &amp;lt;unistd.h&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;#include &amp;lt;ctype.h&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;#include &amp;lt;string.h&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;#include &amp;lt;sys/select.h&amp;gt;&lt;/span&gt;
&lt;span class="cp"&gt;#include &amp;lt;sys/time.h&amp;gt;&lt;/span&gt;

&lt;span class="kt"&gt;int32_t&lt;/span&gt; &lt;span class="nf"&gt;isstrdigit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;size_t&lt;/span&gt; &lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int32_t&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;len&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s1"&gt;'\0'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nf"&gt;isdigit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kt"&gt;int32_t&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;argc&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;char&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;argc&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
    &lt;span class="nb"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Usage: %s timeout\n"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;argc&lt;/span&gt;&lt;span class="o"&gt;!=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"Usage: %s timeout\n"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nf"&gt;isstrdigit&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;strlen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"error: '%s' not a positive integer\n"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="kt"&gt;uint64_t&lt;/span&gt; &lt;span class="n"&gt;buf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;atol&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;buf&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"error: '%s' not a positive integer\n"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;buf&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="mi"&gt;4294967295&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"error: '%s' greater than 4294967295\n"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;argv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="kt"&gt;uint32_t&lt;/span&gt; &lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;limit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;uint32_t&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="n"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="nf"&gt;timeval&lt;/span&gt; &lt;span class="n"&gt;timeout&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tv_sec&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tv_usec&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="nf"&gt;timeval&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="nf"&gt;timezone&lt;/span&gt; &lt;span class="n"&gt;tz&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="kt"&gt;uint32_t&lt;/span&gt; &lt;span class="n"&gt;deviation&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kt"&gt;uint32_t&lt;/span&gt; &lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;while&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nf"&gt;select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="o"&gt;+=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;deviation&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tv_usec&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nf"&gt;gettimeofday&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;tz&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;deviation&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;deviation&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tv_usec&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nb"&gt;printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"%d - %lld %ld (%d)\n"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;counter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tv_sec&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;now&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tv_usec&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;deviation&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;counter&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;$ cc timer.c -o timer
$ ./timer 3
1 - 1794943344 475733 &lt;span class="o"&gt;(&lt;/span&gt;-475733&lt;span class="o"&gt;)&lt;/span&gt;
2 - 1794943345 485529 &lt;span class="o"&gt;(&lt;/span&gt;-9796&lt;span class="o"&gt;)&lt;/span&gt;
3 - 1794943346 495707 &lt;span class="o"&gt;(&lt;/span&gt;-10178&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I started to write a post on that few months ago, but it was not a critical topic to me. Perhaps it will be published one day?&lt;/p&gt;




&lt;p&gt;The market is kinda complicated right now. Clients are pretty rare and it's becoming really hard to find few of them interested in my competencies and experience. It's perhaps a bit normal though, during the past decades, the IT only produced scamware, and most of the IT guys are living in their own fantasy world. It's not even sure they talked to someone real to see how they are out of the reality.&lt;/p&gt;

&lt;p&gt;The blockchain technology is a good example. By itself, the algorithm and the methodology used to synchronize data in a distributed system is really nice, and it can solve many problems, on the other hand, it has been used to create crypto-currencies, the scam generator machine. Bitcoin became active in 2008, the first time I heard of it was in 2011. Since then, every year is the "adoption year", and every year, it's not the case. On this topic, I share &lt;a href="https://www.youtube.com/watch?v=FnKrMKo_WlU" rel="noopener noreferrer"&gt;McAfee's point of view&lt;/a&gt;. Bitcoin was a PoC to demonstrate how a blockchain works, but it was used to create values. After that, Ethereum and many others follow the way, but in fine, nothing was really produced. Few became millionaires, many more became poor. Now the bitcoin is going down, more and more people are saying this is a scam. Crazy, right? The only true winners in this story are the exchange and the financial worlds.&lt;/p&gt;

&lt;p&gt;Another example is the LLM/AI. Those systems are existing for a really long time, and they were called "expert systems" in the 70s and 80s. When learning Prolog, or LISP, this term can be read many times. The only difference was the hardware limitations of the era, and the fact only a minority of people were allowed to use them. Today, the world is different, and instead of treating LLMs like any software, few entities are currently making them private. The recent story with NVIDIA CEO (Huang Jensen) was interesting. Indeed, someone like him fired from his own company is odd, even more when you read the benefices produced by the company during the last months. Anyway, like for the crypto-currencies, LLMs are a huge scam-machine, mostly used because all companies are forcing the adoption of this technology. The average citizen really don't care about it, and in most of the case are still using the good old way to search data. They are using it - sometimes - to produce some documents.&lt;/p&gt;

&lt;p&gt;What's the result of that? To me, it's a lot of money being burned, and a lot of these investments are from leverage. It means if something goes wrong, financial companies and banks will be impacted as well. These two examples are not the only ones to explain the current situation. Many financial bubbles are also at play, and with the conflicts in Ukraine/Russia, and Iran, the price of life increased everywhere. Companies don't have enough money anymore to recruit, and if you are living in a communist/socialist-like country (e.g. European Union), the companies are slowly dying due to the taxes.&lt;/p&gt;

&lt;p&gt;To be honest, it reminds me 2007/2008. It was so hard to find a job at this time, and because I was a junior it was even harder. In fine, things will probably change. crypto-currencies and LLMs are trends. Opportunities will come after those trends will die.&lt;/p&gt;




&lt;h1&gt;
  
  
  Coding
&lt;/h1&gt;

&lt;p&gt;📝 &lt;a href="https://theconsensus.dev/p/2026/11/08/c-memory-management-survey.html" rel="noopener noreferrer"&gt;&lt;strong&gt;Memory management in 40 major C projects, a survey&lt;/strong&gt;&lt;/a&gt;: an interesting post studying the memory management of different projects, including sqlite and erlang.&lt;/p&gt;

&lt;p&gt;📑 &lt;a href="https://pdos.csail.mit.edu/6.828/2018/readings/pointers.pdf" rel="noopener noreferrer"&gt;&lt;strong&gt;A TUTORIAL ON POINTERS AND ARRAYS IN C&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://allan-blanchard.fr/publis/frama-c-wp-tutorial-en.pdf" rel="noopener noreferrer"&gt;&lt;strong&gt;Introduction to C program proof with Frama-C and its WP plugin&lt;/strong&gt;&lt;/a&gt;: got some issues to understand pointers? well, this publication can probably help you.&lt;/p&gt;

&lt;p&gt;🏗️ &lt;a href="https://github.com/suman1406/frama-c_codes" rel="noopener noreferrer"&gt;&lt;strong&gt;Frama-C Codes&lt;/strong&gt;&lt;/a&gt;: code examples and exercises for learning and practicing Frama-C.&lt;/p&gt;

&lt;p&gt;📑 &lt;a href="https://worrydream.com/refs/Brooks_1986_-_No_Silver_Bullet.pdf" rel="noopener noreferrer"&gt;&lt;strong&gt;No Silver Bullet — Essence and Accident in Software Engineering&lt;/strong&gt;&lt;/a&gt;: a publication from 1986 explaining the complexity of software development. The part on AI and expert system is really interesting, the assumptions made by the authors reflect what we can see nowadays. Here few quotes.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;the very nature of software makes it unlikely that there will be any−no inventions that will do for software productivity, reliability, and simplicity what electronics, transistors, and large-scale integration did for computer hardware. We cannot expect ever to see twofold gains every two years.&lt;/p&gt;

&lt;p&gt;The complexity of software is in essential property, not an accidental one.&lt;/p&gt;

&lt;p&gt;Much of the complexity the software engineer must master is arbitrary complexity, forced without rhyme or reason by the many human institutions and systems to which his interfaces must confirm.&lt;/p&gt;

&lt;p&gt;The reality of software is not inherently embedded in space.&lt;/p&gt;

&lt;p&gt;at some point the elaboration of a high-level language becomes a burden that increases, not reduces, the intellectual task of the user who rarely uses the esoteric constructs.&lt;/p&gt;

&lt;p&gt;The hard thing about building software is &lt;strong&gt;deciding what to say, not saying it&lt;/strong&gt;. No facilitation of expression can give more than marginal gains.&lt;/p&gt;

&lt;p&gt;The most powerful contribution of expert systems will surely be to put at the service of the inexperienced programmer the experience and accumulated wisdom of the best programmers. This is no small contribution. The gap between the best software engineering practice and the average practice is very wide−perhaps wider than in any other engineering discipline. A tool that disseminates good practice would be important.&lt;/p&gt;

&lt;p&gt;The hardest part of the software task is &lt;strong&gt;arriving at a complete and consistent specification&lt;/strong&gt;, and much of the essence of building a program is in fact the debugging of the specification.&lt;/p&gt;

&lt;p&gt;The cost of software has always been development cost, not replication cost.&lt;/p&gt;

&lt;p&gt;The hardest single part of building a software system is deciding precisely what to build [...] For the truth is, the clients do not know what they want [...] Prototypes typically perform the mainline tasks of the application, but make no attempt to handle the exceptions, respond correctly to invalid inputs, abort cleanly, etc. The purpose of the prototype is to make real the conceptual structure specified.&lt;/p&gt;

&lt;p&gt;Good managers, scarce though they be, are no scarcer than good designers. Great designers and great managers are both very rare. [...] each software organization must determine and proclaim that&lt;br&gt;
great designers are as important to its success as great managers are, and that they can be expected to be similarly nurtured and rewarded.&lt;/p&gt;

&lt;p&gt;How to grow great designers? &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Systematically identify top designers as early as possible.&lt;/li&gt;
&lt;li&gt;Assign a career mentor to be responsible for the development of the prospect&lt;/li&gt;
&lt;li&gt;Devise and maintain a career development plan for each prospect
Provide opportunities for growing designers to interact with and stimulate each other.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;

&lt;p&gt;📝 &lt;a href="https://v12.sh/blog/x86-formal-verification-memrchr" rel="noopener noreferrer"&gt;&lt;strong&gt;The One and Only Bug in glibc memrchr?&lt;/strong&gt;&lt;/a&gt;: a publication on formal verification.&lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://www.phatcode.net/res/223/files/html/toc.html" rel="noopener noreferrer"&gt;&lt;strong&gt;The Art of ASSEMBLY LANGUAGE PROGRAMMING&lt;/strong&gt;&lt;/a&gt;: a full book on the art of assembly programming, can be interesting if you are doing optimization or simply wants to understand how CPUs work.&lt;/p&gt;

&lt;h1&gt;
  
  
  Testing
&lt;/h1&gt;

&lt;p&gt;📑 &lt;a href="https://www.researchgate.net/profile/Michael-Karlesky/publication/228711578_Mocking_the_embedded_world_Test-driven_development_continuous_integration_and_design_patterns/links/5512b1c80cf20bfdad51c6b4/Mocking-the-embedded-world-Test-driven-development-continuous-integration-and-design-patterns.pdf" rel="noopener noreferrer"&gt;&lt;strong&gt;Mocking the Embedded World: Test-Driven Development, Continuous Integration, and Design Patterns&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📑 &lt;a href="https://repositories.lib.utexas.edu/server/api/core/bitstreams/15c1b39f-b0bf-43ad-ac70-7487a1d8b401/content" rel="noopener noreferrer"&gt;&lt;strong&gt;Mocking Embedded Hardware for Software Validation&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📑 &lt;a href="https://harvest.usask.ca/server/api/core/bitstreams/e7f8ac54-3762-4cdf-b7a0-bf47591e2eeb/content" rel="noopener noreferrer"&gt;&lt;strong&gt;Test Mocking in Practice: Developer Challenges and the Impact on Software Maintainability&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📑 &lt;a href="https://www.sback.it/publications/msr2017b.pdf" rel="noopener noreferrer"&gt;&lt;strong&gt;To Mock or Not To Mock? An Empirical Study on Mocking Practices&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📑 &lt;a href="https://joukestoel.github.io/papers/modeling-with-mocking-icst21.pdf" rel="noopener noreferrer"&gt;&lt;strong&gt;Modeling with Mocking&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  System
&lt;/h1&gt;

&lt;p&gt;📝 &lt;a href="https://blog.infected.systems/posts/2026-11-03-i-deleted-all-my-ssh-keys/" rel="noopener noreferrer"&gt;&lt;strong&gt;I deleted all my SSH keys&lt;/strong&gt;&lt;/a&gt;: in short, how to use yubikey with ssh.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://s2.dev/blog/dns-server" rel="noopener noreferrer"&gt;&lt;strong&gt;It’s always DNS, so why are we running our own?&lt;/strong&gt;&lt;/a&gt;: yeah, DNS is complicated and dangerous. One bad configuration and all your domains can be seen by anyone, or, even worse, anyone can push their domains on your server. Welcome in sysadmin world.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://techhut.tv/kubernetes-homelab-k3s-cluster" rel="noopener noreferrer"&gt;&lt;strong&gt;Kubernetes in the Homelab: Setting Up a k3s Cluster on Real Hardware&lt;/strong&gt;&lt;/a&gt;: a tuto to deploy k3s.&lt;/p&gt;

&lt;p&gt;🌐 &lt;a href="https://diveintosystems.org/" rel="noopener noreferrer"&gt;&lt;strong&gt;Dive into Systems&lt;/strong&gt;&lt;/a&gt;: a website teaching computer systems design.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://multikernel.io/2026/11/20/96-cores-launch-fewer-containers-than-48/" rel="noopener noreferrer"&gt;&lt;strong&gt;96 Cores Launch Fewer Containers Than 48&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Database
&lt;/h1&gt;

&lt;p&gt;📝 &lt;a href="https://theconsensus.dev/p/2026/09/13/query-plan-rewriting-in-postgresql.html?focus=1" rel="noopener noreferrer"&gt;&lt;strong&gt;Query plan rewriting in PostgreSQL&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Networking
&lt;/h1&gt;

&lt;p&gt;📝 &lt;a href="https://www.phoronix.com/news/3mdeb-2026-Firmware-APU2" rel="noopener noreferrer"&gt;&lt;strong&gt;3mdeb Updates The Open-Source Firmware For Aging AMD Jaguar Powered PC Engines APU2&lt;/strong&gt;&lt;/a&gt;: see also &lt;a href="https://blog.3mdeb.com/2026/2026-11-18-pcengines_apu2_v26.09.00.01_release/" rel="noopener noreferrer"&gt;Dasharo (coreboot+SeaBIOS) for PC Engines apu2 Release v26.09.00.01&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Hardware
&lt;/h1&gt;

&lt;p&gt;🏗️ &lt;a href="https://github.com/zagitta/gpu-unlock" rel="noopener noreferrer"&gt;&lt;strong&gt;gpu-unlock&lt;/strong&gt;&lt;/a&gt;: Your GeForce runs AI at half speed. This fixes it for 20/30/40 series cards. Up to 2× FP16 / BF16 / TF32 tensor throughput&lt;/p&gt;

&lt;h1&gt;
  
  
  Security
&lt;/h1&gt;

&lt;p&gt;📝 &lt;a href="https://shkspr.mobi/blog/2023/02/never-use-a-url-shortening-service-even-if-you-own-it/" rel="noopener noreferrer"&gt;&lt;strong&gt;Never use a URL shortening service - even if you own it&lt;/strong&gt;&lt;/a&gt;: an interesting article on why url shortening is bad and should not be used. In fact, the problem is even deeper than that. Any links can be impacted when a domain name is removed. Anyway, another article on this topic: &lt;a href="https://www.w3.org/Provider/Style/URI" rel="noopener noreferrer"&gt;Cool URIs don't change&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;🏗️ &lt;a href="https://github.com/V4bel/NoisyTCP" rel="noopener noreferrer"&gt;&lt;strong&gt;NoisyTCP: Linux Kernel TCP Pre-auth Remote Corruption (CVE-2026-99288)&lt;/strong&gt;&lt;/a&gt;: a description of a vulnerability impacting the Linux TCP stack.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://photon.codes/blog/we-found-a-ticking-time-bomb-in-macos-tcp-networking" rel="noopener noreferrer"&gt;&lt;strong&gt;We Found a Ticking Time Bomb in macOS TCP Networking - It Detonates After Exactly 49 Days&lt;/strong&gt;&lt;/a&gt;: this bug is interesting. In one of my previous position, the MacOS servers were acting weirdly after a moment (network instabilities). It could be related to this.&lt;/p&gt;

&lt;p&gt;🌐 &lt;a href="https://ratemyvuln.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;Rate My Vuln&lt;/strong&gt;&lt;/a&gt;: Which vulnerability is more dangerous? Hover any diamond petal, label, or metric badge to see how Spine Length × Kite Width shapes each threat.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://blog.qualys.com/product-tech/2026/11/16/identity-technical-debt-hidden-costs-and-fixes" rel="noopener noreferrer"&gt;&lt;strong&gt;The Hidden Cost of Identity Technical Debt&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://blog.nviso.eu/2026/11/12/breaking-the-semantic-cache-a-litellm-case-study-cve-2026-89032/" rel="noopener noreferrer"&gt;&lt;strong&gt;Breaking the Semantic Cache: A LiteLLM Case Study (CVE-2026-89032)&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://depthfirst.com/research/narrow-grants-wide-engines" rel="noopener noreferrer"&gt;&lt;strong&gt;Narrow Grants, Wide Engines: Reaching Native Database Attack Surface from Minimal SQL Roles&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🏗️ &lt;a href="https://github.com/01NGVI-QINGYI/ARIA-X" rel="noopener noreferrer"&gt;&lt;strong&gt;ARIA-X&lt;/strong&gt;&lt;/a&gt;: Local-first state-space reasoning engine for security research. Fuses ARTEX, Cairn &amp;amp; PentAGI. Python, zero dependencies.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://hackers-arise.com/java4shell-cve-2026-114938-critical-openjdk-rce-in-base64-decoding/" rel="noopener noreferrer"&gt;&lt;strong&gt;Java4Shell (CVE-2026-114938): Critical OpenJDK RCE in Base64 Decoding&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Embedded
&lt;/h1&gt;

&lt;p&gt;📝 &lt;a href="https://hackers-arise.com/building-your-own-humanoid-asimov-1-an-open-source-humanoid-robot/" rel="noopener noreferrer"&gt;&lt;strong&gt;Building Your Own Humanoid: Asimov 1 – An Open-Source Humanoid Robot&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📟 &lt;a href="https://www.kickstarter.com/projects/flipper-devices/flipper-one" rel="noopener noreferrer"&gt;&lt;strong&gt;Flipper One — Open Linux Multi-tool&lt;/strong&gt;&lt;/a&gt;: very expensive, but very cool. It would have been even better if the main CPU was using RISC-V.&lt;/p&gt;

&lt;h1&gt;
  
  
  Update/Upgrade
&lt;/h1&gt;

&lt;p&gt;🔄 &lt;a href="https://www.freebsd.org/security/advisories/" rel="noopener noreferrer"&gt;FreeBSD Security Advisories&lt;/a&gt;: 21 vulnerabilities, most of them are critical and impacts the whole system, leading to privilege escalation (at worse) or DoS (at best).&lt;/p&gt;

&lt;h1&gt;
  
  
  Leaks of the Week
&lt;/h1&gt;

&lt;p&gt;📝 &lt;a href="https://frenchbreaches.com/blog/optical-center-afflelou-krys-et-optic-2000-cites-dans-une-fuite-de-plus-de-4-millions-de-commandes" rel="noopener noreferrer"&gt;&lt;strong&gt;Opsysweb&lt;/strong&gt;&lt;/a&gt;: 18.3GB of data, 4.3 millions orders leaked.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://securityaffairs.com/203062/cyber-crime/extortion-group-claims-theft-of-nearly-one-billion-expedia-traveler-records.html" rel="noopener noreferrer"&gt;&lt;strong&gt;Expedia&lt;/strong&gt;&lt;/a&gt;: 1 billion records leaked. &lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://frenchbreaches.com/alertes/arte-tv-fuite-donnees-membres-inscrits-emails-comptes-mwci00v7k0eq5jt966i" rel="noopener noreferrer"&gt;&lt;strong&gt;Arte&lt;/strong&gt;&lt;/a&gt;: 673000 records leaked, including names, phone numbers and e-mails.&lt;/p&gt;

&lt;p&gt;🐦 &lt;a href="https://x.com/DarkWebInformer/status/2121407489933795460" rel="noopener noreferrer"&gt;&lt;strong&gt;Careers360&lt;/strong&gt;&lt;/a&gt;: 22.6 millions records leaked with more than 3 millions unique e-mail addresses.&lt;/p&gt;

&lt;p&gt;🐦 &lt;a href="https://x.com/DarkWebInformer/status/2121027997494857990" rel="noopener noreferrer"&gt;&lt;strong&gt;Columbia National Health&lt;/strong&gt;&lt;/a&gt;: 5.2 millions records leaked.&lt;/p&gt;

&lt;h1&gt;
  
  
  Misc
&lt;/h1&gt;

&lt;p&gt;📖 &lt;a href="https://arxiv.org/abs/2605.29713" rel="noopener noreferrer"&gt;&lt;strong&gt;The Little Book of Generative AI Foundations: An Intuitive Mathematical Primer&lt;/strong&gt;&lt;/a&gt;: This book provides a compact, derivation-oriented introduction to the mathematical foundations of modern generative artificial intelligence.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://tufalabs.ai/research/tufazip/" rel="noopener noreferrer"&gt;&lt;strong&gt;tufazip: Learning to Compress a Billion Bytes of Wikipedia&lt;/strong&gt;&lt;/a&gt;: when someone creates Pied Piper in real life.&lt;/p&gt;

&lt;p&gt;🏗️ &lt;a href="https://github.com/VectifyAI/PageIndex" rel="noopener noreferrer"&gt;&lt;strong&gt;AIPageIndex&lt;/strong&gt;&lt;/a&gt;:  a vectorless, reasoning-based RAG engine that mirrors how humans read, delivering traceable, explainable, and context-aware retrieval, with no vector DBs or chunking, it replaces the vector index with a hierarchical tree index and lets an LLM reason its way through it, the way a human expert turns to and reads the right section of a long report. &lt;/p&gt;




&lt;p&gt;&lt;a href="https://x.com/CanesDavid/status/2121970445515706674" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fk10f2kir3f6clgb9ptcg.png" alt=" " width="598" height="238"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/NOENDSTUDIO1/status/2121939175779799249" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnyzslpgdz2133am20djj.png" alt=" " width="598" height="412"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/Ruan3D_/status/2121971000862777518" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2a6qqfem08elieae3d7b.png" alt=" " width="598" height="138"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/0xZachReal/status/2121991242578075866" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fko4iauqem3i62826782g.png" alt=" " width="598" height="707"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/nypost/status/2122806224705945837" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fu6x9bx31c8c1xinpb8id.png" alt=" " width="598" height="476"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/jsparkblog/status/2122912349824975209" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyz6qoja7g4dw8fggbcu9.png" alt=" " width="598" height="218"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/johncrickett/status/2123097400743244141" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8qywcwdskwi2k21ss0rd.png" alt=" " width="598" height="398"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/TaliaRinger/status/2123473068781637931" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fydi7dfb21u5f5ybvxvon.png" alt=" " width="598" height="174"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/AshleyMiningBee/status/2123374090384024017" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fypt934g8uu20wtdajvm5.png" alt=" " width="598" height="118"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/BitmundFreud/status/2123907949147894077" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fasme4xxm7ogvjx7u47wy.png" alt=" " width="598" height="158"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdnd9z81xl0716xg3xq9z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdnd9z81xl0716xg3xq9z.png" alt=" " width="800" height="605"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ff70ss3c6k3ad1dimtole.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ff70ss3c6k3ad1dimtole.png" alt=" " width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxrucf9q7gdhj3l67ozl4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxrucf9q7gdhj3l67ozl4.png" alt=" " width="800" height="613"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fv35ejksn9zq3nj7i5lk2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fv35ejksn9zq3nj7i5lk2.png" alt=" " width="800" height="1192"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3ltmn91ktcyo6dge3g0f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3ltmn91ktcyo6dge3g0f.png" alt=" " width="800" height="1069"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp3hu757di1tmdgsr6mt7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp3hu757di1tmdgsr6mt7.png" alt=" " width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fveg2dp52fr7aoqqupoe5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fveg2dp52fr7aoqqupoe5.png" alt=" " width="480" height="649"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3rxmaz4erv5ot4w5z87i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3rxmaz4erv5ot4w5z87i.png" alt=" " width="800" height="785"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fae1gydi5lw2r6x5gas8l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fae1gydi5lw2r6x5gas8l.png" alt=" " width="509" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8zgtmv9yxn4yptrnonvg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8zgtmv9yxn4yptrnonvg.png" alt=" " width="800" height="1179"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fecmenv1q6fecu75k0kdp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fecmenv1q6fecu75k0kdp.png" alt=" " width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0q3eocqhhfkvshpwtjdg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0q3eocqhhfkvshpwtjdg.png" alt=" " width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flt4xdxup3jo4uuptfo8w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flt4xdxup3jo4uuptfo8w.png" alt=" " width="800" height="963"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8zf1wn4o3c8kp3vuw69a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8zf1wn4o3c8kp3vuw69a.png" alt=" " width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Cover Image by &lt;a href="https://unsplash.com/@polarmermaid?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Anne Nygård&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/green-field-under-white-sk-y-j-JvnrV0tqg?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>weekly</category>
      <category>review</category>
    </item>
    <item>
      <title>WeeklyReview#202646</title>
      <dc:creator>Mathieu Kerjouan</dc:creator>
      <pubDate>Mon, 16 Nov 2026 10:00:00 +0000</pubDate>
      <link>https://dev.to/niamtokik/weeklyreview202646-ji4</link>
      <guid>https://dev.to/niamtokik/weeklyreview202646-ji4</guid>
      <description>&lt;p&gt;Springer is offering many interesting books in open access. Anyone can download them, and read them, for free. The content looks very great - not a surprise coming from Springer - and it's always a pleasure to see free available knowledge! You'll find few of them in the next part of this publication, enjoy.&lt;/p&gt;




&lt;h1&gt;
  
  
  Coding
&lt;/h1&gt;

&lt;p&gt;🏗️ &lt;a href="https://github.com/yappologistic/CUI" rel="noopener noreferrer"&gt;&lt;strong&gt;CUI&lt;/strong&gt;&lt;/a&gt;: Native UI components for C: about 150 of them, with spring motion and full keyboard support. Windows, macOS and Linux, no dependencies.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://blog.llvm.org/posts/2026-08-24-gsoc-lifetime-annotations-csa/" rel="noopener noreferrer"&gt;&lt;strong&gt;GSoC 2026 - Teach the Clang Static Analyzer to understand lifetime annotations&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://fly.io/phoenix-files/liveview-multi-select/" rel="noopener noreferrer"&gt;&lt;strong&gt;A reusable Multi-Select component for Phoenix LiveView&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://chessman7.substack.com/p/linux-finally-killed-strncpy-it-took" rel="noopener noreferrer"&gt;&lt;strong&gt;Linux Finally Killed &lt;code&gt;strncpy&lt;/code&gt;. It Took Six Years, 362 Patches, and 70 Contributors.&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://dart.dev/blog/announcing-dart-3-14" rel="noopener noreferrer"&gt;&lt;strong&gt;Announcing Dart 3.14&lt;/strong&gt;&lt;/a&gt;: &lt;code&gt;dart migrate&lt;/code&gt; tool will help to upgrade package. Few improvements on WASM.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://flutter.dev/blog/whats-new-in-flutter-3-50" rel="noopener noreferrer"&gt;&lt;strong&gt;What's new in Flutter 3.50&lt;/strong&gt;&lt;/a&gt;: A new Flutter release. Some improvement in the FFI part, lot of improvements on the design/graphics part. Touching was improved on iOS and macOS.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://www.dumpanalysis.org/files/Residues_in_Diagnostics-Version17.pdf" rel="noopener noreferrer"&gt;&lt;strong&gt;Residues in Diagnostics&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  System
&lt;/h1&gt;

&lt;p&gt;📖 &lt;a href="https://link.springer.com/book/10.1007/978-981-19-3026-3" rel="noopener noreferrer"&gt;&lt;strong&gt;Cloud Computing Technology&lt;/strong&gt;&lt;/a&gt;: This open access book introduces cloud computing and related technologies from the concept, technology, and architecture of cloud computing, combined with typical application cases of cloud.&lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://link.springer.com/book/10.1007/978-3-031-99489-0" rel="noopener noreferrer"&gt;&lt;strong&gt;The Data Center as a Computer&lt;/strong&gt;&lt;/a&gt;: Warehouse-scale computers (WSCs) power cloud computing and all the great web services we use daily, including recent advancements in Artificial Intelligence/Machine Learning (AI/ML).&lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://link.springer.com/book/10.1007/978-981-95-2185-2" rel="noopener noreferrer"&gt;&lt;strong&gt;Operating System Basics and Practice&lt;/strong&gt;&lt;/a&gt;: This open access book covers operating system fundamentals, UNIX/Linux design philosophy, and openEuler practices.&lt;/p&gt;

&lt;p&gt;🏗️ &lt;a href="https://github.com/floci-io/floci" rel="noopener noreferrer"&gt;&lt;strong&gt;Floci&lt;/strong&gt;&lt;/a&gt;: a free, open-source local AWS emulator for development, testing, and CI.&lt;/p&gt;

&lt;p&gt;🏗️ &lt;a href="https://github.com/aws/aws-emulator" rel="noopener noreferrer"&gt;&lt;strong&gt;aws-emulator&lt;/strong&gt;&lt;/a&gt;: a local emulator of the AWS APIs. You use it to test your software without calling AWS, on your own machine, on a development server, or in continuous integration (CI). You don’t need an AWS account. Your requests go to the emulator, not to AWS.&lt;/p&gt;

&lt;p&gt;🌐 &lt;a href="https://kernel-internals.org/" rel="noopener noreferrer"&gt;&lt;strong&gt;Linux Kernel Internals&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Network
&lt;/h1&gt;

&lt;p&gt;🌐 &lt;a href="https://www.thinkpenguin.com/gnu-linux/free-software-gigabit-mini-vpn-router-tpe-r1400" rel="noopener noreferrer"&gt;&lt;strong&gt;Free Software Gigabit Mini VPN Router (TPE-R1400)&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://link.springer.com/book/10.1007/978-981-19-3029-4" rel="noopener noreferrer"&gt;&lt;strong&gt;Data Communications and Network Technologies&lt;/strong&gt;&lt;/a&gt;: This open access book is written according to the examination outline for Huawei HCIA-Routing Switching V2.5 certification, aiming to help readers master the basics of network communications and use Huawei network devices.&lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://link.springer.com/book/10.1007/978-981-19-3069-0" rel="noopener noreferrer"&gt;&lt;strong&gt;Construction, Operation and Maintenance of Network System(Junior Level)&lt;/strong&gt;&lt;/a&gt;: This open access book follows the development rules of network technical talents, simultaneously placing its focus on the transfer of network knowledge, the accumulation of network skills, and the improvement of professionalism. &lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://link.springer.com/book/10.1007/978-981-92-0112-9" rel="noopener noreferrer"&gt;&lt;strong&gt;Understanding 5G New Radio&lt;/strong&gt;&lt;/a&gt;: This open access book is a practical guide to experimentally understand, analyze, and optimize the performance of 5G networks. &lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://link.springer.com/book/10.1007/978-3-031-51819-5" rel="noopener noreferrer"&gt;&lt;strong&gt;Digital Twin&lt;/strong&gt;&lt;/a&gt;: This open access book offers comprehensive, self-contained knowledge on Digital Twin (DT), which is a very promising technology for achieving digital intelligence in the next-generation wireless communications and computing networks.&lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://link.springer.com/book/10.1007/978-3-031-33191-6" rel="noopener noreferrer"&gt;&lt;strong&gt;The Changing World of Mobile Communications&lt;/strong&gt;&lt;/a&gt;: This open access book from the world’s first 6G Flagship research program at the University of Oulu, Finland, provides a multi-disciplinary and insightful overview of the subject, with contributions from experts in the field. &lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://dipsingh.github.io/TCP-Congestion-Experiment/" rel="noopener noreferrer"&gt;&lt;strong&gt;Experimenting with TCP Congestion control&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Security
&lt;/h1&gt;

&lt;p&gt;📖 &lt;a href="https://link.springer.com/book/10.1007/978-3-031-11089-4" rel="noopener noreferrer"&gt;&lt;strong&gt;Advanced Digital Auditing&lt;/strong&gt;&lt;/a&gt;: This open access book discusses the most modern approach to auditing complex digital systems and technologies.&lt;/p&gt;

&lt;p&gt;🌐 &lt;a href="https://pikasim.com/lite" rel="noopener noreferrer"&gt;&lt;strong&gt;PikaSim Lite&lt;/strong&gt;&lt;/a&gt;: Privacy eSIMs.No Signup. No Email. Instant eSIMs.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://thehackernews.com/2026/11/emudhra-revokes-8-more-cas-it.html" rel="noopener noreferrer"&gt;&lt;strong&gt;eMudhra Revokes 8 More CAs It Previously Declared Unaffected by Key Compromise&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://www.rtl-sdr.com/decoding-tetra-voice-on-a-retevis-c62-handheld-with-custom-openrtx-firmware/" rel="noopener noreferrer"&gt;&lt;strong&gt;Decoding TETRA Voice on a Retevis C62 Handheld with Custom OpenRTX Firmware&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://anyday.security/blog/no-public-poc-is-dead" rel="noopener noreferrer"&gt;&lt;strong&gt;“No Public PoC” Is Dead&lt;/strong&gt;&lt;/a&gt;: interesting post about CVE and Exploits. See also &lt;a href="//ExploitTotal.ai"&gt;&lt;strong&gt;Exploit Total&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://thehackernews.com/2026/11/4837-hijacked-github-accounts-ran-ci.html" rel="noopener noreferrer"&gt;&lt;strong&gt;Attacker Used 4,837 Hijacked GitHub Accounts to Run a CI Secret Stealer in 1,806+ Repositories&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://grahamhelton.github.io/harness-engineering-workshop-book/introduction.html" rel="noopener noreferrer"&gt;&lt;strong&gt;Introduction To Harness Engineering For Vulnerability Research&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://projectzero.google/2026/11/disclosure-policy.html" rel="noopener noreferrer"&gt;&lt;strong&gt;Policy and Disclosure: 2026 Edition&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🏗️ &lt;a href="https://github.com/davtur19/tg-widget-rce" rel="noopener noreferrer"&gt;&lt;strong&gt;Telegram Widget RCE&lt;/strong&gt;&lt;/a&gt;: Native code execution in Telegram's in-chat widget engine (QuickJS-ng).&lt;/p&gt;

&lt;h1&gt;
  
  
  Security/Cryptography
&lt;/h1&gt;

&lt;p&gt;📖 &lt;a href="https://link.springer.com/book/10.1007/978-981-19-0920-7" rel="noopener noreferrer"&gt;&lt;strong&gt;Modern Cryptography Volume 1&lt;/strong&gt;&lt;/a&gt;: This open access book systematically explores the statistical characteristics of cryptographic systems, the computational complexity theory of cryptographic algorithms and the mathematical principles behind various encryption and decryption algorithms.&lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://link.springer.com/book/10.1007/978-981-19-7644-5" rel="noopener noreferrer"&gt;&lt;strong&gt;Modern Cryptography Volume 2&lt;/strong&gt;&lt;/a&gt;: This open access book covers the most cutting-edge and hot research topics and fields of post-quantum cryptography.&lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://link.springer.com/book/10.1007/978-981-96-1218-5" rel="noopener noreferrer"&gt;&lt;strong&gt;Mathematical Foundations for Post-Quantum Cryptography&lt;/strong&gt;&lt;/a&gt;: This open access book presents mathematical foundations for cryptography securely used in the era of quantum computers.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://eternax.ai/blogs/sha-256-39-step-collisions-below-generic-search/index.html" rel="noopener noreferrer"&gt;&lt;strong&gt;Pushing Collision Attacks on 39-Step SHA-256 Below Generic Search&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📑 &lt;a href="https://eprint.iacr.org/2026/2867" rel="noopener noreferrer"&gt;&lt;strong&gt;Collision Attacks on SHA-2: 39-Step SHA-256 below the Birthday Bound&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📑 &lt;a href="https://eprint.iacr.org/2026/2857" rel="noopener noreferrer"&gt;&lt;strong&gt;When One Bit Is (Almost) Enough: A Low Leakage Chosen Plaintext Side Channel Attack on AES&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📑 &lt;a href="https://eprint.iacr.org/2026/2852" rel="noopener noreferrer"&gt;&lt;strong&gt;A Tutorial on Oblivious Random Access Memory&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📑 &lt;a href="https://eprint.iacr.org/2026/2819" rel="noopener noreferrer"&gt;&lt;strong&gt;How to Revoke Users in Encryption Schemes?&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Embedded
&lt;/h1&gt;

&lt;p&gt;📝 &lt;a href="https://embedded.fm/blog/ese101" rel="noopener noreferrer"&gt;&lt;strong&gt;Embedded Software Engineering 101&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://www.worldradiohistory.com/BOOKSHELF-ARH/Technology/Sams-Books/SAMS-ABC's%20Of%20Transistors%20-%20George%20B.%20Mann.pdf" rel="noopener noreferrer"&gt;&lt;strong&gt;ABC's of Transistors&lt;/strong&gt;&lt;/a&gt;: a quite old book (1956) about transistors.&lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://link.springer.com/book/10.1007/978-3-030-60910-8" rel="noopener noreferrer"&gt;&lt;strong&gt;Embedded System Design&lt;/strong&gt;&lt;/a&gt;:  this open access textbook is to provide a comprehensive introduction to the fundamental knowledge in embedded systems, with applications in cyber-physical systems and the Internet of things.&lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://link.springer.com/book/10.1007/978-981-19-1983-1" rel="noopener noreferrer"&gt;&lt;strong&gt;Foundations of Robotics&lt;/strong&gt;&lt;/a&gt;: This open access book introduces key concepts in robotics in an easy to understand language using an engaging project-based approach. &lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://link.springer.com/book/10.1007/978-3-319-62533-1" rel="noopener noreferrer"&gt;&lt;strong&gt;Elements of Robotics&lt;/strong&gt;&lt;/a&gt;: This open access book bridges the gap between playing with robots in school and studying robotics at the upper undergraduate and graduate levels to prepare for careers in industry and research.&lt;/p&gt;

&lt;p&gt;🌐 &lt;a href="https://menlo.ai/asimov-1" rel="noopener noreferrer"&gt;&lt;strong&gt;Asimov 1&lt;/strong&gt;&lt;/a&gt;: An open humanoid you can build, train, and customize.&lt;/p&gt;

&lt;h1&gt;
  
  
  Mathematics
&lt;/h1&gt;

&lt;p&gt;📝 &lt;a href="https://www.epatters.org/post/e-graphs-1/" rel="noopener noreferrer"&gt;&lt;strong&gt;How to prove equations using diagrams, part 1&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://link.springer.com/book/10.1007/978-3-031-41026-0" rel="noopener noreferrer"&gt;&lt;strong&gt;Linear Algebra Done Right&lt;/strong&gt;&lt;/a&gt;: this best-selling textbook for a second course in linear algebra is aimed at undergraduate math majors and graduate students. The fourth edition gives an expanded treatment of the singular value decomposition and its consequences.&lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://link.springer.com/book/10.1007/978-3-030-33143-6" rel="noopener noreferrer"&gt;&lt;strong&gt;Measure, Integration &amp;amp; Real Analysis&lt;/strong&gt;&lt;/a&gt;: This open access textbook welcomes students into the fundamental theory of measure, integration, and real analysis.&lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://link.springer.com/book/10.1007/978-3-030-56694-4" rel="noopener noreferrer"&gt;&lt;strong&gt;Quaternion Algebras&lt;/strong&gt;&lt;/a&gt;: This open access textbook presents a comprehensive treatment of the arithmetic theory of quaternion algebras and orders, a subject with applications in diverse areas of mathematics.&lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://link.springer.com/book/10.1007/978-3-031-88819-9" rel="noopener noreferrer"&gt;&lt;strong&gt;Beginning in Algebraic Geometry&lt;/strong&gt;&lt;/a&gt;: Starting from the most fundamental properties of polynomials, the reader is guided one step at a time through affine, projective, and quasiprojective algebraic geometry, with complete justifications along the way of such foundational results as the Nullstellensatz and the Theorem on Fiber Dimensions.&lt;/p&gt;

&lt;h1&gt;
  
  
  Physics
&lt;/h1&gt;

&lt;p&gt;📖 &lt;a href="https://link.springer.com/book/10.1007/978-3-031-87845-9" rel="noopener noreferrer"&gt;&lt;strong&gt;Quantum Mechanics Done Right&lt;/strong&gt;&lt;/a&gt;: This open access book develops the world of quantum physics without the onerous math prerequisites of all other texts.&lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://link.springer.com/book/10.1007/978-3-030-15195-9" rel="noopener noreferrer"&gt;&lt;strong&gt;Principles of Mechanics&lt;/strong&gt;&lt;/a&gt;: This open access textbook takes the reader step-by-step through the concepts of mechanics in a clear and detailed manner.&lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://link.springer.com/book/10.1007/978-3-032-26272-1" rel="noopener noreferrer"&gt;&lt;strong&gt;The Geometry of Ellipses and Planetary Orbits&lt;/strong&gt;&lt;/a&gt;: This open access book is intended to give a bird's-eye view of ellipses and planetary orbits. The only background required is secondary-school Euclidean geometry, analytic geometry, and trigonometry. That doesn't mean that the theorems and proofs are easy; to the contrary, many are very challenging.&lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://link.springer.com/book/10.1007/978-3-031-69507-0" rel="noopener noreferrer"&gt;&lt;strong&gt;Atomic Physics for Everyone&lt;/strong&gt;&lt;/a&gt;: This open access textbook introduces beginning undergraduate students and high school students to the world of quantum mechanics and atomic spectroscopy.&lt;/p&gt;

&lt;h1&gt;
  
  
  Computer Science
&lt;/h1&gt;

&lt;p&gt;📖 &lt;a href="https://link.springer.com/book/10.1007/978-981-19-2879-6" rel="noopener noreferrer"&gt;&lt;strong&gt;Artificial Intelligence Technology&lt;/strong&gt;&lt;/a&gt;: This open access book aims to give our readers a basic outline of today’s research and technology developments on artificial intelligence (AI), help them to have a general understanding of this trend, and familiarize them with the current research hotspots.&lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://link.springer.com/book/10.1007/978-3-030-36071-9" rel="noopener noreferrer"&gt;&lt;strong&gt;Cyber-Physical Systems: A Model-Based Approach&lt;/strong&gt;&lt;/a&gt;: future inventors are introduced to the key concepts of Cyber-Physical Systems (CPS).&lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://link.springer.com/book/9789819265985" rel="noopener noreferrer"&gt;&lt;strong&gt;Natural Language Processing&lt;/strong&gt;&lt;/a&gt;: This book offers a comprehensive and forward-looking introduction to Natural Language Processing (NLP). &lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://link.springer.com/book/10.1007/978-3-030-61601-4" rel="noopener noreferrer"&gt;&lt;strong&gt;Quantum Computing for the Quantum Curious&lt;/strong&gt;&lt;/a&gt;: This open access book makes quantum computing more accessible than ever before. A fast-growing field at the intersection of physics and computer science, quantum computing promises to have revolutionary capabilities far surpassing “classical” computation.&lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://link.springer.com/book/10.1007/978-981-15-3376-1" rel="noopener noreferrer"&gt;&lt;strong&gt;Blockchain and Crypto Currency&lt;/strong&gt;&lt;/a&gt;: This open access book contributes to the creation of a cyber ecosystem supported by blockchain technology in which technology and people can coexist in harmony.&lt;/p&gt;

&lt;h1&gt;
  
  
  Leaks of the week
&lt;/h1&gt;

&lt;p&gt;🐦 &lt;a href="https://x.com/XBToshi/status/2119295236434514412" rel="noopener noreferrer"&gt;&lt;strong&gt;Apiiro research&lt;/strong&gt;&lt;/a&gt;: 1,122 public GitHub repos just leaked 2,539 plaintext production credentials.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://frenchbreaches.com/alertes/fuite-donnees-securitest-22-millions-clients-controle-technique-mw6vd1rbumwau7gc4g" rel="noopener noreferrer"&gt;&lt;strong&gt;Sécuritest&lt;/strong&gt;&lt;/a&gt;: 22 millions clients impacted.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://www.cyberattaque.org/maileva-docaposte-la-poste-cyberattaque/" rel="noopener noreferrer"&gt;&lt;strong&gt;Docaposte&lt;/strong&gt;&lt;/a&gt;: 22 millions people impacted.&lt;/p&gt;

&lt;h1&gt;
  
  
  Update/Upgrade
&lt;/h1&gt;

&lt;p&gt;🔄 &lt;a href="https://github.com/ninenines/cowboy/releases/tag/2.21.0" rel="noopener noreferrer"&gt;&lt;strong&gt;cowboy-2.21.0&lt;/strong&gt;&lt;/a&gt;: mostly security fixes release, the &lt;a href="https://ninenines.eu/articles/cowboy-2.21.0/" rel="noopener noreferrer"&gt;blog&lt;/a&gt; is covering the upgrade. See also &lt;a href="https://github.com/ninenines/cowlib/releases/tag/2.22.0" rel="noopener noreferrer"&gt;&lt;strong&gt;cowlib-2.22.0&lt;/strong&gt;&lt;/a&gt;, &lt;a href="https://github.com/ninenines/ranch/releases/tag/2.4.0" rel="noopener noreferrer"&gt;&lt;strong&gt;ranch-2.4.0&lt;/strong&gt;&lt;/a&gt; and &lt;a href="https://github.com/ninenines/gun/releases/tag/2.8.0" rel="noopener noreferrer"&gt;&lt;strong&gt;gun-2.8.0&lt;/strong&gt;&lt;/a&gt; upgrades.&lt;/p&gt;

&lt;p&gt;🔄 &lt;a href="https://github.com/benoitc/hackney/releases/tag/4.10.2" rel="noopener noreferrer"&gt;&lt;strong&gt;hackney-4.10.2&lt;/strong&gt;&lt;/a&gt;: bug and security fixes release.&lt;/p&gt;

&lt;h1&gt;
  
  
  Misc
&lt;/h1&gt;

&lt;p&gt;📖 &lt;a href="https://link.springer.com/chapter/10.1007/978-3-030-97722-1_3" rel="noopener noreferrer"&gt;&lt;strong&gt;Social Network Theories: An Overview&lt;/strong&gt;&lt;/a&gt;: The theoretical interest is not based on so-called classical attributes of individuals, like gender, race, or age, or characteristics of institutions, but on relationships and their structures and the embedding of the actors within a network. The starting point of research questions includes relations, the embeddedness of the individuals within a network, and the interaction between social structure and individual attributes.&lt;/p&gt;

&lt;p&gt;🌐 &lt;a href="https://hft.md/uncensored-ai/" rel="noopener noreferrer"&gt;&lt;strong&gt;Every free uncensored AI model on the internet&lt;/strong&gt;&lt;/a&gt;: a short database of the free model available.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://www.theregister.com/ai-and-ml/2026/11/12/a-third-of-us-ai-chatters-are-hot-at-bots-hurling-insults-at-llms/5309506" rel="noopener noreferrer"&gt;&lt;strong&gt;A third of US AI chatters are hot at bots, hurling insults at LLMs&lt;/strong&gt;&lt;/a&gt;: it seems 1/3 of users hate LLM, I don't know why.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://www.slopmanifesto.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;No AI Slop: A Manifesto&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-2121451807297749281-178" src="https://platform.twitter.com/embed/Tweet.html?id=2121451807297749281"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-2121451807297749281-178');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=2121451807297749281&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/Prayag12B/status/2118797819662483460" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0r8ge0jsuaadx0kcvqq9.png" alt=" " width="598" height="378"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/reset_by_peer/status/2118929857321001295" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkfdw6tm3r3rcix18m1vn.png" alt=" " width="598" height="198"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/reset_by_peer/status/2118807613622366384" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Faux208uj9wf6h1ev4h2f.png" alt=" " width="598" height="264"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/GohilHardy/status/2118964668962369941" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fx4u5clpvyv2h19xenz2c.png" alt=" " width="598" height="158"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/mfishbein/status/2119823652698923427" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fyrtbbf83kcvdgb8u2eb7.png" alt=" " width="598" height="598"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/ayojoestar/status/2120211074586653123?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fc0smq1lxtfqkpht6s89p.png" alt=" " width="598" height="118"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/steveklabnik/status/2120968978952532230" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpd40epdcjzl0szyhou0w.png" alt=" " width="598" height="220"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/Scoobydouchebag/status/2120977196458074377" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fao8edc6mzyz6dlm1oick.png" alt=" " width="598" height="118"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/PabloWende/status/2120907845596266879" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fd1704fk1a0o1jgz1w6q9.png" alt=" " width="598" height="182"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/realKalos/status/2120990246435254533" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhqyvugkukqoph7xezf6f.png" alt=" " width="598" height="158"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/FinanceDirCFO/status/2121177103999565984" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fb8q0ovpeeek3xnsxrheu.png" alt=" " width="598" height="672"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/PR0GRAMMERHUM0R/status/2121211522059768003" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fosmro4d8p6aees1o9mua.png" alt=" " width="598" height="590"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/CryptoCred/status/2121185161186513216" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fiulh9212e6s2eikar2ie.png" alt=" " width="598" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/YashHustle_22/status/2121290494533890197" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftiavb4tj4f4d52x7ges5.png" alt=" " width="598" height="220"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fexiws8lns363wgkovm99.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fexiws8lns363wgkovm99.png" alt=" " width="800" height="447"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fh7uym9a4c1sit7rbo9k1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fh7uym9a4c1sit7rbo9k1.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmicxoc2wjd1l1twrrjpi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmicxoc2wjd1l1twrrjpi.png" alt=" " width="800" height="980"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frdib1uwbjldw3lna6pqd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frdib1uwbjldw3lna6pqd.png" alt=" " width="625" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq9wq5a9yyga90wjk8yoy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq9wq5a9yyga90wjk8yoy.png" alt=" " width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxwwuaj6wmibjgiy4b3bu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxwwuaj6wmibjgiy4b3bu.png" alt=" " width="800" height="1000"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9a0l6nrdrl4yzyiej5y1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9a0l6nrdrl4yzyiej5y1.png" alt=" " width="500" height="542"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fk9yzszd8jcb9vdn2gmuh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fk9yzszd8jcb9vdn2gmuh.png" alt=" " width="800" height="661"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhvvdqypzu9tslazc8nd9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhvvdqypzu9tslazc8nd9.png" alt=" " width="500" height="569"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmw0qo7ibfkyjlguoen2m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmw0qo7ibfkyjlguoen2m.png" alt=" " width="799" height="473"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Cover image by &lt;a href="https://unsplash.com/@branden_skeli?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Branden Skeli&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/wooden-bridge-over-water-surrounded-by-autumn-trees-VGbn4S8Dhp4?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>weekly</category>
      <category>review</category>
      <category>november</category>
    </item>
    <item>
      <title>WeeklyReview#202645</title>
      <dc:creator>Mathieu Kerjouan</dc:creator>
      <pubDate>Mon, 09 Nov 2026 10:00:00 +0000</pubDate>
      <link>https://dev.to/niamtokik/weeklyreview202645-2gao</link>
      <guid>https://dev.to/niamtokik/weeklyreview202645-2gao</guid>
      <description>&lt;p&gt;The past weeks were hard... And it's probably not over yet. Between the number of crazy vulnerabilities discovered recently and the economic crash, it is becoming increasingly complex to follow everything. The latest Musl/OpenSSH security issue was one of the most scary one discovered recently. During the last 10 years, any users can connect to any sshd server with a password greater than 256 characters. It works perfectly if the targeted user on the server does not have any password set and the field is set to &lt;code&gt;*&lt;/code&gt;. Yeah. That's the name of the vulnerability: &lt;code&gt;*sshole&lt;/code&gt;.&lt;/p&gt;




&lt;h1&gt;
  
  
  Coding
&lt;/h1&gt;

&lt;p&gt;📝 &lt;a href="https://forum.itsallwidgets.com/t/how-to-prepare-a-flutter-app-for-google-play-closed-testing/4942" rel="noopener noreferrer"&gt;&lt;strong&gt;How to Prepare a Flutter App for Google Play Closed Testing&lt;/strong&gt;&lt;/a&gt;: a checklist to publish a flutter app to google play.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://filiph.net/text/dart-for-loops-performance.html" rel="noopener noreferrer"&gt;&lt;strong&gt;Benchmark: Which Dart loop is the fastest?&lt;/strong&gt;&lt;/a&gt;: a microbenchmark on loop performance in Dart. Conclusion: in most case ,the compiler is smart enough to optimize loops, even when using &lt;code&gt;forEach()&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://blog.llvm.org/2011/05/what-every-c-programmer-should-know.html" rel="noopener noreferrer"&gt;&lt;strong&gt;What Every C Programmer Should Know About Undefined Behavior #1/3&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://www.johndcook.com/blog/2025/03/09/tengwar/" rel="noopener noreferrer"&gt;&lt;strong&gt;Unicode, Tolkien, and Privacy&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🏗️ &lt;a href="https://github.com/bondy-io/bondy-connect/releases/tag/1.0.1" rel="noopener noreferrer"&gt;&lt;strong&gt;Bondy-connect&lt;/strong&gt;&lt;/a&gt;: first 1.0.0 and 1.0.1 release of bondy-connect.&lt;/p&gt;

&lt;p&gt;🏗️ &lt;a href="https://github.com/forlo581230/Pattern-Oriented-Software-Design" rel="noopener noreferrer"&gt;&lt;strong&gt;Pattern-Oriented-Software-Design&lt;/strong&gt;&lt;/a&gt;: a Prolog term matching program.&lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://www.dumpanalysis.org/files/Prolog_for_Pattern-Oriented_Software_Diagnostics_V20.pdf" rel="noopener noreferrer"&gt;&lt;strong&gt;Prolog for Pattern-Oriented Software Diagnostics&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://arobenko.github.io/bare_metal_cpp/" rel="noopener noreferrer"&gt;&lt;strong&gt;Practical Guide to Bare Metal C++&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🏗️ &lt;a href="https://kaisel.dev/" rel="noopener noreferrer"&gt;&lt;strong&gt;Kaisel&lt;/strong&gt;&lt;/a&gt;: Routes as values. A Dart 3-native router for Flutter — no string paths, no codegen.&lt;/p&gt;

&lt;h1&gt;
  
  
  System
&lt;/h1&gt;

&lt;p&gt;🏗️ &lt;a href="https://wiki.alpinebsd.org/" rel="noopener noreferrer"&gt;&lt;strong&gt;AlpineBSD&lt;/strong&gt;&lt;/a&gt;:  operating system based on the NetBSD kernel with a userspace inspired by Alpine Linux and the objective of making it possible to use as little AI-generated software as possible. There is no LLM output included in the base system or main package repository (AlpineBSD AI policy).&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://kernelnewbies.org/FirstKernelPatch" rel="noopener noreferrer"&gt;&lt;strong&gt;Linux First Patch&lt;/strong&gt;&lt;/a&gt;: A checklist to create your first Linux patch.&lt;/p&gt;

&lt;p&gt;📑 &lt;a href="https://arxiv.org/pdf/2610.35999" rel="noopener noreferrer"&gt;&lt;strong&gt;safeL4: Rethinking Safe-Language-Based Single Address Space Microkernels&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🏗️ &lt;a href="https://github.com/multikernel/kmorph" rel="noopener noreferrer"&gt;&lt;strong&gt;kmorph&lt;/strong&gt;&lt;/a&gt;: transforms a running multikernel Linux machine from one kernel into another without a reboot. A second kernel, the successor, is armed beside the kernel running the machine, the predecessor, and takes it over.&lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://dspinellis.github.io/unix-v3man/v3man.pdf" rel="noopener noreferrer"&gt;&lt;strong&gt;UNIX PROGRAMMER’S MANUAL Third Edition&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Database
&lt;/h1&gt;

&lt;p&gt;🏗️ &lt;a href="https://github.com/HypoPG/hypopg" rel="noopener noreferrer"&gt;&lt;strong&gt;HypoPG&lt;/strong&gt;&lt;/a&gt;: hypothetical -- or virtual -- index is an index that doesn't really exist, and thus doesn't cost CPU, disk or any resource to create. They're useful to know if specific indexes can increase performance for problematic queries.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://planetscale.com/blog/designing-a-reliable-unplanned-failover" rel="noopener noreferrer"&gt;&lt;strong&gt;Designing a reliable unplanned failover&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Network
&lt;/h1&gt;

&lt;p&gt;🌐 &lt;a href="https://protocol-explorer-alpha.vercel.app/" rel="noopener noreferrer"&gt;&lt;strong&gt;Protocol Explorer&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://antranigv.am/posts/2026/11/setting-up-a-new-zone-in-bind-with-dnssec/" rel="noopener noreferrer"&gt;&lt;strong&gt;Setting up a new zone in BIND with DNSSEC&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Embedded
&lt;/h1&gt;

&lt;p&gt;📖 &lt;a href="https://users.ece.utexas.edu/~valvano/Volume1/E-Book/" rel="noopener noreferrer"&gt;&lt;strong&gt;Embedded Systems - Shape The World&lt;/strong&gt;&lt;/a&gt;: That's just great! One of the best series of books about embedded systems design and programming is now available online for free! Valvano's books were the best - and probably still are - more than 10 years ago. You can add &lt;a href="https://archive.org/details/the-art-of-electronics-3rd-ed-2015_202510" rel="noopener noreferrer"&gt;The Art of Electronics&lt;/a&gt;, and you don't need anything more... By the way, the 2nd edition of the &lt;a href="https://www.cambridge.org/cv/universitypress/subjects/physics/electronics-physicists/art-electronics-x-chapters-2nd-edition?format=HB&amp;amp;isbn=9781009632881" rel="noopener noreferrer"&gt;X chapters&lt;/a&gt; is out, the new edition is containing more than 900 pages (the previous one around 400). Received it last week, but I don't think I will have a lot of time to read it, sadly.&lt;/p&gt;

&lt;h1&gt;
  
  
  Security
&lt;/h1&gt;

&lt;p&gt;📝 &lt;a href="https://www.msn.com/en-us/technology/cryptocurrencies/trezor-says-a-tampered-wallet-came-from-the-reseller-tied-to-the-ledger-thefts-how-do-you-check-yours/ar-AA2grb5H" rel="noopener noreferrer"&gt;&lt;strong&gt;Trezor says a tampered wallet came from the reseller tied to the Ledger thefts. How do you check yours?&lt;/strong&gt;&lt;/a&gt;: don't. trust. startups. They don't respect elementary security rules, that's why their products are usually cheap. If the manufacturing chain has been compromised, all their products are just garbage. Like few crypto-bros are saying, if you want a wallet/ledger, use a very old air-gapped laptop.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://www.tomshardware.com/tech-industry/cyber-security/lenovo-fingerprint-usb-stick-sold-as-aes-256-encrypted-had-a-plain-sd-card-inside-ai-assisted-follow-up-finds-a-backdoor-and-hardcoded-keys-in-other-secure-usb-products" rel="noopener noreferrer"&gt;&lt;strong&gt;Lenovo's 'encrypted' fingerprint USB drive is just an unencrypted SD card in a fancy case — AI-assisted follow-up finds a backdoor and hardcoded keys in other ‘secure’ USB products&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🏗️ &lt;a href="https://github.com/8Protons/POWBlock" rel="noopener noreferrer"&gt;&lt;strong&gt;POWBlock&lt;/strong&gt;&lt;/a&gt;: high-performance, zero-dependency, system/stack-agnostic Proof of Work microservice that turns any proxy or server into a defense gate against AI scrapers, bots, and DDoS attacks.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://github.com/1337isnot1337/DOPPLERGEIST" rel="noopener noreferrer"&gt;&lt;strong&gt;DOPPLERGEIST&lt;/strong&gt;&lt;/a&gt;: a Python tool for acoustic geolocation research. It analyzes aircraft Doppler patterns in audio recordings and compares them against historical ADS-B flight trajectories to estimate possible recording locations.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://blog.cloudflare.com/zero-wire" rel="noopener noreferrer"&gt;&lt;strong&gt;Introducing Zero Wire, a hub for investigating critical Internet vulnerabilities&lt;/strong&gt;&lt;/a&gt;: a way to be informed of the new security vulnerabilities using the &lt;a href="https://radar.cloudflare.com/security/zero-wire" rel="noopener noreferrer"&gt;Zero Wire&lt;/a&gt; project.&lt;/p&gt;

&lt;p&gt;🏗️ &lt;a href="https://github.com/Rurik/Noriben/" rel="noopener noreferrer"&gt;&lt;strong&gt;Noriben&lt;/strong&gt;&lt;/a&gt;: a Python-based script that works in conjunction with Sysinternals Procmon to automatically collect, analyze, and report on runtime indicators of malware.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://blog.nviso.eu/2026/11/04/detection-engineering-implementing-detection-as-code-in-an-existing-environment-part-2-execution/" rel="noopener noreferrer"&gt;&lt;strong&gt;Detection Engineering: Implementing Detection-as-Code in an Existing Environment: Part 2 – Execution&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Security/cryptography
&lt;/h1&gt;

&lt;p&gt;📑 &lt;a href="https://www.mdpi.com/2410-387X/10/6/78" rel="noopener noreferrer"&gt;&lt;strong&gt;Construction and Benchmarking Methodology for Crypto-Code Systems on Elliptic and Hyperelliptic Curves&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📑 &lt;a href="https://www.mdpi.com/2410-387X/10/5/75" rel="noopener noreferrer"&gt;&lt;strong&gt;HKDF-Based Encryption Method with Very Long Keys for QKD and RKD&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://blog.trailofbits.com/2026/11/03/the-cryptography-behind-electronic-voting-and-why-paper-ballots-are-still-essential/" rel="noopener noreferrer"&gt;&lt;strong&gt;The cryptography behind electronic voting (and why paper ballots are still essential)&lt;/strong&gt;&lt;/a&gt;: not the first time a publication is trying to explain the risk of using cryptography (and technology) to replace paper ballot in real world voting. IIRC, Schneier explains that in one of his book. In this post, we have a deeper idea why it's not a good idea to use electronic vote.&lt;/p&gt;

&lt;p&gt;📑 &lt;a href="https://www.mdpi.com/2410-387X/10/6/81" rel="noopener noreferrer"&gt;&lt;strong&gt;Authenticated Content-Aware Image Encryption Using HMAC-SHA-256, Dynamic DNA Coding, and a 2D-LSCM Hyperchaotic Map&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Security/RedTeam
&lt;/h1&gt;

&lt;p&gt;📝 &lt;a href="https://hackers-arise.com/exploit-development-getting-started/" rel="noopener noreferrer"&gt;&lt;strong&gt;Exploit Development: Getting Started&lt;/strong&gt;&lt;/a&gt;: nice introduction to writing exploit&lt;/p&gt;

&lt;h1&gt;
  
  
  Misc
&lt;/h1&gt;

&lt;p&gt;▶️ &lt;a href="https://www.youtube.com/watch?v=A3fHWl6hiFE" rel="noopener noreferrer"&gt;&lt;strong&gt;Learning from AI Teachers&lt;/strong&gt;&lt;/a&gt;: AI/LLM is the future. Just watch that and you will be convinced.&lt;/p&gt;

&lt;p&gt;🏗️ &lt;a href="https://github.com/JiaFeiMiao-K-Cat/DiscImageStudio" rel="noopener noreferrer"&gt;&lt;strong&gt;DiscImageStudio&lt;/strong&gt;&lt;/a&gt;: a cool project to burn disk image... as physical image on the disk. &lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://hft.md/qt/" rel="noopener noreferrer"&gt;&lt;strong&gt;The entire quant theory on one sheet&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;▶️ &lt;a href="https://www.youtube.com/watch?v=YNQO0Ods2h0" rel="noopener noreferrer"&gt;&lt;strong&gt;Nassim Taleb Calls Stocks a 'Trap,' Sees 'Naive' AI Investors&lt;/strong&gt;&lt;/a&gt;: Taleb intervention at the Greenwich Economic Forum regarding the naive investors thinking the first companies will succeed in the AI world. Technology is unpredictable by nature.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://www.seangoedecke.com/you-cant-design-software-you-dont-work-on/" rel="noopener noreferrer"&gt;&lt;strong&gt;You can't design software you don't work on&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Update/Upgrade
&lt;/h1&gt;

&lt;p&gt;🔄 &lt;a href="https://www.qubes-os.org/news/2026/11/03/qsb-121/" rel="noopener noreferrer"&gt;&lt;strong&gt;QSB-121: Arbitrary read/write via grant copy (XSA-523)&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔄 &lt;a href="https://alpinelinux.org/posts/alpine-3.21.10-3.22.8-3.23.8-3.24.4-released/" rel="noopener noreferrer"&gt;&lt;strong&gt;Alpine Linux 3.24.4&lt;/strong&gt;&lt;/a&gt;: including OpenSSH Security patch linked to &lt;a href="https://alpinelinux.org/posts/2026-11-05-openssh-password-authentication-bypass/" rel="noopener noreferrer"&gt;&lt;strong&gt;Security advisory: openssh-server password authentication bypass&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Leaks of the week
&lt;/h1&gt;

&lt;p&gt;🌐 &lt;a href="https://frenchbreaches.com/blog/france-plus-de-19-millions-de-plaques-dimmatriculation-visees-par-des-fuites-de-donnees" rel="noopener noreferrer"&gt;&lt;strong&gt;Groupe MPA and Auto Planning&lt;/strong&gt;&lt;/a&gt;: 19 millions of license plate just leaked.&lt;/p&gt;

&lt;h1&gt;
  
  
  Mathematics
&lt;/h1&gt;

&lt;p&gt;📝 &lt;a href="https://derangedmathematician.substack.com/p/what-are-vectors" rel="noopener noreferrer"&gt;&lt;strong&gt;What are vectors?&lt;/strong&gt;&lt;/a&gt;: a modern introduction to vectors.&lt;/p&gt;

&lt;h1&gt;
  
  
  Quotes
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;The delusion that technology and finance have given us god-like powers that moot the pendulum of history will be revealed as delusion in a most painful manner&lt;/strong&gt;. A social-economic system in which what's moral is what's legal, and what's legal is for sale generates its own demise, as The Big Con doesn't work on the forces of history.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.zerohedge.com/geopolitical/pendulum-history" rel="noopener noreferrer"&gt;&lt;strong&gt;The Pendulum Of History&lt;/strong&gt;&lt;/a&gt; by David Hackett Fischer&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;a href="https://x.com/1DollarSol/status/2118055130289586280" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs4er1uk778ft4fpy0ikz.png" alt=" " width="598" height="278"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/esrtweet/status/2118109159157592086" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3wylhgg2o7woyiyu0ebt.png" alt=" " width="598" height="348"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/DevanshuXi/status/2117887683808858311" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F7nce6klrvuwp6xvi3imy.png" alt=" " width="598" height="118"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/meowkoteeq/status/2118337892321812644" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3wxtu6hr6i26092yhjaj.png" alt=" " width="598" height="406"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/sickdotdev/status/2118181576681095533" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fc84nqa34oqgmx5ccjkt1.png" alt=" " width="598" height="118"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/ns123abc/status/2118371862535163929" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr400wq2o8zpz4z8j8o07.png" alt=" " width="598" height="98"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/reset_by_peer/status/2118195274699231270" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fonv4y1mpq67ct3o8489q.png" alt=" " width="598" height="484"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/progrium/status/2118374030512431250" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuvju7oalt99oyxx27uvt.png" alt=" " width="598" height="504"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/gnoble79/status/2118360072862474501" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnhnhtnfhzq73rh7kdjcv.png" alt=" " width="598" height="1002"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/barkmeta/status/2118364044369543392?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4xqxx1omsqxlesrcwxl3.png" alt=" " width="598" height="140"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/BillyM2k/status/2118533976872931354" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuprinbhpg6r53kzsz285.png" alt=" " width="598" height="545"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/vidxn_/status/2118341323967078665" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzs2f9oury7gn4b259ip8.png" alt=" " width="598" height="358"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/GaryMarcus/status/2118627785027805220" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjj42ywq0yj4btjvaxb9z.png" alt=" " width="598" height="778"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/favwontmiss/status/2118607369697714255?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhj93q02ymcwncqvfqkvq.png" alt=" " width="598" height="158"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs3ofz8s9vzsaf5ii1hqt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs3ofz8s9vzsaf5ii1hqt.png" alt=" " width="613" height="408"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsvk365h2ju5u58xkglzd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fsvk365h2ju5u58xkglzd.png" alt=" " width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frdyunyhxuucknxxtkmjj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frdyunyhxuucknxxtkmjj.png" alt=" " width="800" height="790"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9cww8a3d7g7le0oerwum.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9cww8a3d7g7le0oerwum.png" alt=" " width="800" height="704"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F40to5mdep9f7f0g24cw6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F40to5mdep9f7f0g24cw6.png" alt=" " width="800" height="795"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1s7mnlb2m9gsvziv1u1w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1s7mnlb2m9gsvziv1u1w.png" alt=" " width="800" height="735"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnwaif0l4gt2ol44lexn3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnwaif0l4gt2ol44lexn3.png" alt=" " width="760" height="950"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frq6w664hkosva0s7inrx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frq6w664hkosva0s7inrx.png" alt=" " width="700" height="689"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fd0ks09o72c5l61d320rr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fd0ks09o72c5l61d320rr.png" alt=" " width="595" height="500"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Cover Image by &lt;a href="https://unsplash.com/@elisaih?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Elisa&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/a-close-up-of-berries-on-a-tree-branch-Tv8Q85wCAwU?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>weekly</category>
      <category>review</category>
    </item>
    <item>
      <title>Serial Console on Alpine Linux</title>
      <dc:creator>Mathieu Kerjouan</dc:creator>
      <pubDate>Thu, 05 Nov 2026 09:00:00 +0000</pubDate>
      <link>https://dev.to/niamtokik/serial-console-on-alpine-linux-4cj9</link>
      <guid>https://dev.to/niamtokik/serial-console-on-alpine-linux-4cj9</guid>
      <description>&lt;p&gt;Most of my firewalls are on OpenBSD or FreeBSD. While deploying github runners on Alpine Linux, I thought it could have been a great idea to install Alpine Linux on a firewall, just to see if this distribution can do this job.&lt;/p&gt;

&lt;h1&gt;
  
  
  Syslinux Boot
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://wiki.syslinux.org/wiki/index.php?title=The_Syslinux_Project" rel="noopener noreferrer"&gt;Syslinux&lt;/a&gt; is using all available &lt;a href="https://manpages.debian.org/trixie/coreutils/tty.1.en.html" rel="noopener noreferrer"&gt;&lt;code&gt;tty&lt;/code&gt;&lt;/a&gt; by default, including &lt;code&gt;ttyS0&lt;/code&gt;. It means, when booting on a live-image of Alpine Linux, if a serial cable is plugged to the device, a prompt should appear and offers a way to modify the Linux kernel parameters.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;boot&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;/boot/vmlinuz-lts &lt;span class="nv"&gt;initrd&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/boot/initramfs-lts &lt;span class="nv"&gt;modules&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;loop,squashfs,sd-mod,usb-storage quiet &lt;span class="nv"&gt;console&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;ttyS0,115200
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The default console for this installation should now use the serial console. The setup via &lt;a href="https://docs.alpinelinux.org/user-handbook/0.1a/Installing/setup_alpine.html" rel="noopener noreferrer"&gt;&lt;code&gt;setup-alpine&lt;/code&gt;&lt;/a&gt; process can be executed as usual after a successful login to the &lt;code&gt;root&lt;/code&gt; user.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;setup-alpine
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Don't reboot the firewall right now though, &lt;a href="https://wiki.syslinux.org/wiki/index.php?title=The_Syslinux_Project" rel="noopener noreferrer"&gt;Syslinux&lt;/a&gt; is not yet configured.&lt;/p&gt;

&lt;h1&gt;
  
  
  Persistent Configuration
&lt;/h1&gt;

&lt;p&gt;Just after the installation, before rebooting, to keep the serial console the default way to use your device (or at least, to be able to use it in case of issue), &lt;a href="https://wiki.syslinux.org/wiki/index.php?title=The_Syslinux_Project" rel="noopener noreferrer"&gt;Syslinux&lt;/a&gt; must be configured. Let create first our root with some useful mounted filesystems to avoid configuration issues.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;mount /dev/sda2 /mnt
&lt;span class="gp"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;mount /dev/sda1 /mnt/boot
&lt;span class="gp"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;mount &lt;span class="nt"&gt;-t&lt;/span&gt; proc proc /mnt/proc
&lt;span class="gp"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;mount &lt;span class="nt"&gt;-t&lt;/span&gt; devtmpfs devtmpfs /mnt/dev
&lt;span class="gp"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;mount &lt;span class="nt"&gt;-t&lt;/span&gt; sysfs sysfs /mnt/sys
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Great, the disk is correctly mounted and the new root should have all me need to create a &lt;a href="https://www.man7.org/linux/man-pages/man2/chroot.2.html" rel="noopener noreferrer"&gt;&lt;code&gt;chroot&lt;/code&gt;&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;chroot&lt;/span&gt; /mnt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Syslinux configuration is located in &lt;code&gt;/etc/update-extlinux.conf&lt;/code&gt;. Three new values must be updated to keep the serial console active: &lt;code&gt;default_kernel_opts&lt;/code&gt;, &lt;code&gt;serial_port&lt;/code&gt;&amp;nbsp;and &lt;code&gt;serial_baud&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&amp;gt;&lt;/span&gt; /etc/update-extlinux.conf &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt;
&lt;/span&gt;&lt;span class="go"&gt;default_kernel_opts="quiet rootfstype=ext4 console=ttyS0,115200"
serial_port=0
serial_baud=115200
EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;update-extlinux&lt;/code&gt; command must be invoked to generate the correct configuration in &lt;code&gt;/boot/boot/extlinux.conf&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;update-extlinux
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, &lt;code&gt;sync&lt;/code&gt; the data to the disk to ensure everything has been correctly written and reboot the system.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;sync&lt;/span&gt;
&lt;span class="gp"&gt;#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;reboot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After the reboot, your firewall should give you access to a prompt via the serial console.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Alpine Linux is one of the most simple Linux distribution on the market. On many other alternative, configuring the serial console can quickly become complex. There, the configuration is really simple. The biggest complexity is when the parameters are passed to the kernel on the boot prompt (mostly due to the serial console itself). More information can be found here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://wiki.syslinux.org/" rel="noopener noreferrer"&gt;&lt;strong&gt;Official Syslinux Wiki&lt;/strong&gt;&lt;/a&gt;;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://wiki.alpinelinux.org/wiki/Enable_Serial_Console_on_Boot#Enabling_two_consoles_during_boot" rel="noopener noreferrer"&gt;&lt;strong&gt;Enable Serial Console on Boot&lt;/strong&gt;&lt;/a&gt; from the Official Alpine Linux documentation;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.kernel.org/doc/html/latest/admin-guide/kernel-parameters.html" rel="noopener noreferrer"&gt;&lt;strong&gt;The kernel’s command-line parameters&lt;/strong&gt;&lt;/a&gt; from kernel.org;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://wiki.alpinelinux.org/wiki/Bootloaders" rel="noopener noreferrer"&gt;&lt;strong&gt;Bootloaders&lt;/strong&gt;&lt;/a&gt; from the Official Alpine Linux documentation.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Anyway, as usual, have fun and happy hacking!&lt;/p&gt;




&lt;p&gt;Cover Image by &lt;a href="https://unsplash.com/@poli_graphy?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Christopher Politano&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/wooden-chapel-on-grassy-mountain-hill-0GZSfzz2Z2c?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>alpine</category>
      <category>linux</category>
      <category>systems</category>
    </item>
    <item>
      <title>rdomain, wireguard, packet filter and OpenBSD</title>
      <dc:creator>Mathieu Kerjouan</dc:creator>
      <pubDate>Tue, 03 Nov 2026 09:00:00 +0000</pubDate>
      <link>https://dev.to/niamtokik/rdomain-wireguard-packet-filter-and-openbsd-42lm</link>
      <guid>https://dev.to/niamtokik/rdomain-wireguard-packet-filter-and-openbsd-42lm</guid>
      <description>&lt;p&gt;&lt;code&gt;rdomain&lt;/code&gt; is an interesting feature present on OpenBSD to create isolated routing domain. I rarely used this one - except for testing - but it was never deployed in production. In fact, it was pretty rare to have an OpenBSD router/firewall running outside of my own lab. A previous post was showing how to isolate a pool of workers and forward all their traffic through using onion routing using proxies. In this post, the workers traffic will be routed to a remote server using a wireguard tunnel. Both the firewall and the remote server are running on OpenBSD.&lt;/p&gt;

&lt;p&gt;A picture is worse thousand of words, then, the infrastructure schema below should give you an idea of the network structure and the connections between the different devices. Not everything is presented though, because my network is a bit more complex than that, but this is a big picture.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fidewl20h0mxgs3i8uakw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fidewl20h0mxgs3i8uakw.png" alt="Infrastructure Schema for Wireguard and rdomain on OpenBSD" width="800" height="1030"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before doing anything, we should probably start to learn what is an &lt;code&gt;rdomain&lt;/code&gt; and how to use it properly.&lt;/p&gt;

&lt;h1&gt;
  
  
  It's All About Isolation and Routing
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;rdomain&lt;/code&gt; appeared for the first time in OpenBSD 4.9. This goal was to offer a way to have isolated routing tables. By default, all routes are put in the &lt;code&gt;rdomain 0&lt;/code&gt;, and it can lead to some issues when dealing with complex network. With an &lt;code&gt;rdomain&lt;/code&gt;, an operator is able to create dynamically a new routing table isolated from the rest of the system, even if it is limited to 255 &lt;code&gt;rdomain&lt;/code&gt;, it shold be enough for most of the use case.&lt;/p&gt;

&lt;p&gt;Processes can be started in their own &lt;code&gt;rdomain&lt;/code&gt; with the help of the &lt;a href="https://man.openbsd.org/route" rel="noopener noreferrer"&gt;&lt;code&gt;route&lt;/code&gt;&lt;/a&gt; command and its &lt;code&gt;exec&lt;/code&gt; subcommand without forgetting the &lt;a href="https://man.openbsd.org/route#T" rel="noopener noreferrer"&gt;&lt;code&gt;-T&lt;/code&gt;&lt;/a&gt; flag. A way to check in which domain a process is in, is to use &lt;a href="https://man.openbsd.org/ps" rel="noopener noreferrer"&gt;&lt;code&gt;ps&lt;/code&gt;&lt;/a&gt; command with the &lt;a href="https://man.openbsd.org/ps#rtable" rel="noopener noreferrer"&gt;&lt;code&gt;rtable&lt;/code&gt;&lt;/a&gt; option. Let first checks the output of the &lt;code&gt;ps&lt;/code&gt; command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;ps &lt;span class="nt"&gt;-o&lt;/span&gt; rtable,pid,ppid,%cpu,%mem,command
&lt;span class="go"&gt;RTABLE   PID  PPID %CPU %MEM COMMAND
     0 59603 14917  0.0  0.0 -ksh (ksh)
     0 13501 59603  0.0  0.2 tmux: client (/tmp/tmux-1000/default) (tmux)
     0 68852 66599  0.0  0.0 -ksh (ksh)
     0 73792 66599  0.0  0.0 -ksh (ksh)
     0 75757 66599  0.0  0.0 -ksh (ksh)
     0 85484 75757  0.0  0.1 ps -o rtable
     0 47120 66599  0.0  0.0 -ksh (ksh)
     0 86889 66599  0.0  0.0 -ksh (ksh)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;AS you can see, all processes are currently running in the default &lt;code&gt;rdomain 0&lt;/code&gt;. To use another &lt;code&gt;rdomain&lt;/code&gt;, the &lt;code&gt;route&lt;/code&gt; command can be used, like it has been seen previously. Let check that by spawning a &lt;a href="https://man.openbsd.org/man1/sleep.1" rel="noopener noreferrer"&gt;&lt;code&gt;sleep&lt;/code&gt;&lt;/a&gt; in the background for 10 seconds in the &lt;code&gt;rdomain 1&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;route &lt;span class="nt"&gt;-T1&lt;/span&gt; &lt;span class="nb"&gt;exec sleep &lt;/span&gt;10 &amp;amp;
&lt;span class="go"&gt;[1] 96416

&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;ps &lt;span class="nt"&gt;-o&lt;/span&gt; rtable,pid,ppid,%cpu,%mem,command
&lt;span class="go"&gt;RTABLE   PID  PPID %CPU %MEM COMMAND
     0 59603 14917  0.0  0.0 -ksh (ksh)
     0 13501 59603  0.0  0.2 tmux: client (/tmp/tmux-1000/default) (tmux)
     0 68852 66599  0.0  0.0 -ksh (ksh)
     0 73792 66599  0.0  0.0 -ksh (ksh)
     0 46155 73792  0.0  0.0 sleep 1
     0 75757 66599  0.0  0.0 -ksh (ksh)
     1 96416 75757  0.0  0.0 sleep 10
     0 26428 75757  0.0  0.1 ps -o rtable
     0 47120 66599  0.0  0.0 -ksh (ksh)
     0 86889 66599  0.0  0.0 -ksh (ksh)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;sleep&lt;/code&gt; process is correctly using the &lt;code&gt;rtable 1&lt;/code&gt;, but what kind of differences are existing between all of those routing tables? Well, the default routing table is initialized during the startup of the system, but all other &lt;code&gt;rdomain&lt;/code&gt; should be empty. Again, the &lt;code&gt;route&lt;/code&gt; command can be used to show that or the &lt;a href="https://man.openbsd.org/netstat.1" rel="noopener noreferrer"&gt;&lt;code&gt;netstat&lt;/code&gt;&lt;/a&gt; command can be used instead, it is offering more filtering options.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;netstat &lt;span class="nt"&gt;-rnT0&lt;/span&gt; &lt;span class="nt"&gt;-finet&lt;/span&gt;
&lt;span class="go"&gt;Routing tables

Internet:
Destination        Gateway            Flags   Refs      Use   Mtu  Prio Iface
default            192.168.123.254      UGS        9 10038979     -     8 re0
224/4              127.0.0.1          URS        0        0 32768     8 lo0
10.255.255.240/28  10.255.255.253     UCn        1        0     -     
&lt;/span&gt;&lt;span class="c"&gt;...
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An existing &lt;code&gt;rdomain 1&lt;/code&gt; is currently present on my test example. As you can see, the output returned by &lt;code&gt;netstat&lt;/code&gt; is totally different than the one from the &lt;code&gt;rdomain 1&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;netstat &lt;span class="nt"&gt;-rnT1&lt;/span&gt; &lt;span class="nt"&gt;-f&lt;/span&gt; inet
&lt;span class="go"&gt;Routing tables

Internet:
Destination        Gateway            Flags   Refs      Use   Mtu  Prio Iface
default            172.17.0.1         UGS        0    17202     -     8 wg0
10.255.255.240/28  10.255.255.254     UCn        1        0     -     4 pair1
10.255.255.253     fe:e1:ba:d5:62:48  UHLch      1        6     -     3 pair1
10.255.255.254     fe:e1:ba:d6:4a:44  UHLl       0        4     -     1 pair1
10.255.255.255     10.255.255.254     UHb        0        0     -     1 pair1
127.0.0.1          127.0.0.1          UHl        0      315 32768     1 lo1
&lt;/span&gt;&lt;span class="c"&gt;...
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;rdomain 2&lt;/code&gt; does not exist though, and when trying to show its content, an error is returned by &lt;code&gt;netstat&lt;/code&gt;. The same error is returned to any unitialized &lt;code&gt;rdomains&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;netstat &lt;span class="nt"&gt;-rnT2&lt;/span&gt;
&lt;span class="go"&gt;netstat: routing table 2: No such file or directory
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;netstat &lt;span class="nt"&gt;-rnT3&lt;/span&gt;
&lt;span class="go"&gt;netstat: routing table 3: No such file or directory
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;rdomain&lt;/code&gt;s can be created when dealing with network interfaces and pseudo devices. For example, let created &lt;code&gt;rdomain 2&lt;/code&gt; and &lt;code&gt;rdomain 3&lt;/code&gt; by defining &lt;code&gt;lo2&lt;/code&gt; and &lt;code&gt;lo3&lt;/code&gt; loopback interfaces.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas ifconfig lo2 create rdomain 2 &lt;span class="nb"&gt;alias &lt;/span&gt;127.0.0.1 up
&lt;span class="go"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas ifconfig lo2
&lt;span class="gp"&gt;lo2: flags=2008049&amp;lt;UP,LOOPBACK,RUNNING,MULTICAST,LRO&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;rdomain 2 mtu 32768
&lt;span class="go"&gt;        index 26 priority 0 llprio 3
        groups: lo
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo2 prefixlen 64 scopeid 0x1a
        inet 127.0.0.1 netmask 0xff000000
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas ifconfig lo3 create rdomain 3 &lt;span class="nb"&gt;alias &lt;/span&gt;127.0.0.1 up
&lt;span class="go"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas ifconfig lo3
&lt;span class="gp"&gt;lo3: flags=2008049&amp;lt;UP,LOOPBACK,RUNNING,MULTICAST,LRO&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;rdomain 3 mtu 32768
&lt;span class="go"&gt;        index 27 priority 0 llprio 3
        groups: lo
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo3 prefixlen 64 scopeid 0x1b
        inet 127.0.0.1 netmask 0xff000000
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both interfaces are totally isolated in their own address space, with its own routing table, this is why the same IP address (here &lt;code&gt;127.0.0.1&lt;/code&gt;) can be set. To extend the example, 2 &lt;code&gt;vether&lt;/code&gt; interfaces can be created as well.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas ifconfig vether2 create &lt;span class="nb"&gt;alias &lt;/span&gt;10.0.0.1/24 rdomain 2 up
&lt;span class="go"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;ifconfig vether2
&lt;span class="gp"&gt;vether2: flags=8843&amp;lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;rdomain 2 mtu 1500
&lt;span class="go"&gt;        lladdr fe:e1:ba:d9:1b:6c
        index 30 priority 0 llprio 3
        groups: vether
        media: Ethernet autoselect
        status: active
        inet 10.0.0.1 netmask 0xffffff00 broadcast 10.0.0.255
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas ifconfig vether3 create &lt;span class="nb"&gt;alias &lt;/span&gt;10.0.1.1/24 rdomain 3 up
&lt;span class="go"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;ifconfig vether3
&lt;span class="gp"&gt;vether3: flags=8843&amp;lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;rdomain 3 mtu 1500
&lt;span class="go"&gt;        lladdr fe:e1:ba:da:b5:73
        index 31 priority 0 llprio 3
        groups: vether
        media: Ethernet autoselect
        status: active
        inet 10.0.1.1 netmask 0xffffff00 broadcast 10.0.1.255
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To interconnect those networks 2 &lt;code&gt;pair&lt;/code&gt; interfaces can be created. A  small subnet will be create to route the packets between both networks.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas ifconfig pair2 create &lt;span class="nb"&gt;alias &lt;/span&gt;172.31.255.253/30 rdomain 2 up
&lt;span class="go"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;ifconfig pair2
&lt;span class="gp"&gt;pair2: flags=8843&amp;lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;rdomain 2 mtu 1500
&lt;span class="go"&gt;        lladdr fe:e1:ba:de:a4:28
        index 35 priority 0 llprio 3
        groups: pair
        media: Ethernet autoselect
        inet 172.31.255.253 netmask 0xfffffffc broadcast 172.31.255.255
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas ifconfig pair3 create &lt;span class="nb"&gt;alias &lt;/span&gt;172.31.255.254/30 rdomain 3 up 
&lt;span class="go"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;ifconfig pair3
&lt;span class="gp"&gt;pair3: flags=8843&amp;lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;rdomain 3 mtu 1500
&lt;span class="go"&gt;        lladdr fe:e1:ba:df:34:e5
        index 36 priority 0 llprio 3
        groups: pair
        media: Ethernet autoselect
        inet 172.31.255.254 netmask 0xfffffffc broadcast 172.31.255.255
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;pair&lt;/code&gt; interfaces must be patched together.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas ifconfig pair2 patch pair3
&lt;span class="go"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;ifconfig pair2
&lt;span class="gp"&gt;pair2: flags=8843&amp;lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;rdomain 2 mtu 1500
&lt;span class="go"&gt;        lladdr fe:e1:ba:de:a4:28
        index 35 priority 0 llprio 3
        patch: pair3
        groups: pair
        media: Ethernet autoselect
        status: active
        inet 172.31.255.253 netmask 0xfffffffc broadcast 172.31.255.255

&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;ifconfig pair3
&lt;span class="gp"&gt;pair3: flags=8843&amp;lt;UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST&amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;rdomain 3 mtu 1500
&lt;span class="go"&gt;        lladdr fe:e1:ba:df:34:e5
        index 36 priority 0 llprio 3
        patch: pair2
        groups: pair
        media: Ethernet autoselect
        status: active
        inet 172.31.255.254 netmask 0xfffffffc broadcast 172.31.255.25
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It should now be possible to reach &lt;code&gt;pair2&lt;/code&gt; network from &lt;code&gt;pair3&lt;/code&gt; and vice versa. The best way to check that is to use the &lt;code&gt;route exec&lt;/code&gt; command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;route &lt;span class="nt"&gt;-nT2&lt;/span&gt; &lt;span class="nb"&gt;exec &lt;/span&gt;ping &lt;span class="nt"&gt;-c&lt;/span&gt; 3 172.31.255.254
&lt;span class="go"&gt;PING 172.31.255.254 (172.31.255.254): 56 data bytes
64 bytes from 172.31.255.254: icmp_seq=0 ttl=255 time=0.615 ms
64 bytes from 172.31.255.254: icmp_seq=1 ttl=255 time=0.369 ms
64 bytes from 172.31.255.254: icmp_seq=2 ttl=255 time=0.382 ms

--- 172.31.255.254 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.369/0.455/0.615/0.113 ms

&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;route &lt;span class="nt"&gt;-nT3&lt;/span&gt; &lt;span class="nb"&gt;exec &lt;/span&gt;ping &lt;span class="nt"&gt;-c3&lt;/span&gt; 172.31.255.253
&lt;span class="go"&gt;PING 172.31.255.253 (172.31.255.253): 56 data bytes
64 bytes from 172.31.255.253: icmp_seq=0 ttl=255 time=0.352 ms
64 bytes from 172.31.255.253: icmp_seq=1 ttl=255 time=0.364 ms
64 bytes from 172.31.255.253: icmp_seq=2 ttl=255 time=0.378 ms

--- 172.31.255.253 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.352/0.364/0.378/0.011 ms

&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;route &lt;span class="nt"&gt;-nT3&lt;/span&gt; &lt;span class="nb"&gt;exec &lt;/span&gt;ping &lt;span class="nt"&gt;-c1&lt;/span&gt; 10.0.0.1
&lt;span class="go"&gt;PING 10.0.0.1 (10.0.0.1): 56 data bytes
ping: sendmsg: Can't assign requested address
ping: wrote 10.0.0.1 64 chars, ret=-1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;10.0.0.1/24&lt;/code&gt; and &lt;code&gt;10.0.1.0/24&lt;/code&gt; networks are not reachable yet, because no routes have been configured. Let fix that.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas route &lt;span class="nt"&gt;-nT2&lt;/span&gt; add 10.0.1.0/24 172.31.255.254
&lt;span class="go"&gt;add net 10.0.1.0/24: gateway 172.31.255.254

&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;netstat &lt;span class="nt"&gt;-rnfinet&lt;/span&gt; &lt;span class="nt"&gt;-T2&lt;/span&gt;
&lt;span class="go"&gt;Routing tables

Internet:
Destination        Gateway            Flags   Refs      Use   Mtu  Prio Iface
10.0.0/24          10.0.0.1           UCn        0        0     -     4 vether2
10.0.0.1           fe:e1:ba:d9:1b:6c  UHLl       0        8     -     1 vether2
10.0.0.255         10.0.0.1           UHb        0        0     -     1 vether2
10.0.1/24          172.31.255.254     UGS        0        0     -     8 pair2
127.0.0.1          127.0.0.1          UHl        0        0 32768     1 lo2
172.31.255.252/30  172.31.255.253     UCn        1        0     -     4 pair2
172.31.255.253     fe:e1:ba:de:a4:28  UHLl       0       10     -     1 pair2
172.31.255.254     fe:e1:ba:df:34:e5  UHLch      1       13     -     3 pair2
172.31.255.255     172.31.255.253     UHb        0        0     -     1 pair2
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas route &lt;span class="nt"&gt;-nT3&lt;/span&gt; add 10.0.0.0/24 172.31.255.253
&lt;span class="go"&gt;add net 10.0.0.0/24: gateway 172.31.255.253

&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;netstat &lt;span class="nt"&gt;-rnfinet&lt;/span&gt; &lt;span class="nt"&gt;-T3&lt;/span&gt;
&lt;span class="go"&gt;Routing tables

Internet:
Destination        Gateway            Flags   Refs      Use   Mtu  Prio Iface
10.0.0/24          172.31.255.253     UGS        0        2     -     8 pair3
10.0.1/24          10.0.1.1           UCn        0        0     -     4 vether3
10.0.1.1           fe:e1:ba:da:b5:73  UHLl       0        0     -     1 vether3
10.0.1.255         10.0.1.1           UHb        0        0     -     1 vether3
127.0.0.1          127.0.0.1          UHl        0        0 32768     1 lo3
172.31.255.252/30  172.31.255.254     UCn        1        0     -     4 pair3
172.31.255.253     fe:e1:ba:de:a4:28  UHLch      1        7     -     3 pair3
172.31.255.254     fe:e1:ba:df:34:e5  UHLl       0       14     -     1 pair3
172.31.255.255     172.31.255.254     UHb        0        0     -     1 pair3
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After having added these routes, both network are available.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;route &lt;span class="nt"&gt;-nT3&lt;/span&gt; &lt;span class="nb"&gt;exec &lt;/span&gt;ping &lt;span class="nt"&gt;-c3&lt;/span&gt; 10.0.0.1
&lt;span class="go"&gt;PING 10.0.0.1 (10.0.0.1): 56 data bytes
64 bytes from 10.0.0.1: icmp_seq=0 ttl=255 time=0.476 ms
64 bytes from 10.0.0.1: icmp_seq=1 ttl=255 time=0.371 ms
64 bytes from 10.0.0.1: icmp_seq=2 ttl=255 time=0.272 ms

--- 10.0.0.1 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.272/0.373/0.476/0.083 ms

&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;route &lt;span class="nt"&gt;-nT2&lt;/span&gt; &lt;span class="nb"&gt;exec &lt;/span&gt;ping &lt;span class="nt"&gt;-c3&lt;/span&gt; 10.0.1.1
&lt;span class="go"&gt;PING 10.0.1.1 (10.0.1.1): 56 data bytes
64 bytes from 10.0.1.1: icmp_seq=0 ttl=255 time=0.477 ms
64 bytes from 10.0.1.1: icmp_seq=1 ttl=255 time=0.355 ms
64 bytes from 10.0.1.1: icmp_seq=2 ttl=255 time=0.271 ms

--- 10.0.1.1 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.271/0.368/0.477/0.085 ms
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Managing one or two &lt;code&gt;rdomain&lt;/code&gt; can easily be done with packet-filter, but if you have more than that, it could become rapidly a complex task. While looking for more examples and use cases from the *BSD users, many authors were recommending using &lt;a href="https://man.openbsd.org/pf.conf#ANCHORS" rel="noopener noreferrer"&gt;packet-filter anchors&lt;/a&gt; to make the configuration easier to understand and to control. Let check that, if you don't know, packet-filter configuration file is located in &lt;code&gt;/etc/pf.conf&lt;/code&gt;, but before editing this file, two new &lt;code&gt;pflog&lt;/code&gt; interfaces will be required to log the packets from these domains.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas ifconfig pflog2 create up
&lt;span class="go"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas ifconfig pflog3 create up
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;rdomain 2&lt;/code&gt; ruleset will be managed by the &lt;code&gt;rd2&lt;/code&gt; anchor and the &lt;code&gt;rdomain 3&lt;/code&gt; will be managed by the &lt;code&gt;rd3&lt;/code&gt; anchor. Both of them will only have one rule for now, to log all packets in transit respectively to &lt;code&gt;pflog2&lt;/code&gt; and &lt;code&gt;pflog3&lt;/code&gt; pseudo interfaces.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="n"&gt;anchor&lt;/span&gt; &lt;span class="s2"&gt;"rd2"&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="n"&gt;rdomain&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt; {
  &lt;span class="n"&gt;match&lt;/span&gt; &lt;span class="n"&gt;log&lt;/span&gt; (&lt;span class="n"&gt;all&lt;/span&gt;, &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;pflog2&lt;/span&gt;)
}

&lt;span class="n"&gt;anchor&lt;/span&gt; &lt;span class="s2"&gt;"rd3"&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="n"&gt;rdomain&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt; {
  &lt;span class="n"&gt;match&lt;/span&gt; &lt;span class="n"&gt;log&lt;/span&gt; (&lt;span class="n"&gt;all&lt;/span&gt;, &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;pflog3&lt;/span&gt;)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas pfctl &lt;span class="nt"&gt;-f&lt;/span&gt; /etc/pf.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is another great feature available by default with packet-filter, instead of having text logs output, the typical logs messages when using &lt;a href="https://manpages.debian.org/trixie/iptables/iptables.8.en.html" rel="noopener noreferrer"&gt;&lt;code&gt;iptables&lt;/code&gt;&lt;/a&gt; or &lt;a href="https://manpages.debian.org/trixie/nftables/nftables.8.en.html" rel="noopener noreferrer"&gt;&lt;code&gt;nftables&lt;/code&gt;&lt;/a&gt; on Linux systems, the packets are directly duplicated to a dedicated interfaces, compatible with &lt;a href="https://man.openbsd.org/tcpdump" rel="noopener noreferrer"&gt;&lt;code&gt;tcpdump&lt;/code&gt;&lt;/a&gt; and giving us the possibility to export them in PCAP format.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas tcpdump &lt;span class="nt"&gt;-i&lt;/span&gt; pflog2
&lt;span class="go"&gt;tcpdump: listening on pflog2, link-type PFLOG
&lt;/span&gt;&lt;span class="gp"&gt;13:49:03.419153 172.31.255.253 &amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;10.0.1.1: icmp: &lt;span class="nb"&gt;echo &lt;/span&gt;request
&lt;span class="gp"&gt;13:49:03.419380 10.0.1.1 &amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;172.31.255.253: icmp: &lt;span class="nb"&gt;echo &lt;/span&gt;reply
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas tcpdump &lt;span class="nt"&gt;-i&lt;/span&gt; pflog3
&lt;span class="go"&gt;tcpdump: listening on pflog3, link-type PFLOG
&lt;/span&gt;&lt;span class="gp"&gt;13:49:03.419267 172.31.255.253 &amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;10.0.1.1: icmp: &lt;span class="nb"&gt;echo &lt;/span&gt;request
&lt;span class="gp"&gt;13:49:03.419330 10.0.1.1 &amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;172.31.255.253: icmp: &lt;span class="nb"&gt;echo &lt;/span&gt;reply
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The packets displayed in the &lt;code&gt;tcpdump&lt;/code&gt; output have been generated by a simple &lt;code&gt;ping&lt;/code&gt; command. As you can see, we have know a way to understand more deeply what can happen on each &lt;code&gt;rdomain&lt;/code&gt; previously created.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;route &lt;span class="nt"&gt;-nT2&lt;/span&gt; &lt;span class="nb"&gt;exec &lt;/span&gt;ping &lt;span class="nt"&gt;-c1&lt;/span&gt; 10.0.1.1
&lt;span class="go"&gt;PING 10.0.1.1 (10.0.1.1): 56 data bytes
64 bytes from 10.0.1.1: icmp_seq=0 ttl=255 time=0.479 ms

--- 10.0.1.1 ping statistics ---
1 packets transmitted, 1 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 0.479/0.479/0.479/0.000 ms
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One question to ask is if it is possible to forward packets from one &lt;code&gt;rdomain&lt;/code&gt; to another via packet-filter. Indeed, the configuration support &lt;code&gt;on rdomain NUMBER&lt;/code&gt; and &lt;code&gt;rtable NUMBER&lt;/code&gt; parameters, so, it should be possible to achieve. To test this the &lt;code&gt;pair&lt;/code&gt; interfaces previously created must be destroyed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas ifconfig pair2 destroy
&lt;span class="go"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas ifconfig pair3 destroy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Be sure the loopback interfaces (&lt;code&gt;lo2&lt;/code&gt; and &lt;code&gt;lo3&lt;/code&gt; in this example) are not skipped, the firewall must have the control on all traffic on these &lt;code&gt;rdomain&lt;/code&gt;s. When an ICMP packet is sent on &lt;code&gt;rdomain 2&lt;/code&gt;, it will be redirected to &lt;code&gt;rdomain 3&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="n"&gt;anchor&lt;/span&gt; &lt;span class="s2"&gt;"rd2"&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="n"&gt;rdomain&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt; {
  &lt;span class="n"&gt;match&lt;/span&gt; &lt;span class="n"&gt;log&lt;/span&gt; (&lt;span class="n"&gt;all&lt;/span&gt;, &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;pflog2&lt;/span&gt;)
  &lt;span class="n"&gt;pass&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="n"&gt;inet&lt;/span&gt; &lt;span class="n"&gt;proto&lt;/span&gt; &lt;span class="n"&gt;icmp&lt;/span&gt; \
    &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;.&lt;span class="m"&gt;1&lt;/span&gt; \
    &lt;span class="n"&gt;rtable&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt; \
    &lt;span class="n"&gt;rdr&lt;/span&gt;-&lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;.&lt;span class="m"&gt;1&lt;/span&gt;.&lt;span class="m"&gt;1&lt;/span&gt;
}

&lt;span class="n"&gt;anchor&lt;/span&gt; &lt;span class="s2"&gt;"rd3"&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="n"&gt;rdomain&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt; {
  &lt;span class="n"&gt;match&lt;/span&gt; &lt;span class="n"&gt;log&lt;/span&gt; (&lt;span class="n"&gt;all&lt;/span&gt;, &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;pflog3&lt;/span&gt;)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas pfctl &lt;span class="nt"&gt;-f&lt;/span&gt; /etc/pf.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;route &lt;span class="nt"&gt;-nT2&lt;/span&gt; &lt;span class="nb"&gt;exec &lt;/span&gt;ping &lt;span class="nt"&gt;-c&lt;/span&gt; 1 10.0.0.1
&lt;span class="go"&gt;PING 10.0.0.1 (10.0.0.1): 56 data bytes
&lt;/span&gt;&lt;span class="c"&gt;...
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas tcpdump &lt;span class="nt"&gt;-i&lt;/span&gt; pflog2
&lt;span class="gp"&gt;14:17:19.787826 10.0.0.1 &amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;10.0.0.1: icmp: &lt;span class="nb"&gt;echo &lt;/span&gt;request
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas tcpdump &lt;span class="nt"&gt;-i&lt;/span&gt; pflog3
&lt;span class="gp"&gt;14:17:19.788009 10.0.0.1 &amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;10.0.1.1: icmp: &lt;span class="nb"&gt;echo &lt;/span&gt;request
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Without a route to &lt;code&gt;10.0.1.1/24&lt;/code&gt;, previously removed alongside the &lt;code&gt;pair&lt;/code&gt; interfaces, it fails. Packet-filter will do the redirection anyway because it can switch from different routing tables and domains. It means the packet from &lt;code&gt;10.0.0.1&lt;/code&gt; is correctly forwarded to the &lt;code&gt;10.0.1.1&lt;/code&gt; address. Unfortunately, &lt;code&gt;10.0.1.1&lt;/code&gt; can't reply to &lt;code&gt;10.0.0.1&lt;/code&gt; because it does not have it in its own table. ICMP is perhaps not the best protocol to do those kind of redirection because it is stateless, and it can become very complex to manage the redirection. It is possible to generate an ICMP reply quite easily though, even without a correct routing table.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="n"&gt;anchor&lt;/span&gt; &lt;span class="s2"&gt;"rd2"&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="n"&gt;rdomain&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt; {
  &lt;span class="n"&gt;match&lt;/span&gt; &lt;span class="n"&gt;log&lt;/span&gt; (&lt;span class="n"&gt;all&lt;/span&gt;, &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;pflog2&lt;/span&gt;)
  &lt;span class="n"&gt;pass&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="n"&gt;inet&lt;/span&gt; &lt;span class="n"&gt;proto&lt;/span&gt; &lt;span class="n"&gt;icmp&lt;/span&gt; \
    &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;.&lt;span class="m"&gt;1&lt;/span&gt; \
    &lt;span class="n"&gt;icmp&lt;/span&gt;-&lt;span class="n"&gt;type&lt;/span&gt; &lt;span class="n"&gt;echoreq&lt;/span&gt; \
    &lt;span class="n"&gt;rtable&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt; \
    &lt;span class="n"&gt;rdr&lt;/span&gt;-&lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;.&lt;span class="m"&gt;1&lt;/span&gt;.&lt;span class="m"&gt;1&lt;/span&gt;
}

&lt;span class="n"&gt;anchor&lt;/span&gt; &lt;span class="s2"&gt;"rd3"&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="n"&gt;rdomain&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt; {
  &lt;span class="n"&gt;match&lt;/span&gt; &lt;span class="n"&gt;log&lt;/span&gt; (&lt;span class="n"&gt;all&lt;/span&gt;, &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;pflog3&lt;/span&gt;)
  &lt;span class="n"&gt;pass&lt;/span&gt; &lt;span class="n"&gt;in&lt;/span&gt; &lt;span class="n"&gt;inet&lt;/span&gt; &lt;span class="n"&gt;proto&lt;/span&gt; &lt;span class="n"&gt;icmp&lt;/span&gt; \
    &lt;span class="n"&gt;from&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;.&lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;.&lt;span class="m"&gt;1&lt;/span&gt;.&lt;span class="m"&gt;1&lt;/span&gt; \
    &lt;span class="n"&gt;icmp&lt;/span&gt;-&lt;span class="n"&gt;type&lt;/span&gt; &lt;span class="n"&gt;echoreq&lt;/span&gt; \
    &lt;span class="n"&gt;rtable&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt; \
    &lt;span class="n"&gt;rdr&lt;/span&gt;-&lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;.&lt;span class="m"&gt;1&lt;/span&gt;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;route &lt;span class="nt"&gt;-nT2&lt;/span&gt; &lt;span class="nb"&gt;exec &lt;/span&gt;ping &lt;span class="nt"&gt;-c&lt;/span&gt; 1 10.0.0.1
&lt;span class="go"&gt;PING 10.0.0.1 (10.0.0.1): 56 data bytes
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas tcpdump &lt;span class="nt"&gt;-i&lt;/span&gt; pflog2
&lt;span class="gp"&gt;14:55:06.725461 10.0.0.1 &amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;10.0.0.1: icmp: &lt;span class="nb"&gt;echo &lt;/span&gt;request
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas tcpdump &lt;span class="nt"&gt;-i&lt;/span&gt; pflog3
&lt;span class="gp"&gt;14:55:06.725640 10.0.0.1 &amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;10.0.1.1: icmp: &lt;span class="nb"&gt;echo &lt;/span&gt;request
&lt;span class="gp"&gt;14:55:06.725780 10.0.1.1 &amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;10.0.0.1: icmp: &lt;span class="nb"&gt;echo &lt;/span&gt;reply
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this last example, it is possible to redirect a packet from one &lt;code&gt;rdomain&lt;/code&gt; to another, but it is probably not the best idea to that in this way, because the rules will become quickly hard to understand. Regarding the anchors, one can also use another alternative syntax by passing the &lt;code&gt;rdomain&lt;/code&gt; to each rules, like the code snippet below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="n"&gt;match&lt;/span&gt; &lt;span class="n"&gt;log&lt;/span&gt; (&lt;span class="n"&gt;all&lt;/span&gt;, &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;pflog2&lt;/span&gt;) &lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="n"&gt;rdomain&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;
&lt;span class="n"&gt;pass&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="n"&gt;rdomain&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt; &lt;span class="n"&gt;inet&lt;/span&gt; &lt;span class="n"&gt;proto&lt;/span&gt; &lt;span class="n"&gt;icmp&lt;/span&gt; \
  &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;.&lt;span class="m"&gt;1&lt;/span&gt; \
  &lt;span class="n"&gt;icmp&lt;/span&gt;-&lt;span class="n"&gt;type&lt;/span&gt; &lt;span class="n"&gt;echoreq&lt;/span&gt; \
  &lt;span class="n"&gt;rtable&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt; \
  &lt;span class="n"&gt;rdr&lt;/span&gt;-&lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;.&lt;span class="m"&gt;1&lt;/span&gt;.&lt;span class="m"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  VPN Server Configuration
&lt;/h1&gt;

&lt;p&gt;The VPN server will act as the default router for the workers present behind the firewall they are connected to. This server is already quite busy, many services like OpenVPN, Tinc, and few others are already present and running. The private network attributed to all those services were taken randomly, and it's a small mess. To avoid confusion, only the rules for the VPN using Wireguard will be presented, in their own &lt;code&gt;rdomain&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas ifconfig lo1 create rdomain 1 &lt;span class="nb"&gt;alias &lt;/span&gt;127.0.0.1 up
&lt;span class="go"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; | doas &lt;span class="nb"&gt;tee&lt;/span&gt; /etc/hostname.lo1 &amp;lt; EOF
&lt;span class="go"&gt;rdomain 1
alias 127.0.0.1
up
EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Because &lt;code&gt;rdomain 1&lt;/code&gt; is totally isolated from &lt;code&gt;rdomain 0&lt;/code&gt; where the &lt;code&gt;vio0&lt;/code&gt; interface is present, it is necessary to create an interconnection network between them. The best way is to create 2 &lt;code&gt;pair&lt;/code&gt; interfaces. The subnet will be set to &lt;code&gt;10.255.255.250/30&lt;/code&gt;. &lt;code&gt;pair0&lt;/code&gt; will stay in &lt;code&gt;rdomain 0&lt;/code&gt;, and will give knowledge to the routes available on &lt;code&gt;rdomain 1&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas ifconfig pair0 create rdomain 0 up
&lt;span class="go"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; | doas &lt;span class="nb"&gt;tee&lt;/span&gt; /etc/hostname.pair0 &amp;lt; EOF
&lt;span class="go"&gt;inet 10.255.255.253/30
patch pair1
up
!route add 172.17.0.0/24 10.255.255.254
!route add 172.16.0.0/24 10.255.255.254
EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;pair1&lt;/code&gt; will be pushed in &lt;code&gt;rdomain 1&lt;/code&gt; and like &lt;code&gt;pair0&lt;/code&gt;, it will announce the route available on its side.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas ifconfig pair1 create rdomain 1 up
&lt;span class="go"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; | doas &lt;span class="nb"&gt;tee&lt;/span&gt; /etc/hostname.pair1 &amp;lt; EOF
&lt;span class="go"&gt;rdomain 1
inet 10.255.255.254/30
up
!route -T1 add default 10.255.255.253
EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this pseudo interface configured, it is now possible to reach the network(s) present in &lt;code&gt;rdomain 1&lt;/code&gt;. Let configures the VPN with a wireguard pseudo interface. The following snippet hides the private information to avoid leaks, but the idea is quite simple.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;generate a private key using &lt;code&gt;openssl&lt;/code&gt; from a random integer encoded in base64;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;use a new random port (let say it will be 12345 for the rest of the configuration) using &lt;code&gt;openssl&lt;/code&gt; as well;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;add the public key from the firewall (it will be shown in the next part)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;configure the end-point, in our case, it will be the public address of my firewall, let say 1.2.3.4 for now;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;creates the &lt;code&gt;wg0&lt;/code&gt; interface using &lt;code&gt;ifconfig&lt;/code&gt; containing the previously created parameters. Set also the &lt;code&gt;wgaip&lt;/code&gt; to explicitly allow the IP address from the firewall;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;finally, create the &lt;code&gt;/etc/hostname.wg0&lt;/code&gt; file containing the very same information to recreate automatically the VPN after a reboot.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;server_wgkey&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;openssl rand &lt;span class="nt"&gt;-base64&lt;/span&gt; 32&lt;span class="si"&gt;)&lt;/span&gt;
&lt;span class="go"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;server_wgport&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s2"&gt;"%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="s2"&gt;"0x&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;openssl rand &lt;span class="nt"&gt;-hex&lt;/span&gt; 2&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
&lt;span class="go"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;server_wgpeer&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;firewall_public_key&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="go"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;server_wgendpoint&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;firewall_ip_address&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="go"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas ifconfig wg0 create wgport &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;server_wgport&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="gp"&gt;  wgkey $&lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;server_wgkey&lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="gp"&gt;  wgpeer $&lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;server_wgpeer&lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="go"&gt;  wgaip 172.17.0.2/32 \
  wgaip 172.16.0.0/24 \
&lt;/span&gt;&lt;span class="gp"&gt;  wgendpoint $&lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;server_wgendpoint&lt;span class="o"&gt;}&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="go"&gt;  172.17.0.1/24 \
  rdomain 1 \
  up

&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; | doas &lt;span class="nb"&gt;tee&lt;/span&gt; /etc/hostname.wg0 &amp;lt; EOF
&lt;span class="gp"&gt;wgport $&lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;server_wgport&lt;span class="o"&gt;}&lt;/span&gt; wgkey &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;server_wgkey&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;
&lt;span class="gp"&gt;wgpeer $&lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;server_wgpeer&lt;span class="o"&gt;}&lt;/span&gt; wgaip 172.17.0.2/32 wgaip 172.16.0.0/24
&lt;span class="gp"&gt;wgendpoint $&lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;server_wgendpoint&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="go"&gt;172.17.0.1/24
rdomain 1
up
!route -T1 add 172.16.0.0/24 172.17.0.2
EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Having a dedicated &lt;code&gt;pflog&lt;/code&gt; interface for this &lt;code&gt;rdomain&lt;/code&gt; can also be helpful, so, one can create the &lt;code&gt;pflog1&lt;/code&gt; interface.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas ifconfig pflog1 create up
&lt;span class="go"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; | doas &lt;span class="nb"&gt;tee&lt;/span&gt; /etc/hostname.pflog1 &amp;lt; EOF
&lt;span class="go"&gt;up
EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The configuration is practically over, packet-filter configuration will be the last step. The first part of this configuration will ensure the packets from the VPN are correctly translated to the public address set on the &lt;code&gt;vio0&lt;/code&gt; interface. In short, addresses from the worker network will use the public address of this server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="n"&gt;match&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="n"&gt;rdomain&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; \
  &lt;span class="n"&gt;from&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;.&lt;span class="m"&gt;255&lt;/span&gt;.&lt;span class="m"&gt;255&lt;/span&gt;.&lt;span class="m"&gt;253&lt;/span&gt;/&lt;span class="m"&gt;28&lt;/span&gt; \
  &lt;span class="n"&gt;nat&lt;/span&gt;-&lt;span class="n"&gt;to&lt;/span&gt; (&lt;span class="n"&gt;vio0&lt;/span&gt;) &lt;span class="n"&gt;static&lt;/span&gt;-&lt;span class="n"&gt;port&lt;/span&gt;

&lt;span class="n"&gt;match&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="n"&gt;rdomain&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; \
  &lt;span class="n"&gt;from&lt;/span&gt; &lt;span class="m"&gt;172&lt;/span&gt;.&lt;span class="m"&gt;17&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;/&lt;span class="m"&gt;24&lt;/span&gt; \
  &lt;span class="n"&gt;rtable&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; \
  &lt;span class="n"&gt;nat&lt;/span&gt;-&lt;span class="n"&gt;to&lt;/span&gt; (&lt;span class="n"&gt;vio0&lt;/span&gt;) &lt;span class="n"&gt;static&lt;/span&gt;-&lt;span class="n"&gt;port&lt;/span&gt;

&lt;span class="n"&gt;match&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="n"&gt;rdomain&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; \
  &lt;span class="n"&gt;from&lt;/span&gt; &lt;span class="m"&gt;172&lt;/span&gt;.&lt;span class="m"&gt;16&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;/&lt;span class="m"&gt;24&lt;/span&gt; \
  &lt;span class="n"&gt;rtable&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; \
  &lt;span class="n"&gt;nat&lt;/span&gt;-&lt;span class="n"&gt;to&lt;/span&gt; (&lt;span class="n"&gt;vio0&lt;/span&gt;) &lt;span class="n"&gt;static&lt;/span&gt;-&lt;span class="n"&gt;port&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;DNS resolution can be a problem, and to avoid DNS leaks, all packets from the worker network will be redirected to a local &lt;code&gt;unbound&lt;/code&gt; instance, in charge of doing the domain resolution. It will also be easier to see what kind of queries are sent to domain servers and to filter them in one place.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="n"&gt;match&lt;/span&gt; &lt;span class="n"&gt;in&lt;/span&gt; &lt;span class="n"&gt;log&lt;/span&gt; (&lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;pflog1&lt;/span&gt;) &lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="n"&gt;rdomain&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; \
  &lt;span class="n"&gt;proto&lt;/span&gt; {&lt;span class="n"&gt;tcp&lt;/span&gt;, &lt;span class="n"&gt;udp&lt;/span&gt;} \
  &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="m"&gt;53&lt;/span&gt; \
  &lt;span class="n"&gt;rtable&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; \
  &lt;span class="n"&gt;rdr&lt;/span&gt;-&lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="m"&gt;127&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;.&lt;span class="m"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Packet-filter is blocking all traffic by default. Wireguard needs to have its port accessible to other nodes though, then, the port previously create will be opened.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="n"&gt;pass&lt;/span&gt; &lt;span class="n"&gt;in&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="n"&gt;vio0&lt;/span&gt; &lt;span class="n"&gt;proto&lt;/span&gt; &lt;span class="n"&gt;udp&lt;/span&gt; \
  &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="m"&gt;12345&lt;/span&gt; \
  &lt;span class="n"&gt;label&lt;/span&gt; &lt;span class="s2"&gt;"wireguard vpn"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, the last rules are only for &lt;code&gt;rdomain 1&lt;/code&gt;. All packets are blocked and logged by default in this &lt;code&gt;rdomain&lt;/code&gt;. ICMP and few TCP ports are allowed though, for SSH, HTTP and HTTPS.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="n"&gt;anchor&lt;/span&gt; &lt;span class="s2"&gt;"workers"&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="n"&gt;rdomain&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; {
  &lt;span class="n"&gt;block&lt;/span&gt; &lt;span class="n"&gt;log&lt;/span&gt; (&lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;pflog1&lt;/span&gt;)
  &lt;span class="n"&gt;pass&lt;/span&gt; &lt;span class="n"&gt;inet&lt;/span&gt; &lt;span class="n"&gt;proto&lt;/span&gt; &lt;span class="n"&gt;icmp&lt;/span&gt;
  &lt;span class="n"&gt;pass&lt;/span&gt; &lt;span class="n"&gt;inet&lt;/span&gt; &lt;span class="n"&gt;proto&lt;/span&gt; &lt;span class="n"&gt;tcp&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt; {&lt;span class="m"&gt;22&lt;/span&gt;, &lt;span class="m"&gt;80&lt;/span&gt;, &lt;span class="m"&gt;443&lt;/span&gt;} &lt;span class="n"&gt;keep&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Packet-filter configuration can be reloaded or restarted.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas pfctl &lt;span class="nt"&gt;-nf&lt;/span&gt; /etc/pf.conf
&lt;span class="go"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas pfctl &lt;span class="nt"&gt;-f&lt;/span&gt; /etc/pf.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this configuration, any nodes connected to wireguard will use the IP address of the server instead of their own (or the IP address of their routers). Especially useful if your workers are running in private place and you don't want to share your real IP address to Gitlab (or any other provider).&lt;/p&gt;

&lt;p&gt;Fixing the right access to the hostname.if files can also be a good idea.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas &lt;span class="nb"&gt;chmod &lt;/span&gt;600 /etc/hostname.&lt;span class="k"&gt;*&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Firewall Configuration
&lt;/h1&gt;

&lt;p&gt;The firewall will be way easier to configure, the process will be similar than the one for the server. At first, creating a loopback interface for &lt;code&gt;rdomain 1&lt;/code&gt; can help.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; | doas &lt;span class="nb"&gt;tee&lt;/span&gt; /etc/hostname.lo1 &amp;lt; EOF
&lt;span class="go"&gt;rdomain 1
alias 127.0.0.1
up
EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The main physical interface called &lt;code&gt;re1&lt;/code&gt; will be put in &lt;code&gt;rdomain 1&lt;/code&gt;, and will not be configured. The IP address will be set on a &lt;code&gt;vether&lt;/code&gt; pseudo interface created during the next step.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; | doas &lt;span class="nb"&gt;tee&lt;/span&gt; /etc/hostname.re1 &amp;lt; EOF
&lt;span class="go"&gt;rdomain 1
up
EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;vether0&lt;/code&gt; is the main interface for &lt;code&gt;rdomain 1&lt;/code&gt;. It is the gateway for the workers' network and will be put in &lt;code&gt;rdomain 1&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; | doas &lt;span class="nb"&gt;tee&lt;/span&gt; /etc/hostname.vether0 &amp;lt; EOF
&lt;span class="go"&gt;rdomain 1
inet 172.16.0.1/24
up
EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A bridge called &lt;code&gt;bridge0&lt;/code&gt; will be used to interconnect &lt;code&gt;vether0&lt;/code&gt; and &lt;code&gt;re1&lt;/code&gt;, and will be put also in &lt;code&gt;rdomain 1&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; | doas &lt;span class="nb"&gt;tee&lt;/span&gt; /etc/hostname.bridge0 &amp;lt; EOF
&lt;span class="go"&gt;add vether0
add re1
rdomain 1
up
EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;My private network should have access to the workers' network, for monitoring and maintenance purpose. The workers will not be allowed to pass there though, this rule will be enforced in packet filter. Anyway, a small interconnection network will be created and set on &lt;code&gt;pair0&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; | doas &lt;span class="nb"&gt;tee&lt;/span&gt; /etc/hostname.pair0 &amp;lt; EOF
&lt;span class="go"&gt;inet 10.255.255.253/30
rdomain 0
patch pair1
up
!route add 172.16.0/24 10.255.255.254
EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;pair1&lt;/code&gt; will also be created and connected to &lt;code&gt;pair0&lt;/code&gt;. This time, &lt;code&gt;pair1&lt;/code&gt; will be put in &lt;code&gt;rdomain 1&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; | doas &lt;span class="nb"&gt;tee&lt;/span&gt; /etc/hostname.pair1 &amp;lt; EOF
&lt;span class="go"&gt;inet 10.255.255.254/30
rdomain 1
up
&lt;/span&gt;&lt;span class="gp"&gt;!route -T1 add $&lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;local_private_network&lt;span class="o"&gt;}&lt;/span&gt; 10.255.255.253
&lt;span class="go"&gt;EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A wireguard &lt;code&gt;wg0&lt;/code&gt; speudo interface is also required to connect the firewall to the VPN. The procedure is the very same than before, except the information are created for the firewall this time, and not for the server. &lt;code&gt;wgaip&lt;/code&gt; parameter is also set to &lt;code&gt;0.0.0.0/0&lt;/code&gt; to allow any network to pass through the VPN, very useful if the VPN will be set as default gateway.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;fw_wgkey&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;openssl rand &lt;span class="nt"&gt;-base64&lt;/span&gt; 32&lt;span class="si"&gt;)&lt;/span&gt;
&lt;span class="go"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;fw_wgport&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s2"&gt;"%d&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="s2"&gt;"0x&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;openssl rand &lt;span class="nt"&gt;-hex&lt;/span&gt; 2&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;
&lt;span class="go"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;fw_wgpeer&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;server_public_key&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="go"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;fw_wgendpoint&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;server_ip_address&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="go"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; | doas &lt;span class="nb"&gt;tee&lt;/span&gt; /etc/hostname.wg0 &amp;lt; EOF
&lt;span class="gp"&gt;wgport $&lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;fw_wgport&lt;span class="o"&gt;}&lt;/span&gt; wgkey &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;server_wgkey&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;
&lt;span class="gp"&gt;wgpeer $&lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;fw_wgpeer&lt;span class="o"&gt;}&lt;/span&gt; wgaip 0.0.0.0/0
&lt;span class="gp"&gt;wgendpoint $&lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;server_wgendpoint&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="go"&gt;172.17.0.2/24
rdomain 1
up
!route -T1 add default 172.17.0.1
EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, the packet-filter configuration present in &lt;code&gt;/etc/pf.conf&lt;/code&gt;. The first part defines the macros. Classic.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="n"&gt;worker_if&lt;/span&gt; = &lt;span class="s2"&gt;"{ re1, bridge0, vether0 }"&lt;/span&gt;
&lt;span class="n"&gt;worker_network&lt;/span&gt; = &lt;span class="s2"&gt;"172.16.0.0/24"&lt;/span&gt;
&lt;span class="n"&gt;worker_gateway&lt;/span&gt; = &lt;span class="err"&gt;"&lt;/span&gt;&lt;span class="m"&gt;172&lt;/span&gt;.&lt;span class="m"&gt;16&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;.&lt;span class="m"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To avoid leaks, all packets from the workers' network will be dropped and not allowed to pass through the outgoing interface &lt;code&gt;re0&lt;/code&gt;. This is probably not necessary here, because in the full configuration a &lt;code&gt;block log&lt;/code&gt; is also present, and should block these connections.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="n"&gt;block&lt;/span&gt; &lt;span class="n"&gt;drop&lt;/span&gt; &lt;span class="n"&gt;log&lt;/span&gt; \
  &lt;span class="n"&gt;on&lt;/span&gt; $&lt;span class="n"&gt;worker_if&lt;/span&gt; \
  &lt;span class="n"&gt;from&lt;/span&gt; $&lt;span class="n"&gt;worker_network&lt;/span&gt; \
  &lt;span class="n"&gt;to&lt;/span&gt; (&lt;span class="n"&gt;re0&lt;/span&gt;)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The connections from the private network (here set to &lt;code&gt;! $worker_network&lt;/code&gt; but it could be set with a network) are allowed to reach the workers' network with a small subset of protocols, including ICMP, SSH, HTTP and HTTPS.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="n"&gt;pass&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="n"&gt;pair&lt;/span&gt; &lt;span class="n"&gt;inet&lt;/span&gt; &lt;span class="n"&gt;proto&lt;/span&gt; &lt;span class="n"&gt;icmp&lt;/span&gt; \
  &lt;span class="n"&gt;from&lt;/span&gt; ! $&lt;span class="n"&gt;worker_network&lt;/span&gt; \
  &lt;span class="n"&gt;to&lt;/span&gt; $&lt;span class="n"&gt;worker_network&lt;/span&gt;

&lt;span class="n"&gt;pass&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="n"&gt;pair&lt;/span&gt; &lt;span class="n"&gt;inet&lt;/span&gt; &lt;span class="n"&gt;proto&lt;/span&gt; &lt;span class="n"&gt;tcp&lt;/span&gt; \
  &lt;span class="n"&gt;from&lt;/span&gt; ! $&lt;span class="n"&gt;worker_network&lt;/span&gt; \
  &lt;span class="n"&gt;to&lt;/span&gt; $&lt;span class="n"&gt;worker_network&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt; {&lt;span class="m"&gt;22&lt;/span&gt;, &lt;span class="m"&gt;80&lt;/span&gt;, &lt;span class="m"&gt;443&lt;/span&gt;}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, the core configuration for &lt;code&gt;rdomain 1&lt;/code&gt; contains the rules filter the connections for the workers:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;an explicit &lt;code&gt;block&lt;/code&gt; is redefined, so, by default, everything is blocked;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;the private network is allowed to use SSH, HTTP and HTTPS in the workers' network;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;the workers are allowed to use ICMP&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;the workers are allowed to use SSH, HTTP and HTTPS;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;only worker nodes are allowed to use &lt;code&gt;bridge0&lt;/code&gt;;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;only worker nodes are allowed to use &lt;code&gt;wg0&lt;/code&gt;;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;workers nodes have the right to connect to the gateway via HTTP;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;all DNS queries are forwarded automatically to the VPN via the VPN gateway (&lt;code&gt;172.17.0.1&lt;/code&gt;);&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;NTP connections are locally forwarded to an instance of &lt;code&gt;ntpd&lt;/code&gt; running on the firewall.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="n"&gt;anchor&lt;/span&gt; &lt;span class="s2"&gt;"workers"&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="n"&gt;rdomain&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; {
  &lt;span class="n"&gt;block&lt;/span&gt; &lt;span class="n"&gt;log&lt;/span&gt; (&lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;pflog1&lt;/span&gt;)

  &lt;span class="n"&gt;pass&lt;/span&gt; &lt;span class="n"&gt;inet&lt;/span&gt; &lt;span class="n"&gt;proto&lt;/span&gt; &lt;span class="n"&gt;tcp&lt;/span&gt; \
    &lt;span class="n"&gt;from&lt;/span&gt; ! $&lt;span class="n"&gt;worker_network&lt;/span&gt; \
    &lt;span class="n"&gt;to&lt;/span&gt; $&lt;span class="n"&gt;worker_network&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt; {&lt;span class="m"&gt;22&lt;/span&gt;, &lt;span class="m"&gt;80&lt;/span&gt;, &lt;span class="m"&gt;443&lt;/span&gt;}

  &lt;span class="n"&gt;pass&lt;/span&gt; &lt;span class="n"&gt;inet&lt;/span&gt; &lt;span class="n"&gt;proto&lt;/span&gt; &lt;span class="n"&gt;icmp&lt;/span&gt;

  &lt;span class="n"&gt;pass&lt;/span&gt; &lt;span class="n"&gt;inet&lt;/span&gt; &lt;span class="n"&gt;proto&lt;/span&gt; &lt;span class="n"&gt;tcp&lt;/span&gt; \
    &lt;span class="n"&gt;from&lt;/span&gt; $&lt;span class="n"&gt;worker_network&lt;/span&gt; \
    &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt; {&lt;span class="m"&gt;22&lt;/span&gt;, &lt;span class="m"&gt;80&lt;/span&gt;, &lt;span class="m"&gt;443&lt;/span&gt;} \
    &lt;span class="n"&gt;keep&lt;/span&gt; &lt;span class="n"&gt;state&lt;/span&gt;

  &lt;span class="n"&gt;pass&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="n"&gt;bridge0&lt;/span&gt; \
    &lt;span class="n"&gt;from&lt;/span&gt; $&lt;span class="n"&gt;worker_network&lt;/span&gt;

  &lt;span class="n"&gt;pass&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt; &lt;span class="n"&gt;wg0&lt;/span&gt; \
    &lt;span class="n"&gt;from&lt;/span&gt; $&lt;span class="n"&gt;worker_network&lt;/span&gt;

  &lt;span class="n"&gt;pass&lt;/span&gt; &lt;span class="n"&gt;inet&lt;/span&gt; &lt;span class="n"&gt;proto&lt;/span&gt; &lt;span class="n"&gt;tcp&lt;/span&gt; \
    &lt;span class="n"&gt;from&lt;/span&gt; $&lt;span class="n"&gt;worker_network&lt;/span&gt; \
    &lt;span class="n"&gt;to&lt;/span&gt; $&lt;span class="n"&gt;worker_gateway&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="m"&gt;80&lt;/span&gt;

  &lt;span class="n"&gt;pass&lt;/span&gt; &lt;span class="n"&gt;in&lt;/span&gt; &lt;span class="n"&gt;inet&lt;/span&gt; &lt;span class="n"&gt;proto&lt;/span&gt; {&lt;span class="n"&gt;tcp&lt;/span&gt;, &lt;span class="n"&gt;udp&lt;/span&gt;} \
    &lt;span class="n"&gt;from&lt;/span&gt; &lt;span class="m"&gt;172&lt;/span&gt;.&lt;span class="m"&gt;16&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;/&lt;span class="m"&gt;24&lt;/span&gt; \
    &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="n"&gt;domain&lt;/span&gt; &lt;span class="n"&gt;rdr&lt;/span&gt;-&lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="m"&gt;172&lt;/span&gt;.&lt;span class="m"&gt;17&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;.&lt;span class="m"&gt;1&lt;/span&gt;

  &lt;span class="n"&gt;pass&lt;/span&gt; &lt;span class="n"&gt;in&lt;/span&gt; &lt;span class="n"&gt;inet&lt;/span&gt; &lt;span class="n"&gt;proto&lt;/span&gt; &lt;span class="n"&gt;udp&lt;/span&gt; \
    &lt;span class="n"&gt;from&lt;/span&gt; &lt;span class="m"&gt;172&lt;/span&gt;.&lt;span class="m"&gt;16&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;/&lt;span class="m"&gt;24&lt;/span&gt; \
    &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt; &lt;span class="n"&gt;ntp&lt;/span&gt; \
    &lt;span class="n"&gt;rtable&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; \
    &lt;span class="n"&gt;rdr&lt;/span&gt;-&lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="m"&gt;127&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;.&lt;span class="m"&gt;0&lt;/span&gt;.&lt;span class="m"&gt;1&lt;/span&gt;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let fix the access rights on the files previously created.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas &lt;span class="nb"&gt;chmod &lt;/span&gt;600 /etc/hostname.&lt;span class="k"&gt;*&lt;/span&gt; /etc/pf.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The network can be started or restarted. If other interfaces are configured, it is also possible to start them one by one or by giving a list of them as parameters for the &lt;code&gt;netstart&lt;/code&gt; script.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas sh /etc/netstart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If everything looks good... Packet filter can be restarted.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas pfctl &lt;span class="nt"&gt;-nf&lt;/span&gt; /etc/pf.conf
&lt;span class="go"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas pfctl &lt;span class="nt"&gt;-f&lt;/span&gt; /etc/pf.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The firewall should now be connected to the server using wireguard. Let check that with a simple ping to &lt;code&gt;openbsd.org&lt;/code&gt;. Unfortunately, because &lt;code&gt;lo1&lt;/code&gt; has been created and set with &lt;code&gt;127.0.0.1&lt;/code&gt;, it is not possible to resolve a domain name locally on this firewall, but, it is still possible to use any other ip addresses. Indeed, a redirection is done on the VPN side, and any connections to DNS are forwarded on a local &lt;code&gt;unbound&lt;/code&gt; instance. Let's try that.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;route &lt;span class="nt"&gt;-nT1&lt;/span&gt; &lt;span class="nb"&gt;exec &lt;/span&gt;dig @1.2.3.4 google.fr +short
&lt;span class="go"&gt;142.251.142.195

&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;route &lt;span class="nt"&gt;-nT1&lt;/span&gt; &lt;span class="nb"&gt;exec &lt;/span&gt;ping &lt;span class="nt"&gt;-c3&lt;/span&gt; 142.251.142.195
&lt;span class="go"&gt;PING 142.251.142.195 (142.251.142.195): 56 data bytes
64 bytes from 142.251.142.195: icmp_seq=0 ttl=118 time=24.746 ms
64 bytes from 142.251.142.195: icmp_seq=1 ttl=118 time=25.723 ms
64 bytes from 142.251.142.195: icmp_seq=2 ttl=118 time=25.193 ms

--- 142.251.142.195 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 24.746/25.221/25.723/0.399 ms

&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;route &lt;span class="nt"&gt;-nT1&lt;/span&gt; &lt;span class="nb"&gt;exec &lt;/span&gt;nc &lt;span class="nt"&gt;-zv&lt;/span&gt; 142.251.142.195 80
&lt;span class="go"&gt;Connection to 142.251.142.195 80 port [tcp/www] succeeded!

&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;route &lt;span class="nt"&gt;-nT1&lt;/span&gt; &lt;span class="nb"&gt;exec &lt;/span&gt;nc &lt;span class="nt"&gt;-zv&lt;/span&gt; 142.251.142.195 443
&lt;span class="go"&gt;Connection to 142.251.142.195 443 port [tcp/https] succeeded!
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It seems the firewall is correctly using the VPN and the packets are correctly routed to some public IP addresses. To be sure, one can also use &lt;code&gt;tcpdump&lt;/code&gt; to see what's happening on &lt;code&gt;wg0&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;tcpdump &lt;span class="nt"&gt;-ni&lt;/span&gt; wg0
&lt;span class="go"&gt;tcpdump: listening on wg0, link-type LOOP
&lt;/span&gt;&lt;span class="gp"&gt;14:51:40.154762 172.17.0.2.31538 &amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;142.251.142.195.443: SWE 4156193580:4156193580&lt;span class="o"&gt;(&lt;/span&gt;0&lt;span class="o"&gt;)&lt;/span&gt; win 16384 &amp;lt;mss 1452,nop,nop,sackOK,nop,wscale 6,nop,nop,timestamp 2865047363 0&amp;gt; &lt;span class="o"&gt;(&lt;/span&gt;DF&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="gp"&gt;14:51:40.180844 142.251.142.195.443 &amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;172.17.0.2.31538: S 1448631416:1448631416&lt;span class="o"&gt;(&lt;/span&gt;0&lt;span class="o"&gt;)&lt;/span&gt; ack 4156193581 win 65535 &amp;lt;mss 1412,sackOK,timestamp 728224899 2865047363,nop,wscale 8&amp;gt; &lt;span class="o"&gt;(&lt;/span&gt;DF&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;tos 0x80]
&lt;span class="gp"&gt;14:51:40.180995 172.17.0.2.31538 &amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;142.251.142.195.443: &lt;span class="nb"&gt;.&lt;/span&gt; ack 1 win 256 &amp;lt;nop,nop,timestamp 2865047383 728224899&amp;gt; &lt;span class="o"&gt;(&lt;/span&gt;DF&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="gp"&gt;14:51:40.182406 172.17.0.2.31538 &amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;142.251.142.195.443: F 1:1&lt;span class="o"&gt;(&lt;/span&gt;0&lt;span class="o"&gt;)&lt;/span&gt; ack 1 win 256 &amp;lt;nop,nop,timestamp 2865047383 728224899&amp;gt; &lt;span class="o"&gt;(&lt;/span&gt;DF&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="gp"&gt;14:51:40.206851 142.251.142.195.443 &amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;172.17.0.2.31538: F 1:1&lt;span class="o"&gt;(&lt;/span&gt;0&lt;span class="o"&gt;)&lt;/span&gt; ack 2 win 1050 &amp;lt;nop,nop,timestamp 728224925 2865047383&amp;gt; &lt;span class="o"&gt;[&lt;/span&gt;tos 0x80]
&lt;span class="gp"&gt;14:51:40.207024 172.17.0.2.31538 &amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;142.251.142.195.443: &lt;span class="nb"&gt;.&lt;/span&gt; ack 2 win 256 &amp;lt;nop,nop,timestamp 2865047413 728224925&amp;gt; &lt;span class="o"&gt;(&lt;/span&gt;DF&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="gp"&gt;14:51:40.987301 172.16.0.2.48148 &amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;172.65.251.78.443: &lt;span class="nb"&gt;.&lt;/span&gt; ack 2499027552 win 78 &amp;lt;nop,nop,timestamp 674758452 2705939126&amp;gt;
&lt;span class="gp"&gt;14:51:41.013134 172.65.251.78.443 &amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;172.16.0.2.48148: &lt;span class="nb"&gt;.&lt;/span&gt; ack 1 win 19 &amp;lt;nop,nop,timestamp 2705969587 674743439&amp;gt; &lt;span class="o"&gt;(&lt;/span&gt;DF&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="gp"&gt;14:51:41.333030 172.65.251.78.443 &amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;172.16.0.2.48148: &lt;span class="nb"&gt;.&lt;/span&gt; ack 1 win 19 &amp;lt;nop,nop,timestamp 2705969908 674743439&amp;gt; &lt;span class="o"&gt;(&lt;/span&gt;DF&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="gp"&gt;14:51:41.334165 172.16.0.2.48148 &amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;172.65.251.78.443: &lt;span class="nb"&gt;.&lt;/span&gt; ack 1 win 78 &amp;lt;nop,nop,timestamp 674758799 2705969587&amp;gt;
&lt;span class="gp"&gt;14:51:42.840018 172.65.251.78.443 &amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;172.16.0.3.40668: &lt;span class="nb"&gt;.&lt;/span&gt; ack 1758166881 win 16 &amp;lt;nop,nop,timestamp 2453064192 1968171036&amp;gt; &lt;span class="o"&gt;(&lt;/span&gt;DF&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="gp"&gt;14:51:42.840607 172.16.0.3.40668 &amp;gt;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;172.65.251.78.443: &lt;span class="nb"&gt;.&lt;/span&gt; ack 1 win 78 &amp;lt;nop,nop,timestamp 1968186512 2453048737&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is now confirmed, the traffic is going into the VPN!&lt;/p&gt;

&lt;h1&gt;
  
  
  Workers Configuration
&lt;/h1&gt;

&lt;p&gt;The last part of this infrastructure is directly related to the "workers". Those workers will host gitlab-runners and probably other services like &lt;code&gt;podman&lt;/code&gt; or even &lt;code&gt;k3s&lt;/code&gt; to build, test and release my own private application locally. Those servers are old laptops, and other small devices connected in their dedicated switch, behind the firewall. Most of them will use Alpine Linux. So, first, the network configuration.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; | doas &lt;span class="nb"&gt;tee&lt;/span&gt; /etc/network/interfaces &amp;lt; EOF
&lt;span class="go"&gt;auto lo
iface lo inet loopback

auto eth0
        address 172.16.0.2/24
        network 172.16.0.0
        broadcast 172.16.0.255
        gateway 172.16.0.1
EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To apply the configuration, simple invoke the &lt;code&gt;service&lt;/code&gt; command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas service networking restart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then the &lt;code&gt;dnsmasq&lt;/code&gt; configuration, in the previous article, it was used to worked the domain name requests to the Tor DNS service. In this case, it will be used to forward the requests to the gateway, then the gateway will forward them to the VPN.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; | doas &lt;span class="nb"&gt;tee&lt;/span&gt; /etc/dnsmasq.conf &amp;lt; EOF
&lt;span class="go"&gt;no-resolv
server=172.16.0.1
local-service
listen-address=127.0.0.1
conf-dir=/etc/dnsmasq.d/,*.conf
EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Be sure &lt;code&gt;dnsmasq&lt;/code&gt; is started during boot and start the service if it's not already done.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas rc-update add dnsmasq default
&lt;span class="go"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas service dnsmasq start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ensure &lt;code&gt;/etc/resolv.conf&lt;/code&gt; is correctly configured to ask &lt;code&gt;dnsmasq&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; | doas &lt;span class="nb"&gt;tee&lt;/span&gt; /etc/resolv.conf &amp;lt; EOF
&lt;span class="go"&gt;nameserver 127.0.0.1
EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Voilà. A worker is configured! The idea was to have something really simple on this side to deploy many workers when needed. The &lt;code&gt;dnsmasq&lt;/code&gt; is a bonus, because simply configuring the &lt;code&gt;/etc/resolv.conf&lt;/code&gt; would have been way enough.&lt;/p&gt;

&lt;h1&gt;
  
  
  Testing
&lt;/h1&gt;

&lt;p&gt;One of the most important section of this article... Testing the configuration from the workers point of view. First, the DNS resolution is mandatory and must work. Checked.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;dig +short openbsd.org
&lt;span class="go"&gt;199.185.178.80
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All packets must be forwarded through the VPN and not locally. As one can see, the packets are passing to the gateway, then, to the VPN and go out from the server (the IP addresse(s) have been replaced by &lt;code&gt;x.x.x.x&lt;/code&gt;). Checked.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;traceroute openbsd.org &lt;span class="nt"&gt;-nI&lt;/span&gt;
&lt;span class="go"&gt;traceroute to openbsd.org (199.185.178.80), 30 hops max, 46 byte packets
 1  172.16.0.1  0.591 ms  0.179 ms  0.434 ms
 2  172.17.0.1  24.231 ms  25.197 ms  24.946 ms
 3  x.x.x.x  25.732 ms  26.328 ms  28.007 ms
 4  x.x.x.y  24.522 ms  26.557 ms  25.837 ms
 5  x.x.y.z  25.012 ms  24.913 ms  25.359 ms
 6  80.249.213.240  26.202 ms  26.065 ms  31.208 ms
 7  64.125.20.28  145.869 ms  *  146.492 ms
 8  64.125.29.184  145.833 ms  145.111 ms  146.056 ms
 9  *  64.125.31.110  146.041 ms  *
10  *  *  *
11  *  *  *
12  64.125.30.199  147.083 ms  145.227 ms  145.968 ms
13  64.125.31.158  145.922 ms  146.089 ms  146.342 ms
14  64.125.18.179  145.466 ms  145.984 ms  145.082 ms
15  64.125.18.180  148.951 ms  147.816 ms  146.111 ms
16  64.125.18.210  145.243 ms  146.458 ms  146.015 ms
17  208.185.75.98  146.226 ms  146.872 ms  146.485 ms
18  204.209.252.4  146.952 ms  148.495 ms  147.707 ms
19  199.185.230.2  147.111 ms  147.041 ms  147.363 ms
20  199.185.178.80  145.313 ms  144.660 ms  145.852 m
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;HTTP connections should work. It can be verified with &lt;code&gt;nc&lt;/code&gt;. Checked.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;nc &lt;span class="nt"&gt;-zv&lt;/span&gt; openbsd.org 80
&lt;span class="go"&gt;Connection to openbsd.org (199.185.178.80) 80 port [tcp/http] succeeded!
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;HTTPS connections must work. This one is important because some repository will be cloned using HTTPS. Checked.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;nc &lt;span class="nt"&gt;-zv&lt;/span&gt; openbsd.org 443
&lt;span class="go"&gt;Connection to openbsd.org (199.185.178.80) 443 port [tcp/https] succeeded!
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Another important service to check is SSH. Most of the repositories are using Git over SSH, usually listening on port TCP/22 by default. The workers must have access to that as well. Checked!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;nc &lt;span class="nt"&gt;-zv&lt;/span&gt; ftp.eu.openbsd.org 22
&lt;span class="go"&gt;Connection to ftp.eu.openbsd.org (193.156.13.178) 22 port [tcp/ssh] succeeded!
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, let check if Alpine Linux can be updated and upgraded... Checked!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas apk update
&lt;span class="go"&gt;v3.23.7-30-g7a9ffafb21a [https://mirror.leaseweb.com/alpine/v3.23/main]
v3.23.7-29-gecf474a05c5 [https://mirror.leaseweb.com/alpine/v3.23/community]
OK: 27586 distinct packages available

&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas apk upgrade
&lt;span class="go"&gt;OK: 1146.9 MiB in 302 packages
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;My own local workers/builders infrastructure is now running behind a firewall and a VPN. The IP address seen by gitlab is not the one from my place, but from another server.&lt;/p&gt;

&lt;h1&gt;
  
  
  Troubleshooting and Improvements
&lt;/h1&gt;

&lt;p&gt;Managing &lt;code&gt;rdomain&lt;/code&gt; can become very complex, and one must be disciplined to manage packet-filter rules but also the pseudo devices created. &lt;code&gt;tcpdump&lt;/code&gt; will be the best tool to investigate a routing issue and will quickly give an idea of the root cause. &lt;code&gt;route&lt;/code&gt; and &lt;code&gt;netstat&lt;/code&gt; commands will also be really useful to inspect the state of the network stack. Finally, creating &lt;code&gt;pflog&lt;/code&gt; interfaces to log and follow the packet flow will also be of a great help.&lt;/p&gt;

&lt;p&gt;Another point to improve in this design is about trusting the traffic. The workers will use gitlab-runners, and based on the news, supply-chain attacks or 0days are kinda dangerous. The previous configuration using Tor was interesting because a proxy was required. In the current situation an HTTP proxy would have been a good idea to deploy, to filter and log all outgoing connections. A bastion for ssh (or an ssh proxy) would have been great as well. Indeed, to avoid an attack, restricting the access to a small subset of allowed IP addresses or domains is the bare minimum.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Coming back to my roots was pretty great. Configuring VPN, routes and other kind of network stuff on OpenBSD is always a fun experience. &lt;code&gt;rdomain&lt;/code&gt; is a furtive technology mostly known by some OpenBSD wizards and other hardcore system/network administrators. The number of publications on this topic is pretty low, but the OpenBSD documentation is here to save our life.&lt;/p&gt;

&lt;p&gt;Anyway, &lt;code&gt;rdomain&lt;/code&gt; is a great tool to isolate networks and avoid leaks. Configuring it correctly can be challenging though, and testing it is also another layer of complexity, but the result is - as usual with OpenBSD - rock solid. This article is already huge, and having a list of resources/references can also probably help you to deal with all of that.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The &lt;a href="https://man.openbsd.org/rdomain.4" rel="noopener noreferrer"&gt;&lt;strong&gt;&lt;code&gt;rdomain(4)&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; man page, explaining how &lt;code&gt;rdomain&lt;/code&gt; is working with few examples;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;a href="https://man.openbsd.org/pfctl" rel="noopener noreferrer"&gt;&lt;strong&gt;&lt;code&gt;pfctl(8)&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; command man page, where you will find how to use &lt;code&gt;pfctl&lt;/code&gt;, mainly to reload the firewall rules;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;a href="https://man.openbsd.org/pf.conf" rel="noopener noreferrer"&gt;&lt;strong&gt;&lt;code&gt;pf.conf(5)&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; configuration page man page, where you will find more about &lt;code&gt;rdomain&lt;/code&gt; and &lt;code&gt;rtable&lt;/code&gt;;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;a href="https://man.openbsd.org/route" rel="noopener noreferrer"&gt;&lt;strong&gt;&lt;code&gt;route(8)&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; command mange page, where you will learn how to use the &lt;code&gt;route&lt;/code&gt; command to switch between &lt;code&gt;rdomain&lt;/code&gt;s;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;a href="https://man.openbsd.org/netstart" rel="noopener noreferrer"&gt;&lt;strong&gt;&lt;code&gt;netstart(8)&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; script man page, to restart/reload interfaces;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;a href="https://man.openbsd.org/hostname.if" rel="noopener noreferrer"&gt;&lt;strong&gt;&lt;code&gt;hostname.if(5)&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; configuration file man page, where the configuration of the interfaces will be stored;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;a href="https://man.openbsd.org/wg" rel="noopener noreferrer"&gt;&lt;strong&gt;&lt;code&gt;wg(4)&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; pseudo device man page, where you will find more information about how to create, configure and maintain a wireguard interface;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;a href="https://man.openbsd.org/pair" rel="noopener noreferrer"&gt;&lt;strong&gt;&lt;code&gt;pair(4)&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; pseudo device man page, where you will understand how to use &lt;code&gt;pair&lt;/code&gt; to connect different &lt;code&gt;rdomain&lt;/code&gt; together;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;a href="https://man.openbsd.org/vether.4" rel="noopener noreferrer"&gt;&lt;strong&gt;&lt;code&gt;vether(4)&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; pseudo device man page, where you will learn how to use the virtual ethernet interface;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;a href="https://man.openbsd.org/bridge.4" rel="noopener noreferrer"&gt;&lt;strong&gt;&lt;code&gt;bridge(4)&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; pseudo device man page, useful to link many interfaces together;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;a href="https://man.openbsd.org/ifconfig" rel="noopener noreferrer"&gt;&lt;strong&gt;&lt;code&gt;ifconfig(8)&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; command man page, to deal with the pseudo devices and network interfaces;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;a href="https://man.openbsd.org/pflog" rel="noopener noreferrer"&gt;&lt;strong&gt;&lt;code&gt;pflog(4)&lt;/code&gt;&lt;/strong&gt;&lt;/a&gt; pseudo interface man page to see what kind of data one can collect and how to use it with &lt;a href="https://man.openbsd.org/tcpdump" rel="noopener noreferrer"&gt;&lt;code&gt;tcpdump&lt;/code&gt;&lt;/a&gt;;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://indico.bsdcan.org/event/1/contributions/31/attachments/7/7/wg.pdf" rel="noopener noreferrer"&gt;&lt;strong&gt;Implementing Routing Domains on an OpenBSD workstation for use with WireGuard&lt;/strong&gt;&lt;/a&gt; talk presented in 2024, with the recording available on &lt;a href="https://www.youtube.com/watch?v=ipbPcNXeDj4&amp;amp;pp=ygVNSW1wbGVtZW50aW5nIFJvdXRpbmcgRG9tYWlucyBvbiBhbiBPcGVuQlNEIHdvcmtzdGF0aW9uIGZvciB1c2Ugd2l0aCBXaXJlR3VhcmQ%3D" rel="noopener noreferrer"&gt;youtube&lt;/a&gt;;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://thelongcon.ca/slides/2024/Robert%20Keizer%20-%20Introduction%20to%20global%20anycast%20using%20OpenBSD%20(on%20a%20budget)%20-%20The%20Long%20Con%202024.pdf" rel="noopener noreferrer"&gt;&lt;strong&gt;Introduction to global anycast using OpenBSD (on a budget)&lt;/strong&gt;&lt;/a&gt; live streaming talk presented in 2024, with the recording available on &lt;a href="https://www.youtube.com/watch?v=JpxpjzUfQpg&amp;amp;pp=ygU6SW50cm9kdWN0aW9uIHRvIGdsb2JhbCBhbnljYXN0IHVzaW5nIE9wZW5CU0QgKG9uIGEgYnVkZ2V0KQ%3D%3D" rel="noopener noreferrer"&gt;youtube&lt;/a&gt;;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.openbsd.org/papers/eurobsdcon2023-matthieu-pf-rdomain.pdf" rel="noopener noreferrer"&gt;&lt;strong&gt;Practical use of OpenBSD routing domains with redundant&lt;br&gt;
firewalls&lt;/strong&gt;&lt;/a&gt; talk presented in 2023, with the recorded session available on &lt;a href="https://www.youtube.com/watch?v=c81bS9u1A6Q&amp;amp;pp=ygVBUHJhY3RpY2FsIHVzZSBvZiBPcGVuQlNEIHJvdXRpbmcgZG9tYWlucyB3aXRoIHJlZHVuZGFudCBmaXJld2FsbHM%3D" rel="noopener noreferrer"&gt;youtube&lt;/a&gt;;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.openbsd.org/papers/jres2021-matthieu-tuto-pf.pdf" rel="noopener noreferrer"&gt;&lt;strong&gt;Installation de pare-feux redondants avec OpenBSD&lt;/strong&gt;&lt;/a&gt; talk slides presented in 2021 (but in French);&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.openbsd.org/papers/asiabsdcon2018-mininet-slides.pdf" rel="noopener noreferrer"&gt;&lt;strong&gt;Mininet on OpenBSD Using rdomains for Interactive SDN Testing and Development&lt;/strong&gt;&lt;/a&gt; talk presented in 2018, with the &lt;a href="https://www.youtube.com/watch?v=Vg9Czjm9aV8&amp;amp;pp=ygVNTWluaW5ldCBvbiBPcGVuQlNEIFVzaW5nIHJkb21haW5zIGZvciBJbnRlcmFjdGl2ZSBTRE4gVGVzdGluZyBhbmQgRGV2ZWxvcG1lbnTSBwkJMgwBhyohjO8%3D" rel="noopener noreferrer"&gt;youtube video&lt;/a&gt; and its &lt;a href="https://www.openbsd.org/papers/asiabsdcon2018-mininet-paper.pdf" rel="noopener noreferrer"&gt;paper&lt;/a&gt;;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.bsdcan.org/2017/schedule/attachments/415_bsdcan2017-talk.pdf" rel="noopener noreferrer"&gt;&lt;strong&gt;pf+rdomains create splendid multi-tenancy firewalls&lt;/strong&gt;&lt;/a&gt; talk presented in 2017, with the &lt;a href="https://www.youtube.com/watch?v=5Cni50vnlto&amp;amp;pp=ygUzcGYrcmRvbWFpbnMgY3JlYXRlIHNwbGVuZGlkIG11bHRpLXRlbmFuY3kgZmlyZXdhbGxz0gcJCTIMAYcqIYzv" rel="noopener noreferrer"&gt;youtube video&lt;/a&gt;;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://undeadly.org/features/2018/02/eurobsdcon2017-branch-vpn.pdf" rel="noopener noreferrer"&gt;&lt;strong&gt;Branch VPN Solution with OpenBSD&lt;/strong&gt;&lt;/a&gt; talk slides presented in 2017;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.openbsd.org/papers/bsdcan2015-rdomains.pdf" rel="noopener noreferrer"&gt;&lt;strong&gt;using routing domains/routing tables in a production network&lt;/strong&gt;&lt;/a&gt; talk slides presented in 2015;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.unfriendlygrinch.info/posts/openbsd-routing-tables-and-routing-domains/" rel="noopener noreferrer"&gt;&lt;strong&gt;OpenBSD Routing Tables and Routing Domains&lt;/strong&gt;&lt;/a&gt; by the Unfriendly Grinch, offering a great &lt;code&gt;rdomain&lt;/code&gt; usage example;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://insec.sh/secure-torrenting-with-openbsd-rdomains/" rel="noopener noreferrer"&gt;&lt;strong&gt;Secure torrenting with OpenBSD rdomains&lt;/strong&gt;&lt;/a&gt;, a post showing us how to isolate/secure torrenting using &lt;code&gt;rdomain&lt;/code&gt;;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dataswamp.org/~solene/2021-12-16-openbsd-openvpn-exit.html" rel="noopener noreferrer"&gt;&lt;strong&gt;OpenVPN on OpenBSD in its own rdomain to prevent data leak&lt;/strong&gt;&lt;/a&gt;, another post where &lt;code&gt;rdomain&lt;/code&gt; is used with OpenVPN;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dataswamp.org/~solene/2021-10-09-openbsd-wireguard-exit.html" rel="noopener noreferrer"&gt;&lt;strong&gt;Full WireGuard setup with OpenBSD&lt;/strong&gt;&lt;/a&gt;, probably one of the first post available on the web about wireguard and &lt;code&gt;rdomain&lt;/code&gt; on OpenBSD;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://serverfault.com/questions/821306/configuring-pf-to-route-between-routing-domains" rel="noopener noreferrer"&gt;&lt;strong&gt;Configuring PF to route between routing domains&lt;/strong&gt;&lt;/a&gt; on ServerFault;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.linuxquestions.org/questions/%2Absd-17/openbsd-pf-rdr-to-across-rdomains-4175657966/" rel="noopener noreferrer"&gt;&lt;strong&gt;OpenBSD PF rdr-to across rdomains&lt;/strong&gt;&lt;/a&gt; on Linux Questions;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Happy hacking and have fun!&lt;/p&gt;

&lt;p&gt;EDIT(20261103): adding a missing route in &lt;code&gt;/etc/hostname.wg0&lt;/code&gt;&lt;/p&gt;




&lt;p&gt;Cover Image by &lt;a href="https://unsplash.com/@rafaelpeier?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Rafael Peier&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/a-dead-pufferfish-lies-on-the-sandy-beach-FoVu-YEHj2Y?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>openbsd</category>
      <category>network</category>
      <category>security</category>
      <category>systems</category>
    </item>
    <item>
      <title>WeeklyReview#202644</title>
      <dc:creator>Mathieu Kerjouan</dc:creator>
      <pubDate>Mon, 02 Nov 2026 10:00:00 +0000</pubDate>
      <link>https://dev.to/niamtokik/weeklyreview202644-2d6o</link>
      <guid>https://dev.to/niamtokik/weeklyreview202644-2d6o</guid>
      <description>&lt;p&gt;This week was mostly dedicated to clean up and fix my CI/CD local infrastructure. The first version of this one was undocumented and using Tor as relay to hide my private IP address. Unfortunately, most of the tor exit nodes were blocked by Google, and following the recent news regarding the 333 rogue exit nodes, forwarding this traffic through my own servers is probably a better idea. Both configuration have been configured - even if it's not yet finished but it works.&lt;/p&gt;

&lt;p&gt;In the end, it was great to do some old-school sysadmin/netadmin tasks on OpenBSD. This system is still my favorite after all these years. Yes, it is not fast as a Linux-like distribution, it does not have all fancy hardware support from other operating system, but damn... In few hours, one is able to deploy a crazy stable and secure infrastructure.&lt;/p&gt;




&lt;p&gt;On my Dart/Flutter application side, the database management was - and still is - a problem. &lt;code&gt;sqflite&lt;/code&gt; and other interface to it are unpleasant to use. One of my target is to use &lt;code&gt;ribs_sqlite&lt;/code&gt; over &lt;code&gt;sqlite&lt;/code&gt; or &lt;code&gt;sqflite&lt;/code&gt;, but designing it this way requires to change some of my first design.&lt;/p&gt;

&lt;p&gt;Another thing, the front-end part was my main target because it was my weak point. By doing that, a big part of my time was dedicated to learn more about UI/UX and mobile design. A post is planned to be released - one day - on that.&lt;/p&gt;




&lt;h1&gt;
  
  
  Coding
&lt;/h1&gt;

&lt;p&gt;🏗️ &lt;a href="https://github.com/mbrock/filnix/tree/main/nanofil" rel="noopener noreferrer"&gt;&lt;strong&gt;nanofil&lt;/strong&gt;&lt;/a&gt;: A C compiler written in Prolog that emits x86-64 assembly in the Fil-C ABI. Its object files link with clang-built Fil-C code, and they keep Fil-C's guarantees&lt;/p&gt;

&lt;p&gt;🌐 &lt;a href="https://learnerlang.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;Learn Erlang Step-By-Step&lt;/strong&gt;&lt;/a&gt;: a new initiative to learn Erlang based on a real-world project! I like the concept and how it has been done.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://www.benjoffe.com/fast-floordiv" rel="noopener noreferrer"&gt;&lt;strong&gt;A faster way to compute signed 64-bit floor division by constants&lt;/strong&gt;&lt;/a&gt;: a way to optimize floor division when the divisor is known during compile time.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://tartanllama.xyz/posts/writing-a-linux-debugger/setup/" rel="noopener noreferrer"&gt;&lt;strong&gt;Writing a Linux Debugger Part 1: Setup&lt;/strong&gt;&lt;/a&gt;: a serie of article on developing its own linux debugger in C++.&lt;/p&gt;

&lt;h1&gt;
  
  
  System
&lt;/h1&gt;

&lt;p&gt;🏗️ &lt;a href="https://github.com/henrygd/beszel" rel="noopener noreferrer"&gt;&lt;strong&gt;Beszel&lt;/strong&gt;&lt;/a&gt;: a lightweight server monitoring platform that includes Docker statistics, historical data, and alert functions.&lt;/p&gt;

&lt;h1&gt;
  
  
  Database
&lt;/h1&gt;

&lt;p&gt;🏗️ &lt;a href="https://github.com/darold/pgcluu" rel="noopener noreferrer"&gt;&lt;strong&gt;pgCluu&lt;/strong&gt;&lt;/a&gt;:  a Perl program used to perform a full audit of a PostgreSQL Cluster and System performance.&lt;/p&gt;

&lt;p&gt;🌐 &lt;a href="https://safegrd.dev/" rel="noopener noreferrer"&gt;&lt;strong&gt;SafeGrd&lt;/strong&gt;&lt;/a&gt;: SafeGrd backs up your databases, files and mail, encrypts and locks each copy, and restores it on a schedule to prove it works. An agent with your production keys can drop the database, but not the backups.&lt;/p&gt;

&lt;p&gt;🏗️ &lt;a href="https://github.com/Muzzammil242/pgrecon" rel="noopener noreferrer"&gt;&lt;strong&gt;pgrecon&lt;/strong&gt;&lt;/a&gt;: an open-source Oracle to PostgreSQL migration assessment and schema conversion tool. It inventories an Oracle database from an offline dump and runs a deterministic rule engine over it.&lt;/p&gt;

&lt;p&gt;🏗️ &lt;a href="https://postgresql-anonymizer.readthedocs.io/en/latest/" rel="noopener noreferrer"&gt;&lt;strong&gt;PostgreSQL Anonymizer&lt;/strong&gt;&lt;/a&gt;: an extension to mask or replace personally identifiable information (PII) or commercially sensitive data from a Postgres database.&lt;/p&gt;

&lt;p&gt;🏗️ &lt;a href="https://github.com/nalgeon/sqlean" rel="noopener noreferrer"&gt;&lt;strong&gt;sqlean&lt;/strong&gt;&lt;/a&gt;: There are a lot of SQLite extensions out there, but they are incomplete, inconsistent and scattered across the internet. Sqlean brings them together, neatly packaged into domain modules, documented, tested, and built for Linux, Windows and macOS.&lt;/p&gt;

&lt;h1&gt;
  
  
  Security
&lt;/h1&gt;

&lt;p&gt;🌐 &lt;a href="https://tailworm.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;Tailworm, we have zero-trust in our infrastructure&lt;/strong&gt;&lt;/a&gt;: a report audit of the tailscale project, containing a lot of security issues.&lt;/p&gt;

&lt;p&gt;🐦 &lt;a href="https://x.com/KeystoneWallet/status/2114719318722404578" rel="noopener noreferrer"&gt;&lt;strong&gt;Keystone: Statement Regarding the Security Incident on Our Official Website and Customer Guidance&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📑 &lt;a href="https://satcom.sysnet.ucsd.edu/docs/dontlookup_ccs25_fullpaper.pdf" rel="noopener noreferrer"&gt;&lt;strong&gt;Don’t Look Up: There Are Sensitive Internal Links in the Clear on&lt;br&gt;
GEO Satellites&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://projectzero.google/2026/10/fuzzing-v-AI.html" rel="noopener noreferrer"&gt;&lt;strong&gt;Fuzzers vs. AI: Comparing Fuzzilli and BigSleep on JavaScript Engines&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🌐 &lt;a href="https://tpbreak.afflicted.sh/" rel="noopener noreferrer"&gt;&lt;strong&gt;tpbreak&lt;/strong&gt;&lt;/a&gt;: TP-Link firmware decryption at scale — 52,609 images. The verification public key is also the decryption key: the AES key/IV fall out of the RSA-PSS salt. No private key required.&lt;/p&gt;

&lt;p&gt;🌐 &lt;a href="https://smsofdeath.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;SMS of Death&lt;/strong&gt;&lt;/a&gt;: an unchecked cast on an array can cause a denial of service for a long period of time on Android. It can lead to SQLite database corruption and also impact the phone to boot. It can brick the phone. If I understand correctly, it will not be fixed... Crazy.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://alpinelinux.org/posts/GitLab-security-incident-CVE-2026-97229.html" rel="noopener noreferrer"&gt;&lt;strong&gt;Alpine Linux GitLab security incident: attempted exploitation of CVE-2026-97229&lt;/strong&gt;&lt;/a&gt;: a gitlab upgrade where the main fix was not applied because of Ruby. It confirms me Alpine Linux team is great, instead of ignoring this attack, they are redeploying/rebuilding everything. Great project.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://www.rtl-sdr.com/specter-leaking-data-from-air-gapped-computers-by-toggling-usb-power-states/" rel="noopener noreferrer"&gt;&lt;strong&gt;SPECTER: Leaking Data from Air-Gapped Computers by Toggling USB Power States&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://www.rtl-sdr.com/thermal-noise-communication-sending-data-without-a-carrier-signal-with-an-rtl-sdr-as-the-receiver/" rel="noopener noreferrer"&gt;&lt;strong&gt;Thermal Noise Communication: Sending Data Without a Carrier Signal, with an RTL-SDR as the Receiver&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://thehackernews.com/2026/10/official-claude-code-vs-code-extension.html" rel="noopener noreferrer"&gt;&lt;strong&gt;Official Claude Code VS Code Extension Compromised to Install Persistent SSH Backdoor&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://freenode.net/article/when-intermediate-cas-fail-language-stacks-discover-they-own-the-blast-radius" rel="noopener noreferrer"&gt;&lt;strong&gt;When intermediate CAs fail, language stacks discover they own the blast radius&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📑 &lt;a href="https://raelize.com/upload/research/2016/2016_BlackHat-EU_Bypassing-Secure-Boot-Using-Fault-Injection_NT-AS.pdf" rel="noopener noreferrer"&gt;&lt;strong&gt;Bypassing Secure Boot using Fault Injection&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Security/cryptography
&lt;/h1&gt;

&lt;p&gt;📝 &lt;a href="https://v12.sh/blog/the-case-of-the-9bit-aes-key" rel="noopener noreferrer"&gt;&lt;strong&gt;The case of the 9 bit AES key&lt;/strong&gt;&lt;/a&gt;: encrypt your document yourself... PDF encryption from open-source world is just broken. The keys/seeds are not coming from cryptographic random sources, then, it is easy to break.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://blog.silentsignal.eu/2026/10/29/qsyrupwd-part-2-correcting-the-rijndael-key-builder/" rel="noopener noreferrer"&gt;&lt;strong&gt;QSYRUPWD, Part 2: Correcting the Rijndael Key Builder&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://hoseinhadipour.com/blog/lean-for-cryptanalysts/" rel="noopener noreferrer"&gt;&lt;strong&gt;Lean for Cryptanalysts: A Practical Introduction to Formal Proofs&lt;/strong&gt;&lt;/a&gt;: a lot of people are talking about the &lt;a href="https://lean-lang.org/functional_programming_in_lean/" rel="noopener noreferrer"&gt;lean language&lt;/a&gt;, it is on my long list of thing to learn. When someone is writing a post about Lean and cryptanalysis, for sure it will be a banger. So, this is a great example of lean usage, and it motives me even more to learn/use it.&lt;/p&gt;

&lt;h1&gt;
  
  
  Security/RedTeam
&lt;/h1&gt;

&lt;p&gt;🌐 &lt;a href="https://sploitus.com/exploit?id=D743A147-AC04-558E-AC44-A86A48AABB08" rel="noopener noreferrer"&gt;&lt;strong&gt;Exploit for php2shell-audit&lt;/strong&gt;&lt;/a&gt;: a "working" (yet non-tested on my side) exploit against php2-shell.&lt;/p&gt;

&lt;p&gt;🌐 &lt;a href="https://sploitus.com/exploit?id=2EF3AE90-EF42-5F24-AA67-C762AC236FE3" rel="noopener noreferrer"&gt;&lt;strong&gt;Exploit for CVE-2026-111497 (brotli)&lt;/strong&gt;&lt;/a&gt;: a "working" (yet non-tested on my side) exploit on nodejs brotli vulnerability.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://www.praetorian.com/blog/ble-testing-caeruleus/" rel="noopener noreferrer"&gt;&lt;strong&gt;Bluetooth Low Energy Security Testing, Consolidated: Introducing Caeruleus&lt;/strong&gt;&lt;/a&gt;: Bluetooth fascinate me since High School, at this time, I unsuccessfully tried to create an audio/video streaming application on Nokia SymbianOS in C++. It was fun, and bluetooth is a really interesting piece of technology. Having a list of tools to identify and attack this protocol is always useful, especially if you are developing Bluetooth application.&lt;/p&gt;

&lt;h1&gt;
  
  
  Embedded
&lt;/h1&gt;

&lt;p&gt;📝 &lt;a href="https://www.digikey.com/reference-designs/en" rel="noopener noreferrer"&gt;&lt;strong&gt;Digikey Reference Design Library&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Update/Upgrade
&lt;/h1&gt;

&lt;p&gt;🔄 &lt;a href="https://undeadly.org/cgi?action=article;sid=20261025115016" rel="noopener noreferrer"&gt;&lt;strong&gt;LibreSSL 4.4.0&lt;/strong&gt;&lt;/a&gt;: including eMudhra security fix.&lt;/p&gt;

&lt;p&gt;🔄 &lt;a href="https://github.com/seL4/seL4/releases/tag/17.0.0" rel="noopener noreferrer"&gt;&lt;strong&gt;Sel4 17.0.0&lt;/strong&gt;&lt;/a&gt;:  many bug and security fixes. Documentation was also improved. Few platforms have been removed (Arndale, Odroid-X, HiKey, Inforce IFC6410, exynos5). The &lt;a href="https://github.com/seL4/seL4" rel="noopener noreferrer"&gt;full changelog&lt;/a&gt; is available on Github.&lt;/p&gt;

&lt;p&gt;🔄 &lt;a href="https://github.com/elixir-lang/elixir/releases/tag/v1.20.5" rel="noopener noreferrer"&gt;&lt;strong&gt;Elixir 1.20.5&lt;/strong&gt;&lt;/a&gt;: Security and bugs fixes release, including 2 CVEs.&lt;/p&gt;

&lt;p&gt;🔄 &lt;a href="https://github.com/flutter/flutter/releases/tag/3.47.9" rel="noopener noreferrer"&gt;&lt;strong&gt;Flutter 3.47.9&lt;/strong&gt;&lt;/a&gt;: bugs fixes release.&lt;/p&gt;

&lt;h1&gt;
  
  
  Theory
&lt;/h1&gt;

&lt;p&gt;📑 &lt;a href="https://www.nature.com/articles/s41562-025-02387-z" rel="noopener noreferrer"&gt;&lt;strong&gt;Evidence for the representation of non-hierarchical structures in language&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Leaks of the Week
&lt;/h1&gt;

&lt;p&gt;🐦 &lt;a href="https://x.com/ZeroDayFacts/status/2115770189426106414" rel="noopener noreferrer"&gt;&lt;strong&gt;Sony&lt;/strong&gt;&lt;/a&gt;: more than 2.5 millions customers leaked, including sensitive information like mails and phone number.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://frenchbreaches.com/alertes/solnet-suisse-piratage-fuite-donnees-clients-telecom-mvwjqg7ow72iqngt8te" rel="noopener noreferrer"&gt;&lt;strong&gt;Solnet&lt;/strong&gt;&lt;/a&gt;: Switzerland network provider impacted by a data leak impacting more than 5000 customers.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://frenchbreaches.com/blog/rassemblement-national-un-pirate-revendique-les-donnees-de-150-000-adherents" rel="noopener noreferrer"&gt;&lt;strong&gt;Rassemblement National&lt;/strong&gt;&lt;/a&gt;: more than 432000 subscribers data leaked from this French political party.&lt;/p&gt;

&lt;p&gt;🐦 &lt;a href="https://x.com/DarkWebInformer/status/2116301692476026953" rel="noopener noreferrer"&gt;&lt;strong&gt;iCloudITS&lt;/strong&gt;&lt;/a&gt;: Saudi IT Provider leaked more than 15GB of data from their database.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://darkwebinformer.com/bangkok-post-breach-claim-includes-822-140-member-accounts-and-6-9-gb-infrastructure-dump/" rel="noopener noreferrer"&gt;&lt;strong&gt;Bangkok Post&lt;/strong&gt;&lt;/a&gt;: more than 820000 members impacted by a data leak &lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://frenchbreaches.com/blog/francs-macons-le-grand-orient-de-france-vise-par-une-cyberattaque-67-go-de-donnees-revendiques" rel="noopener noreferrer"&gt;&lt;strong&gt;Grand Orient de France&lt;/strong&gt;&lt;/a&gt;: 6.72GB of data leaked from one of the main French freemasonry. &lt;/p&gt;

&lt;p&gt;🐦 &lt;a href="https://x.com/DarkWebInformer/status/2115459185852731693" rel="noopener noreferrer"&gt;&lt;strong&gt;French Unknown IT Company&lt;/strong&gt;&lt;/a&gt;: if true, an IT company was impacted by a huge data leaks, including their private keys API for Stripe and Vercel.&lt;/p&gt;

&lt;h1&gt;
  
  
  Misc
&lt;/h1&gt;

&lt;p&gt;📝 &lt;a href="https://polymarket.com/event/anthropic-announces-bankruptcy-by" rel="noopener noreferrer"&gt;&lt;strong&gt;Anthropic announces bankruptcy by...?&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://www-cdn.anthropic.com/519c17a5d23a794e8b6d50a854048d0b61e0d73a.pdf" rel="noopener noreferrer"&gt;&lt;strong&gt;Who’s Aligned to Whom? How AI Agents Shape Experts’ Research Judgment Calls&lt;/strong&gt;&lt;/a&gt;: The conclusion contains all you need to know.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;experts may defer underdetermined decisions to an AI agent, and that this deferral can be hard to identify, even for the experts themselves [...] Judgment also depends on skill, and people who stop making these decisions may lose the ability to make them [...] institutions will need an explicit strategy for developing human skills as models become more capable [...] Institutions may want to protect these skills and human oversight even with extremely capable AI, for safety, resilience, or their own sake.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;📝 &lt;a href="https://gist.github.com/flamerix-ai/c3905705cc4205e5de3011fa2e74efce" rel="noopener noreferrer"&gt;&lt;strong&gt;Claude Code burns ~15–20% of your tokens on a 3-word status line. Here's how to turn it off&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="//www.404media.co/manifestos-fear-and-loser-thinking-inside-protons-ai-reckoning/"&gt;&lt;strong&gt;Manifestos, Fear, and ‘Loser Thinking’: Inside Proton’s AI Reckoning&lt;/strong&gt;&lt;/a&gt;: What a great leader and innovator... Calling his engineers and technicians loser is really an incredible act. So, time to move to another solution. By the way, tutanota is perhaps not a &lt;a href="https://x.com/CryptoCyberia/status/2019062136400474366" rel="noopener noreferrer"&gt;good alternative&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://x.com/devXritesh/status/2115783759672865194" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fge5aei91v3v0xin6oqha.png" alt=" " width="598" height="642"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/msimoni/status/2114088887366586517?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1ylyt6y2pfic2zyff0tt.png" alt=" " width="598" height="344"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/gf_256/status/2114051242817380507?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fug6qwf0t37x8qi4kwpn7.png" alt=" " width="598" height="118"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/teej_dv/status/2114423896955118015?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fu78bj0jacdfwa0qflc9i.png" alt=" " width="598" height="198"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/BadlyLiquidated/status/2115928489413214629" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpw7xmadyj4ny098bz84b.png" alt=" " width="598" height="98"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/Polymarket/status/2115911339587850419" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fpy7ddiae93n15oxs61bs.png" alt=" " width="598" height="138"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/codytrades/status/2116072067061915684" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq50d4knuy4c0ioe91mh3.png" alt=" " width="598" height="218"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/gaborgurbacs/status/2116195564127715664" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F083a4pz8m0h283v77ncd.png" alt=" " width="598" height="218"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxfbo2b7wi58m7y48nck5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxfbo2b7wi58m7y48nck5.png" alt=" " width="680" height="677"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fe3w6uy03ur1sbvwi3k0w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fe3w6uy03ur1sbvwi3k0w.png" alt=" " width="680" height="680"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4mjuuvqaysvu8n3cahbp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4mjuuvqaysvu8n3cahbp.png" alt=" " width="365" height="680"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnpxpd7xuub6my7p02lvi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnpxpd7xuub6my7p02lvi.png" alt=" " width="675" height="599"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcdw90jb2tryfl56fkfil.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcdw90jb2tryfl56fkfil.png" alt=" " width="500" height="624"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F21hcpym458qu6n4qy8p6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F21hcpym458qu6n4qy8p6.png" alt=" " width="640" height="610"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2b5ddbqkjsmbx09z24wl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F2b5ddbqkjsmbx09z24wl.png" alt=" " width="549" height="680"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F18325chhopv5ii0yepc4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F18325chhopv5ii0yepc4.png" alt=" " width="680" height="508"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr8tsqpoz3kq03k6dzf5e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr8tsqpoz3kq03k6dzf5e.png" alt=" " width="500" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F87viwoi9lav5dti1kf03.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F87viwoi9lav5dti1kf03.png" alt=" " width="660" height="680"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjh216v19mxdejar85pvi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjh216v19mxdejar85pvi.png" alt=" " width="680" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fecplj9xue4lsyrhbmx1i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fecplj9xue4lsyrhbmx1i.png" alt=" " width="618" height="680"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw5kt83wrorx117vu4onu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw5kt83wrorx117vu4onu.png" alt=" " width="800" height="622"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F98lhpzqbi83kc52d4fyq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F98lhpzqbi83kc52d4fyq.png" alt=" " width="500" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhhpyjq00hhc6grl8t0n1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhhpyjq00hhc6grl8t0n1.png" alt=" " width="800" height="1067"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr4l28uko0l1fpmuhkzb6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fr4l28uko0l1fpmuhkzb6.png" alt=" " width="800" height="901"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbl1qtduxf175yavnvvvt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbl1qtduxf175yavnvvvt.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Cover Image by &lt;a href="https://unsplash.com/@niki_emmert?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Nikolett Emmert&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/a-close-up-of-a-leaf-with-drops-of-water-on-it-4WhzY_EfSw8?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>weekly</category>
      <category>review</category>
    </item>
    <item>
      <title>devto is a really unstable platform to publish article. every weeks something is broken; today, I can't update one very long post... The PUT request got stuck on the server side. Crazy.</title>
      <dc:creator>Mathieu Kerjouan</dc:creator>
      <pubDate>Fri, 30 Oct 2026 15:52:19 +0000</pubDate>
      <link>https://dev.to/niamtokik/devto-is-a-really-unstable-platform-to-publish-article-every-weeks-something-is-broken-today-i-1l19</link>
      <guid>https://dev.to/niamtokik/devto-is-a-really-unstable-platform-to-publish-article-every-weeks-something-is-broken-today-i-1l19</guid>
      <description></description>
    </item>
    <item>
      <title>Isolated Network for Tor-like Services</title>
      <dc:creator>Mathieu Kerjouan</dc:creator>
      <pubDate>Wed, 28 Oct 2026 10:00:00 +0000</pubDate>
      <link>https://dev.to/niamtokik/isolated-network-for-tor-like-services-31c2</link>
      <guid>https://dev.to/niamtokik/isolated-network-for-tor-like-services-31c2</guid>
      <description>&lt;p&gt;The first part of my career in IT was to be network technician/administrator, configuring firewalls, routers and switches for companies. Since this time, few devices are always ready to do some interesting stuff related to network, one of them is a pretty old &lt;a href="https://pcengines.ch/apu2.htm" rel="noopener noreferrer"&gt;pcengine apu2 firewall&lt;/a&gt; using the latest OpenBSD release. It was mostly a canary-like computer to check if everything was fine during an OpenBSD update/upgrade. Since one of my project is being entirely coded in Dart/Flutter, and because this language is not yet supported by OpenBSD, it would have been good to have a dedicated &lt;a href="https://docs.gitlab.com/runner/" rel="noopener noreferrer"&gt;CI/CD gitlab runner&lt;/a&gt; running somewhere... Why not using an old laptop and isolating it behind this firewall?&lt;/p&gt;

&lt;h1&gt;
  
  
  Configuring OpenBSD
&lt;/h1&gt;

&lt;p&gt;My APU2 is having 3 Gigabit Ethernet port called &lt;code&gt;re0&lt;/code&gt;, &lt;code&gt;re1&lt;/code&gt;, and &lt;code&gt;re2&lt;/code&gt;. All of them are using the &lt;a href="https://man.openbsd.org/re" rel="noopener noreferrer"&gt;&lt;code&gt;re&lt;/code&gt;&lt;/a&gt; driver. &lt;code&gt;re0&lt;/code&gt; is the main interface with a direct connect to another router.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas &lt;span class="nb"&gt;cat&lt;/span&gt; /etc/hostname.re0
&lt;span class="go"&gt;dhcp
inet6 autoconf
&lt;/span&gt;&lt;span class="gp"&gt;inet alias $&lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;gateway_address&lt;span class="o"&gt;}&lt;/span&gt;
&lt;span class="go"&gt;up
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;re1&lt;/code&gt; is the interface where the server(s) hosting the worker(s) will be connected. Even if this interface will be used, it will not be set with an IP address but put in a bridge. All interfaces can be started using the &lt;a href="https://man.openbsd.org/netstart" rel="noopener noreferrer"&gt;&lt;code&gt;netstart&lt;/code&gt;&lt;/a&gt; script.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas &lt;span class="nb"&gt;cat&lt;/span&gt; /etc/hostname.re1
&lt;span class="go"&gt;up

&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas ksh /etc/netstart re1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A virtual interface &lt;a href="https://man.openbsd.org/vether" rel="noopener noreferrer"&gt;&lt;code&gt;vether&lt;/code&gt;&lt;/a&gt; will be created to deal with the private network dedicated for the workers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas &lt;span class="nb"&gt;cat&lt;/span&gt; /etc/hostname.vether0
&lt;span class="go"&gt;inet 172.16.0.1/24
up

&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas ksh /etc/netstart vether0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://man.openbsd.org/bridge" rel="noopener noreferrer"&gt;&lt;code&gt;bridge0&lt;/code&gt;&lt;/a&gt; is also created to connect &lt;code&gt;re1&lt;/code&gt; and &lt;code&gt;vether&lt;/code&gt;. Based on the current configuration, a &lt;a href="https://man.openbsd.org/veb.4" rel="noopener noreferrer"&gt;&lt;code&gt;veb&lt;/code&gt;&lt;/a&gt; interface would have probably be also another correct choice.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas &lt;span class="nb"&gt;cat&lt;/span&gt; /etc/hostname.bridge0
&lt;span class="go"&gt;destroy
add vether0
add re1
up

&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas ksh /etc/netstart bridge0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The router configuration is ready. All workers will use &lt;code&gt;172.16.0.1&lt;/code&gt; as default route, and packet filter will be in charge to filter which part of the traffic is right or not.&lt;/p&gt;

&lt;h1&gt;
  
  
  Tor Bootstrapping
&lt;/h1&gt;

&lt;p&gt;Tor is easy to install, but can be challenging to configure. Let install it first via &lt;a href="https://man.openbsd.org/pkg_add" rel="noopener noreferrer"&gt;&lt;code&gt;pkg_add&lt;/code&gt;&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas pkg_add tor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The main Tor configuration is located in &lt;a href="https://man.freebsd.org/cgi/man.cgi?query=tor" rel="noopener noreferrer"&gt;&lt;code&gt;/etc/tor/torrc&lt;/code&gt;&lt;/a&gt; and also in &lt;code&gt;/etc/torrc.d/&lt;/code&gt; directory. The first thing to configure is the DNS resolution to avoid leaks.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas &lt;span class="nb"&gt;touch&lt;/span&gt; /etc/torrc.d/dns.conf
&lt;span class="go"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"AutomapHostsOnResolve 1"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="go"&gt;  | doas tee /etc/torrc.d/dns.conf

&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"AutomapHostsSuffixes .exit,.onion"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="go"&gt;  | doas tee /etc/torrc.d/dns.conf
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, because our workers will mostly be connected to servers in North America or Europe, it can be nice to define the geolocation of the exit nodes. In the following case, the workers will use exit nodes from USA, UK, Europe, and Japan.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas &lt;span class="nb"&gt;touch&lt;/span&gt; /etc/torrc.d/exit_nodes.conf
&lt;span class="go"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s1"&gt;'ExitNodes {us},{uk},{eu},{ez},{jp} StrictNodes 1'&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="go"&gt;  | doas tee /etc/torrc.d/exit_nodes.conf
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The last step is to allow Tor to listen on the correct interface, in this case, &lt;code&gt;re1&lt;/code&gt; with the IP address &lt;code&gt;172.16.0.1&lt;/code&gt;. A first instance will listen on TCP/9080 and allow only onion routing to the standard internet. A second instance will be dedicated for onion traffic only and will listen on TCP/9081. Both of them will be used as HTTP Proxies.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; | doas &lt;span class="nb"&gt;tee&lt;/span&gt; /etc/torrc.d/workers.conf &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt;
&lt;/span&gt;&lt;span class="go"&gt;HTTPTunnelPort 172.16.0.1:9080 IsolateDestAddr IsolateDestPort NoOnionTraffic ClientUseIPv4
HTTPTunnelPort 172.16.0.1:9081 IsolateDestAddr IsolateDestPort OnionTrafficOnly ClientUseIPv4
EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Another instance will use a SOCK Proxy this time, and will listen on TCP/9050.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; | doas &lt;span class="nb"&gt;tee&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt; /etc/torrc.d/workers.conf &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt;
&lt;/span&gt;&lt;span class="go"&gt;SOCKSPort 127.0.0.1:9050 IsolateDestAddr IsolateDestPort ClientUseIPv4 SafeSocks 1
EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, all the DNS requests must be resolved via Tor and not any other kind of DNS to avoid DNS requests leaks. To do that, Tor will listen on TCP/9053 and will use its own DNS resolver.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; | doas &lt;span class="nb"&gt;tee&lt;/span&gt; &lt;span class="nt"&gt;-a&lt;/span&gt; /etc/torrc.d/workers.conf &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="no"&gt;EOF&lt;/span&gt;&lt;span class="sh"&gt;
&lt;/span&gt;&lt;span class="go"&gt;DNSPort 172.16.0.1:9053
EOF
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The configuration looks good. Let enable Tor via &lt;a href="https://man.openbsd.org/rcctl" rel="noopener noreferrer"&gt;&lt;code&gt;rcctl&lt;/code&gt;&lt;/a&gt;...&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas rcctl &lt;span class="nb"&gt;enable &lt;/span&gt;tor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;... And start it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas rcctl start tor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Regarding this configuration, one could also configure packet filter to forward the packet directly to a Tor instance on the loopback interface, but it can make the firewall configuration a bit more complex. Another idea is to use another proxy server like Privoxy to do the relay.&lt;/p&gt;

&lt;h1&gt;
  
  
  Packet Filter Configuration
&lt;/h1&gt;

&lt;p&gt;Tor is ready, it should listen on the correct interface, but the firewall must be configure to avoid leaks. Let defines the macros first, to help us deal with the different parameters. Packet filter configuration is located in &lt;a href="https://man.openbsd.org/pf.conf" rel="noopener noreferrer"&gt;&lt;code&gt;/etc/pf.conf&lt;/code&gt;&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tor_if = "{ re1, bridge0, vether0 }"
tor_network = "172.16.0.0/24"
tor_gateway = "172.16.0.1"
tor_proxy_ports = "{ 9050, 9080, 9081 }"
tor_dns = 9053
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using Tor can already be painful due to the speed of the connection, so, packet filter can be optimized a bit to win few milliseconds (sometimes). The loopback interface is also ignored, at this time, it's not necessary to filter packet from it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;set optimization aggressive
set skip on lo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let configure the anti spoofing features and scrub all packets coming into the firewall.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;antispoof for re0
antispoof for $tor_if
match in all scrub (no-df random-id)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The default rule is to drop everything. The next part of the configuration will allow only which packets are authorized to pass through the firewall.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight vcl"&gt;&lt;code&gt;block drop log on re0 
block drop log on re0 from $tor_network
block drop log on $tor_if
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nobody wants to lose access to its firewall, then, the TCP/22 port (ssh) is explicitly authorized from the main interface (&lt;code&gt;re0&lt;/code&gt;). All packets going out on this interface are also allowed. For debugging and maintenance purpose, ICMP and ICMPv6 protocols are allowed as well.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pass in quick on re0 proto tcp to port 22 
pass out quick on re0 keep state
pass on re0 proto icmp 
pass on re0 proto icmp6
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here the first part of the Tor firewall configuration. Firstly, to help see if the workers are up or down, ICMP are allowed only in one way, the workers are not allowed to send ICMP, but other servers and equipments from other part of the network are.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pass in proto icmp \
  from ! $tor_network \
  to $tor_network tag \
  tor_icmp
pass on $tor_if proto icmp \
  from $tor_network \
  to $tor_gateway \
  tag tor_icmp
pass on $tor_if proto icmp \
  from $tor_gateway \
  to $tor_network \
  tag tor_icmp
pass out proto icmp tagged tor_icmp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The workers are allowed to communicate between them. Indeed, it can be useful especially if the workers can share some data, or if a server is installed to cache the artifacts. A fine grained list of host can eventually be created here. The second rules explicitly block all packets coming from the Tor network to any other network different than this network. It means workers' packets will not be able to traverse the router.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pass on $tor_if inet proto tcp \
  from $tor_gateway \
  to $tor_network \
  keep state

pass on $tor_if inet proto tcp \
  from ! $tor_network \
  to $tor_network \
  keep state
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When configuring a CI/CD, it always nice to have a correct time from all the workers, if possible returning an UTC timestamp. Unfortunately, bare-metal servers can slowly be inaccurate regarding their local time, and having access to an NTP server can be helpful. Instead of allowing all workers to connect directly to a remote NTP server, the firewall - in this case - will act as a relay. Indeed, an &lt;code&gt;ntpd&lt;/code&gt; daemon will also listen on &lt;code&gt;re1&lt;/code&gt; interface and will offer the correct time.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pass in on $tor_if inet proto udp \
  from $tor_network \
  to $tor_gateway port ntp \
  keep state
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;DNS is also another part of a network, but workers can't be allowed to request unknown server from internet. So, Tor has been previously configured to listen on port UDP/9053 for its DNS resolver. The workers must be able to reach this port and do the DNS resolution.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pass on $tor_if inet proto udp \
  from $tor_network \
  to $tor_gateway port $tor_dns \
  keep state
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, the Tor proxies are also allowed to receive the connections from the workers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pass on $tor_if inet proto tcp \
  from $tor_network \
  to $tor_gateway port $tor_proxy_ports \
  keep state
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A bonus step, because my configuration for the workers required some extra-data, the workers can also reach out the firewall on the port TCP/80 (HTTP) to fetch some kind of information. The firewall here will act as a simple HTTP server.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pass in on $tor_if inet proto tcp \
  from $tor_network \
  to $tor_gateway port http \
  keep state
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let check packet filter configuration to see if everything is correct with the help of &lt;a href="https://man.openbsd.org/pfctl" rel="noopener noreferrer"&gt;&lt;code&gt;pfctl&lt;/code&gt;&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas pfctl &lt;span class="nt"&gt;-nf&lt;/span&gt; /etc/pf.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If all is good, the firewall can be started.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas pfctl &lt;span class="nt"&gt;-ef&lt;/span&gt; /etc/pf.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The configuration presents on my firewall is a bit more complex, but this one should work correctly.&lt;/p&gt;

&lt;h1&gt;
  
  
  From the Workers
&lt;/h1&gt;

&lt;p&gt;With the previous configuration, the workers are easily reachable by adding a static route from any other part of my network to the firewall.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doas route add 172.16.0.0/24 &lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;gateway_ip&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;
&lt;span class="gp"&gt;add net 172.16.0.0/24: gateway $&lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;gateway_ip&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From my laptop, the firewall interface for the Tor network is answering to the pings, that's a good sign.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;ping &lt;span class="nt"&gt;-c&lt;/span&gt; 3 172.16.0.1
&lt;span class="go"&gt;PING 172.16.0.1 (172.16.0.1): 56 data bytes
64 bytes from 172.16.0.1: icmp_seq=0 ttl=255 time=2.865 ms
64 bytes from 172.16.0.1: icmp_seq=1 ttl=255 time=2.782 ms
64 bytes from 172.16.0.1: icmp_seq=2 ttl=255 time=1.974 ms

--- 172.16.0.1 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 1.974/2.540/2.865/0.402 ms
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It seems the worker present on the Tor network (running on alpine linux) is also answering to the pings.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;ping &lt;span class="nt"&gt;-c&lt;/span&gt; 3 172.16.0.2 
&lt;span class="go"&gt;PING 172.16.0.2 (172.16.0.2): 56 data bytes
64 bytes from 172.16.0.2: icmp_seq=0 ttl=63 time=4.281 ms
64 bytes from 172.16.0.2: icmp_seq=1 ttl=63 time=3.336 ms
64 bytes from 172.16.0.2: icmp_seq=2 ttl=63 time=4.176 ms

--- 172.16.0.2 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/std-dev = 3.336/3.931/4.281/0.423 ms
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The TCP/22 port is working as well.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;nc &lt;span class="nt"&gt;-zv&lt;/span&gt; 172.16.0.2 22
&lt;span class="go"&gt;Connection to 172.16.0.2 22 port [tcp/ssh] succeeded
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the time to connect to this worker and check the firewall configuration.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;ssh 172.16.0.2
&lt;span class="c"&gt;...
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From the worker, it is possible to ping the default route &lt;code&gt;172.16.0.1&lt;/code&gt; without problems.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;ping &lt;span class="nt"&gt;-c&lt;/span&gt; 3 172.16.0.1
&lt;span class="go"&gt;PING 172.16.0.1 (172.16.0.1): 56 data bytes
64 bytes from 172.16.0.1: seq=0 ttl=42 time=0.617 ms
64 bytes from 172.16.0.1: seq=1 ttl=42 time=0.669 ms
64 bytes from 172.16.0.1: seq=2 ttl=42 time=0.758 ms

--- 172.16.0.1 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 0.617/0.681/0.758 ms
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Public IP addresses, like &lt;code&gt;8.8.8.8&lt;/code&gt; are not reachable, the firewall is blocking these packets.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;ping &lt;span class="nt"&gt;-c&lt;/span&gt; 3 8.8.8.8
&lt;span class="go"&gt;PING 8.8.8.8 (8.8.8.8): 56 data bytes

--- 8.8.8.8 ping statistics ---
3 packets transmitted, 0 packets received, 100% packet loss
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;DNS resolution is important though, and all workers must have a local DNS server to use the Tor resolver. In this scenario, &lt;a href="https://dnsmasq.org/doc.html" rel="noopener noreferrer"&gt;&lt;code&gt;dnsmasq&lt;/code&gt;&lt;/a&gt; is used here.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; /etc/dnsmasq.conf
&lt;span class="go"&gt;no-resolv
&lt;/span&gt;&lt;span class="gp"&gt;server=172.16.0.1#&lt;/span&gt;9053
&lt;span class="go"&gt;local-service
listen-address=127.0.0.1
conf-dir=/etc/dnsmasq.d/,*.conf
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, &lt;code&gt;/etc/resolv.conf&lt;/code&gt; must be updated.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cat&lt;/span&gt; /etc/resolv.conf 
&lt;span class="go"&gt;nameserver 127.0.0.1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this new configuration, workers are allowed to resolve domain names via the Tor network.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;host google.com
&lt;span class="go"&gt;google.com has address 172.253.63.139
google.com has IPv6 address 2607:f8b0:4006:819::200e
Host google.com not found: 4(NOTIMP)
Host google.com not found: 4(NOTIMP)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All workers should also configure their environment with the correct proxies, usually &lt;code&gt;HTTP_PROXY&lt;/code&gt; and &lt;code&gt;HTTPS_PROXY&lt;/code&gt; variables.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;set&lt;/span&gt; | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; proxy
&lt;span class="go"&gt;HTTPS_PROXY='http://172.16.0.1:9080'
HTTP_PROXY='http://172.16.0.1:9080'
http_proxy='http://172.16.0.1:9080'
https_proxy='http://172.16.0.1:9080'
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://curl.se/docs/manpage.html" rel="noopener noreferrer"&gt;&lt;code&gt;curl&lt;/code&gt;&lt;/a&gt; is looking for those variables by default, and should use them. It can be checked by checking the public IP address used via &lt;a href="https://www.ipify.org/" rel="noopener noreferrer"&gt;&lt;code&gt;api.ipify.org&lt;/code&gt;&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;curl https://api.ipify.org&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nb"&gt;echo&lt;/span&gt;
&lt;span class="go"&gt;204.8.96.80
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Indeed, it returns an IP address way different than the one configured on my main router.&lt;/p&gt;

&lt;h1&gt;
  
  
  What About Privoxy?
&lt;/h1&gt;

&lt;p&gt;Most of the time, &lt;a href="https://www.privoxy.org/" rel="noopener noreferrer"&gt;Privoxy&lt;/a&gt; is configured alongside Tor to use it as relay. Indeed, privoxy is way more flexible than Tor itself and can offer a better control. In our case, it will not really be necessary to use it, because nothing will be filtered from the network where the workers are present. Only the firewall needs to be correctly configured to avoid data leaks.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;It was an interesting project, but not a really great idea in the end. Most of the tor exit-nodes are blocked by Google, even more, with the recent certificate issues, using a worker always connected to Gitlab to fetch the latest version through an untrusted highly-risky network is perhaps not the best thing to do right now. This idea can be improved though, and instead of using tor, one can create a VPN and force the server to use it instead of using your public IP address.&lt;/p&gt;

&lt;p&gt;The same kind of configuration can also be used for the i2p services, it will perhaps be a bit different because i2p does not have an onion routing service... but it should work if one wants to force the workers or the servers connected to the network to only use i2p. Another cool stuff would be to create a server relay between tor and i2p.&lt;/p&gt;

&lt;p&gt;A bigger article on Tor is planned, but it is a really huge one and take time to write it. This one is just a quick note regarding the configuration of the workers from my CI/CD infrastructure. Below a schema to help you understand how it works.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F82i5ushjk52khm2ydhk5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F82i5ushjk52khm2ydhk5.png" alt="Network Schema" width="421" height="1061"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As usual, have fun and happy hacking!&lt;/p&gt;




&lt;p&gt;Cover image by &lt;a href="https://unsplash.com/@jorok?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Georgi Kalaydzhiev&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/silhouette-of-person-looking-at-blurred-city-lights-at-night-fVmneYIIcc0?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>tor</category>
      <category>network</category>
      <category>privacy</category>
    </item>
    <item>
      <title>WeeklyReview#202643</title>
      <dc:creator>Mathieu Kerjouan</dc:creator>
      <pubDate>Mon, 26 Oct 2026 10:00:00 +0000</pubDate>
      <link>https://dev.to/niamtokik/weeklyreview202643-4dp5</link>
      <guid>https://dev.to/niamtokik/weeklyreview202643-4dp5</guid>
      <description>&lt;p&gt;Black October: the day people discovered Internet is a dangerous place this week. And what a week... It was absurdly hard days for the security world, and it's probably not done yet (because this note has been updated a lot). A huge amount of security issues and other crazy discoveries were announced in few hours/days. Good luck to all my sysadmin friends working to make their infrastructure safer.&lt;/p&gt;

&lt;p&gt;One of the very first big issue was due to a certificate authority problem. Many certificates generated by eMudhra (an Indian company) were totally unsafe. Indeed, their private keys were all an unique integer between 0 and 255 (uint8), instead of a long integer encoded on 384 bits. All started on 17th October, when "Wayne" (a security guy playing with new tools), discovered 8 odd certificates. A ticket was opened on &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=2083449" rel="noopener noreferrer"&gt;Mozilla's Bugzilla&lt;/a&gt;. The thread is still very active. The consequences are concerning. &lt;a href="https://discuss.python.org/t/information-for-python-users-regarding-emudhra-emsign-ca-certificate-security-incident/109576" rel="noopener noreferrer"&gt;Python&lt;/a&gt; is impacted and many packages must be updated. The &lt;a href="https://com.erlef.org/wg/sec/2026/10/20/root-certs-compromised.html" rel="noopener noreferrer"&gt;Erlang Ecosystem Foundation&lt;/a&gt; did also a post about this issue explaining which modules must be upgraded as soon as possible. All &lt;a href="https://emudhra.we-have-a-problem.com/" rel="noopener noreferrer"&gt;Operating Systems&lt;/a&gt; are also impacted by this issue, and the certificates must be upgraded locally as well. The &lt;a href="https://github.com/mitmproxy/mitmproxy/issues/8497" rel="noopener noreferrer"&gt;&lt;code&gt;mitmproxy&lt;/code&gt; project&lt;/a&gt; already includes on its last version those certificates. More information below.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=2082872" rel="noopener noreferrer"&gt;&lt;strong&gt;eMudhra emSign PKI Services: CP/CPS documents not updated for current requirements&lt;/strong&gt;&lt;/a&gt; from Mozilla's Bugzilla thread;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=2083449" rel="noopener noreferrer"&gt;&lt;strong&gt;eMudhra: Private key compromise of Intermediate Certificates&lt;/strong&gt;&lt;/a&gt; from Mozilla's Bugzilla thread;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://discuss.python.org/t/information-for-python-users-regarding-emudhra-emsign-ca-certificate-security-incident/109576" rel="noopener noreferrer"&gt;&lt;strong&gt;Information for Python users regarding eMudhra / emSign CA certificate security incident&lt;/strong&gt;&lt;/a&gt; from Python's Discuss thread;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://com.erlef.org/wg/sec/2026/10/20/root-certs-compromised.html" rel="noopener noreferrer"&gt;&lt;strong&gt;eMudhra CA Intermediate Certificates have been compromised, CA updates needed on all TLS components&lt;/strong&gt;&lt;/a&gt; from the Erlang Ecosystem Foundation;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.alpinelinux.org/posts/Alpine-3.21.9-3.22.7-3.23.7-3.24.3-released.html" rel="noopener noreferrer"&gt;&lt;strong&gt;Alpine Linux 3.24.3&lt;/strong&gt;&lt;/a&gt; from Alpine Linux website;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.openbsd.org/errata80.html" rel="noopener noreferrer"&gt;&lt;strong&gt;OpenBSD 8.0 Errata 005&lt;/strong&gt;&lt;/a&gt; from the OpenBSD website;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://vuxml.freebsd.org/freebsd/070a35ef-cd22-11f1-ada3-bc241121aa0a.html" rel="noopener noreferrer"&gt;&lt;strong&gt;FreeBSD -- TLS certificate store update due to eMudhra compromise&lt;/strong&gt;&lt;/a&gt; from FreeBSD VuXML;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://blog.netbsd.org/tnf/entry/emudhra_tls_ssl_ca_compromise" rel="noopener noreferrer"&gt;&lt;strong&gt;eMudhra TLS/SSL CA compromise&lt;/strong&gt;&lt;/a&gt; from the NetBSD blog;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://lists.debian.org/debian-security-announce/2026/msg00487.html?pow_referer=" rel="noopener noreferrer"&gt;&lt;strong&gt;Debian ca-certificates security update&lt;/strong&gt;&lt;/a&gt;, from the Debian mailing-list;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://thehackernews.com/2026/10/eight-emudhra-ca-keys-compromised.html" rel="noopener noreferrer"&gt;&lt;strong&gt;Eight eMudhra CA Keys Compromised, Triggering Emergency Fixes Across Browsers and Software&lt;/strong&gt;&lt;/a&gt; from The Hacker News;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.reuters.com/legal/litigation/indian-firm-emudhra-exits-global-digital-certificates-business-after-2026-10-22/" rel="noopener noreferrer"&gt;&lt;strong&gt;India's eMudhra exits website security business after flaws trigger global alarm&lt;/strong&gt;&lt;/a&gt; from Reuters;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.oracle.com/security-alerts/alert-cve-2026-91403.html" rel="noopener noreferrer"&gt;&lt;strong&gt;Oracle Security Alert Advisory - CVE-2026-91403&lt;/strong&gt;&lt;/a&gt; from Oracle/Java website.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;PHP is well known for Wikimedia, Drupal, Wordpress, Symphony and many other frameworks/projects widely used around the world. Unfortunately, PHP design is not the best, and during the past decades, many critical issues have been impacted it. This week, 2 huge security issues have been released  with a CVE score greater than 9 and allowing remote code executions. What's crazy here is those vulnerabilities have been discovered in 2024 (!) during an audit.&lt;/p&gt;

&lt;p&gt;PHP was my first "real" language, like probably many of the developers and sysadmin of my generation. This language was - and still is - a big joke regarding design and consistency. During the week, PHP was also impacted by 2 big security issues with a score greater than 9 on the CVE scale. The whole story is just a pure mess. Called &lt;code&gt;php2shell&lt;/code&gt;, the bug can execute arbitrary code on a remote server. Those bugs have been discovered in 2024 (!) during an audit. The PHP Foundation &lt;a href="https://thephp.foundation/blog/2026/10/21/todays-php-security-release-and-how-were-strengthening-php-security/" rel="noopener noreferrer"&gt;published a post&lt;/a&gt; on their blog explaining the whole process. Another crazy thing is, &lt;a href="https://github.com/twili8/php2shell-poc" rel="noopener noreferrer"&gt;someone&lt;/a&gt; published an exploit few days before the official release, without any consideration of the companies being impacted by this news. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://thehackernews.com/2026/10/php-issues-emergency-patches-for-two.html" rel="noopener noreferrer"&gt;&lt;strong&gt;PHP Issues Emergency Patches for Two Critical PHP2Shell RCE Flaws as Exploit Attempts Emerge&lt;/strong&gt;&lt;/a&gt; on The Hacker News;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://thehackernews.com/2026/10/php2shell-what-actually-protects-you.html" rel="noopener noreferrer"&gt;&lt;strong&gt;PHP2Shell: What Actually Protects You Before the 14:00 UTC PHP RCE Patch, and What Doesn't&lt;/strong&gt;&lt;/a&gt; on the Hacker News;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://thehackernews.com/2026/10/php2shell-two-unpatched-critical-php.html" rel="noopener noreferrer"&gt;&lt;strong&gt;PHP2Shell: Two Unpatched Critical PHP RCE Flaws (CVSS 9.2) Trigger Emergency Security Alert&lt;/strong&gt;&lt;/a&gt; on The Hacker News;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://webhosting.today/2026/10/21/two-critical-php-flaws-leaked-ahead-of-the-october-21-security-release/" rel="noopener noreferrer"&gt;&lt;strong&gt;Two Critical PHP Flaws Leaked Ahead of the October 21 Security Release&lt;/strong&gt;&lt;/a&gt; on WebHosting.today;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://thephp.foundation/blog/2026/10/21/todays-php-security-release-and-how-were-strengthening-php-security/" rel="noopener noreferrer"&gt;&lt;strong&gt;Today's PHP Security Release, and How We're Strengthening PHP Security&lt;/strong&gt;&lt;/a&gt; on the Official PHP Foundation blog;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://abraxaslabs.tech/research/php2shell" rel="noopener noreferrer"&gt;&lt;strong&gt;PHP2Shell: CVE-2026-109618 and CVE-2026-109619&lt;/strong&gt;&lt;/a&gt; exploits on Abraxas Labs;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/abraxas/php-stale-global-uaf" rel="noopener noreferrer"&gt;&lt;strong&gt;php2shell/php2dos - php-stale-global-uaf&lt;/strong&gt;&lt;/a&gt; exploit on Github;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/abraxas/php-oom-longjmp" rel="noopener noreferrer"&gt;&lt;strong&gt;php2shell - php-oom-longjmp&lt;/strong&gt;&lt;/a&gt; exploits on Github;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://xeiaso.net/shitposts/no-way-to-prevent-this/memory-safety/CVE-2026-109618/" rel="noopener noreferrer"&gt;&lt;strong&gt;Jesus Christ patch your shit now&lt;/strong&gt;&lt;/a&gt; on xeiaso.net.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A second breach in PHP has also been announced, not related to PHP2Shell, linked to the Session process.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.php.net/archive/2026.php#2026-10-23-1" rel="noopener noreferrer"&gt;&lt;strong&gt;Informational advisory: Session upload progress&lt;/strong&gt;&lt;/a&gt; from PHP official website;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/ivst/CVE-2026-115560" rel="noopener noreferrer"&gt;&lt;strong&gt;CVE-2026-115560 — PHP session upload progress mitigation&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At the same time, QUIC/HTTP/3 was also impacted by another 0day vulnerability called &lt;a href="https://foxio.io/blog/header-accordions-qpack-amplification-attacks-against-http-3-servers" rel="noopener noreferrer"&gt;quiche&lt;/a&gt;, causing a DoS and eventually an OOM on many implementation of this protocol.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://foxio.io/blog/header-accordions-qpack-amplification-attacks-against-http-3-servers" rel="noopener noreferrer"&gt;&lt;strong&gt;Header Accordions: QPACK amplification attacks against HTTP/3 servers&lt;/strong&gt;&lt;/a&gt; on Foxio.io;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/FoxIO-LLC/blog_poc/tree/main/headeraccordions" rel="noopener noreferrer"&gt;&lt;strong&gt;headeraccordions&lt;/strong&gt;&lt;/a&gt; exploit/poc on Github.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's not over... Gitlab also released emergency patches for Gitlab Community and Enterprise Edition containing 12 fixes, including one &lt;a href="https://docs.gitlab.com/releases/patches/patch-release-gitlab-19-5-1-released/#cve-2026-110264---integer-overflow-issue-in-regular-expression-compiler-impacts-gitlab-ceee" rel="noopener noreferrer"&gt;critical vulnerability&lt;/a&gt; allowing an unauthenticated user to execute arbitrary code remotely.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://docs.gitlab.com/releases/patches/patch-release-gitlab-19-5-1-released" rel="noopener noreferrer"&gt;&lt;strong&gt;GitLab Critical Patch Release: 19.5.1, 19.4.3, 19.3.6, 19.2.9, 19.1.9, 19.0.10, 18.11.13&lt;/strong&gt;&lt;/a&gt; on Official Gitlab Documentation:&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://thehackernews.com/2026/10/critical-gitlab-flaw-cvss-100-could.html" rel="noopener noreferrer"&gt;&lt;strong&gt;Critical GitLab Flaw (CVSS 10.0) Could Allow Unauthenticated RCE Across 12 Years of Releases&lt;/strong&gt;&lt;/a&gt; on The Hacker News.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Signal released also a series of patch to fix a critical security issue, allowing someone to keep the micro and the camera active after a call.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.theregister.com/security/2026/10/21/signal-bug-could-keep-your-mic-and-camera-on-after-hangup/5304528" rel="noopener noreferrer"&gt;&lt;strong&gt;Signal bug could keep your mic - and camera - on after hangup&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/signalapp/ringrtc/blob/a1d2ffed1de6ac5b22458a3dced8374513cc44f8/CHANGELOG.md" rel="noopener noreferrer"&gt;&lt;strong&gt;Signal v2.72.0&lt;/strong&gt;&lt;/a&gt; on Gitlab;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://cwe.mitre.org/data/definitions/754.html" rel="noopener noreferrer"&gt;&lt;strong&gt;CWE-754: Improper Check for Unusual or Exceptional Conditions&lt;/strong&gt;&lt;/a&gt; on Common Weakness Enumeration website.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;NodeJs, as usual, is always there to offer us more vulnerabilities, even when we don't need them. Nodejs team released a long series of patches fixing dangerous security issues, 4 of them with high level risks.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://nodejs.org/en/blog/vulnerability/october-2026-security-releases" rel="noopener noreferrer"&gt;&lt;strong&gt;Wednesday, October 21, 2026 Security Releases&lt;/strong&gt;&lt;/a&gt; on NodeJS official blog;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://vercel.com/kb/bulletin/node-js-security-advisory" rel="noopener noreferrer"&gt;&lt;strong&gt;Node.js security advisory: Brotli decoder RCE (CVE-2026-111497)&lt;/strong&gt;&lt;/a&gt; on Vercel;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://xeiaso.net/shitposts/no-way-to-prevent-this/memory-safety/CVE-2026-111497/" rel="noopener noreferrer"&gt;&lt;strong&gt;"No way to prevent this" say users of only language where this regularly happens&lt;/strong&gt;&lt;/a&gt; on Xeiaso.net.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do you think it's over? Not at all! &lt;a href="https://trafficserver.apache.org/" rel="noopener noreferrer"&gt;Apache traffic&lt;/a&gt; HTTP server released a new released to fix 15 vulnerabilities, including remote code execution and many other crazy holes.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://xeiaso.net/shitposts/no-way-to-prevent-this/memory-safety/CVE-2026-111813/" rel="noopener noreferrer"&gt;&lt;strong&gt;"No way to prevent this" say users of only language where this regularly happens&lt;/strong&gt;&lt;/a&gt; on xeiaso.net;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://lists.apache.org/thread/r95dq29ywcd1f4x30snxlqmb12z4s4kc" rel="noopener noreferrer"&gt;&lt;strong&gt;[SECURITY] Multiple vulnerabilities fixed in Apache Traffic Server 9.2.16, 10.1.5 and 10.2.1&lt;/strong&gt;&lt;/a&gt; on apache traffic mailing-list.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A dangerous memory corruption bug on Bind9 can lead an attacker to execute remote code. Again, high severity issue, needs to be patched as soon as possible.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://kb.isc.org/docs/cve-2026-94300" rel="noopener noreferrer"&gt;&lt;strong&gt;CVE-2026-94300: Concurrent GSS-TSIG messages corrupt memory&lt;/strong&gt;&lt;/a&gt; on ISC.org;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://xeiaso.net/shitposts/no-way-to-prevent-this/memory-safety/CVE-2026-94300/" rel="noopener noreferrer"&gt;&lt;strong&gt;"No way to prevent this" say users of only language where this regularly happens&lt;/strong&gt;&lt;/a&gt; on Xeiaso.net.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Tor - which is becoming less and less trusted due to many design flaws and unfixed security issues - has also been impacted by a serious attack. 333 exit nodes on the tor network have been compromised and were used to do man in the middle attack on SSH connections. In case of success, the attackers were able to watch the commands and install backdoors.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://thehackernews.com/2026/10/attackers-hijacked-over-300-tor-exit.html" rel="noopener noreferrer"&gt;&lt;strong&gt;Attackers Hijacked Over 300 Tor Exit Relays to Intercept SSH Connections&lt;/strong&gt;&lt;/a&gt; from the Hacker News;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://lists.torproject.org/mailman3/hyperkitty/list/tor-relays@lists.torproject.org/message/Z2B6XYKJZBBQADU77MSNL6FJP7MHZHIV/" rel="noopener noreferrer"&gt;&lt;strong&gt;[tor-relays] Re: Ebury 1.8.3 on two Quetzalcoatl relay servers: timeline, lessons, open questions&lt;/strong&gt;&lt;/a&gt; from the Tor project mailing list.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The French provider OVH has been victim of a supply chain attack, replacing the binaries of many versions of their CLI tool.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://x.com/lukOlejnik/status/2113146344118337935?s=20" rel="noopener noreferrer"&gt;&lt;strong&gt;OVH supply chain compromise&lt;/strong&gt;&lt;/a&gt; on Twitter.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The LiteLLM Python package has been compromised with a supply chain attack as well, injecting malwares via Pypi and Docker images.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://x.com/SocketSecurity/status/2112907732877775016" rel="noopener noreferrer"&gt;&lt;strong&gt;LiteLLM, a Python package for connecting to AI model providers with 92M+ monthly downloads, has been compromised.&lt;/strong&gt;&lt;/a&gt; on Twitter;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.theregister.com/security/2026/10/21/litellm-supply-chain-attack-hoovers-up-passwords-and-secrets/5304548" rel="noopener noreferrer"&gt;&lt;strong&gt;LiteLLM supply chain attack hoovers up passwords and secrets&lt;/strong&gt;&lt;/a&gt; on The Register.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;PHP, NodeJS, and... Ruby. This language requires to be patched due to remote code execution vulnerability related to the Regexp module (integer overflows and double free issue). All versions of Ruby are impacted.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.ruby-lang.org/en/news/2026/10/23/regexp-fixes-for-gitlab-cves/" rel="noopener noreferrer"&gt;&lt;strong&gt;Regexp compilation fixes related to GitLab's CVE-2026-89078, CVE-2026-93577, CVE-2026-97229 and CVE-2026-110264&lt;/strong&gt;&lt;/a&gt; from the official Ruby news.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Kubernetes will also have a bad time, with 4 critical CVEs released very soon, including an issue on Azure Kubernetes, allowing remote code execution.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://app.opencve.io/cve/CVE-2026-83938" rel="noopener noreferrer"&gt;&lt;strong&gt;CVE-2026-83938 - Azure Kubernetes Configuration Service Elevation of Privilege Vulnerability&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I don't even think it's done... And to be honest, I am not the only one to do a summary of all those security issues. Here few of them from Twitter:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://x.com/techie_piyush/status/2113065045382807700?s=20" rel="noopener noreferrer"&gt;&lt;strong&gt;THE INTERNET BROKE TODAY&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://x.com/AISafetyMemes/status/2113113711644737835?s=20" rel="noopener noreferrer"&gt;&lt;strong&gt;This is the most serious 48 hours in cybersecurity history.&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://x.com/juampitech/status/2113041641481138358?s=20" rel="noopener noreferrer"&gt;&lt;strong&gt;October has been an absolute nightmare for software&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://x.com/DevMuzzammil/status/2113042127039164663?s=20" rel="noopener noreferrer"&gt;&lt;strong&gt;We can call it Black October for the security breaches:&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://x.com/RaphaelRedmer/status/2113224897199477015?s=20" rel="noopener noreferrer"&gt;&lt;strong&gt;33 security incidents in the news this October, sorted by size. 7 ran on a stolen key (K), 4 abused a trusted channel (T).&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://x.com/infinterenders/status/2113223887198519428?s=20" rel="noopener noreferrer"&gt;&lt;strong&gt;This week the internet’s core infrastructure got hit harder than most people realize&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;While writing my article on the &lt;code&gt;libsodium&lt;/code&gt; library port on Dart using FFI, I also checked the Erlang driver called &lt;a href="https://github.com/potatosalad/erlang-libsodium" rel="noopener noreferrer"&gt;&lt;code&gt;erlang-libsodium&lt;/code&gt;&lt;/a&gt;. Sadly this package was kinda old (&lt;a href="https://github.com/jedisct1/libsodium/releases#release-1.0.18-RELEASE" rel="noopener noreferrer"&gt;version 1.0.18+&lt;/a&gt; released in 2019). Few issues and PRs have been opened to fix the library, but the project seems to be dead. Anyway, I wanted to use is to test the interoperability with the Dart implementation, and decided to fork it. &lt;code&gt;libsodium&lt;/code&gt; has been updated to version 1.0.22 (the latest), the PRs have been merged, and I'm working on doing a lot of test cleanup. After that, I will - perhaps - ports the missing features from the latest release. The project can be found here: &lt;a href="https://github.com/niamtokik/erlang-libsodium/" rel="noopener noreferrer"&gt;niamtokik/erlang-libsodium&lt;/a&gt; on Github.&lt;/p&gt;




&lt;p&gt;What's happening in the economy right now is interesting -- and also terrifying. During the week, most of the big players just started to fall, as well as the Asian market.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The Semiconductor (SOX) Index was hammered 11.4% [...] Supporting the bursting Bubble thesis, the semi equipment stocks were under notable pressure. Applied Materials lost 19.3%, Lam Research 17.2%, and KLA 15.3%. Coherent dropped 25.5%, Lattice Semiconductor 17.8%, and Marvell Technology 17.2%. Nvidia slumped 6.1%, down a quick 12% in eight sessions. Broadcom fell 9.1% to a six-month low. Micron sank 14.6%, Intel 14.2%, and AMD 13.1%. South Korea’s KOSPI Index was hammered 14.5% this week, with a seven-session drop of 18.3%. [...] Japan’s Nikkei Index fell 5.4%.&lt;br&gt;
-- &lt;a href="https://creditbubblebulletin.blogspot.com/2026/10/weekly-commentary-hope-im-wrong.html" rel="noopener noreferrer"&gt;Credit Bulletin Report&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In fact, this situation is a direct result of something I saw many time in the past. Most of the current companies are not really companies anymore, but they look like sects. They are selling dreams, and faith to people without having an ounce of the knowledge or the experiences required to understand the bare minimum. You don't even need to give big proofs to make them pay, you know the aphorism "fake it until you make it". You just need one small miracle to make your company grows exponentially. The result? Some "expert" will also fall in the trap, and will start to preach. It will attract more people, blindly believing in them and in fine, in the technology sold by the company. The reality is harsh, and every actions produce reactions.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Investors are losing confidence that revenues from the AI boom will be sufficient to support the vast debt piles financing data centres, pushing bonds backing some of the largest US infrastructure projects into increasingly stressed territory.&lt;br&gt;
-- &lt;a href="https://creditbubblebulletin.blogspot.com/2026/10/weekly-commentary-hope-im-wrong.html" rel="noopener noreferrer"&gt;Credit Bulletin Report&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The recent message(s) from Linus Torvalds are hilarious. Torlvads has a strong reputation to be against a lot of new/modern technologies, but for LLMs, that's okay, that's just another tool. It's fascinating to see someone like him using LLMs and trashing other people opinions on this subject when you know the &lt;a href="//aiwiki.ai/wiki/open_secure_ai_alliance"&gt;Open Secure AI Alliance&lt;/a&gt; joined the &lt;a href="https://www.linuxfoundation.org/blog/open-secure-ai-alliance-joins-the-linux-foundation-to-build-a-shared-open-defense-stack-for-the-ai-era" rel="noopener noreferrer"&gt;Linux Foundation&lt;/a&gt; in September. What kind of companies are present in this alliance? NVIDIA, Microsoft, Cisco, CrowdStrike, Hugging Face, IBM, Palantir, Red Hat and many others.&lt;/p&gt;

&lt;p&gt;It's not done yet, nvidia is also giving money to Linux Foundations in many other ways. They are &lt;a href="https://www.phoronix.com/news/NVIDIA-Premier-Sponsor-LVFS" rel="noopener noreferrer"&gt;LVFS sponcors&lt;/a&gt; and they are supporting many other &lt;a href="https://opensource.nvidia.com/en-us/" rel="noopener noreferrer"&gt;open-source projects&lt;/a&gt; (including the Linux Foundation). In fact, we don't even know the amount of money nvidia is giving to the Linux Foundation because it is not public. In doubt, follow the money, even a monk can be corrupted with gold.&lt;/p&gt;

&lt;p&gt;Anyway, the LLM buzz is like the blockchain/crypto-currency one. They have both been created to do what fraudsters do the best: steal the money from your pocket by selling you a dream. The sects are doing the same with their victims. The result? What will happen when investors will discover all of these companies are selling snakeoil? They will simply ask their investment back. With &lt;a href="https://www.techtimes.com/articles/323034/20260804/anthropic-stacks-second-record-debt-deal-60-days-compute-bill-defies-equity-raise.htm" rel="noopener noreferrer"&gt;$71 billions debt&lt;/a&gt; for Anthropic, and the small revenue generated by the company, it will become hard to explain that to investors.&lt;/p&gt;

&lt;p&gt;In short: this is a bubble, it will pop one day, probably very soon (if it's not already the case). To my brainwashed IT colleagues, please stop be part of these frauds...&lt;/p&gt;




&lt;h1&gt;
  
  
  Coding
&lt;/h1&gt;

&lt;p&gt;🏗️ &lt;a href="https://github.com/atc1441/Vape_DOOM_ScreenShare/tree/main/PixoAspire_DOOM_Port" rel="noopener noreferrer"&gt;&lt;strong&gt;DOOM on the Aspire PIXO — natively&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  System
&lt;/h1&gt;

&lt;p&gt;📝 &lt;a href="https://undeadly.org/cgi?action=article;sid=20261018200218" rel="noopener noreferrer"&gt;&lt;strong&gt;Introducing uncm(4)&lt;/strong&gt;&lt;/a&gt;: finally! a replacement for &lt;a href="https://man.openbsd.org/urndis" rel="noopener noreferrer"&gt;&lt;code&gt;urndis&lt;/code&gt;&lt;/a&gt; driver working with recent version of Android! Say hello to &lt;a href="https://man.openbsd.org/uncm" rel="noopener noreferrer"&gt;&lt;code&gt;uncm&lt;/code&gt;&lt;/a&gt;, providing support for the USB Network Control Model Ethernet devices.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://loige.co/hidden-design-compromises-of-docker-layers/" rel="noopener noreferrer"&gt;&lt;strong&gt;The hidden design compromises of Docker layers&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://undeadly.org/cgi?action=article;sid=20261021191736" rel="noopener noreferrer"&gt;&lt;strong&gt;dbupdate(8) added to -current&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🌐 &lt;a href="https://exe.dev/" rel="noopener noreferrer"&gt;&lt;strong&gt;exe.dev&lt;/strong&gt;&lt;/a&gt;: Computers for developers and agents (Durable Sandboxes that are fast, secure, and sharable).&lt;/p&gt;

&lt;h1&gt;
  
  
  Database
&lt;/h1&gt;

&lt;p&gt;🏗️ &lt;a href="https://github.com/HexaCluster/credcheck" rel="noopener noreferrer"&gt;&lt;strong&gt;credcheck&lt;/strong&gt;&lt;/a&gt;: provides few general credential checks, which will be evaluated during the user creation, during the password change and user renaming.&lt;/p&gt;

&lt;p&gt;🏗️ &lt;a href="https://github.com/ossc-db/pg_hint_plan/" rel="noopener noreferrer"&gt;&lt;strong&gt;pg_hint_plan&lt;/strong&gt;&lt;/a&gt;: makes it possible to tweak PostgreSQL execution plans using so-called "hints" in SQL comments.&lt;/p&gt;

&lt;h1&gt;
  
  
  Security
&lt;/h1&gt;

&lt;p&gt;📝 &lt;a href="https://pwn.ai/blog/pwnescape" rel="noopener noreferrer"&gt;&lt;strong&gt;PwnEscape: Guest-to-Host KVM Escape (CVE-2026-99999)&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📑 &lt;a href="https://arxiv.org/abs/2606.19535" rel="noopener noreferrer"&gt;&lt;strong&gt;FloatDoor: Platform-Triggered Backdoors in LLMs&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🌐 &lt;a href="https://bugzilla.mozilla.org/show_bug.cgi?id=2083449" rel="noopener noreferrer"&gt;&lt;strong&gt;Private key compromise of eMudhra Intermediate Certificates&lt;/strong&gt;&lt;/a&gt;: the thread from mozilla regarding the corrupted certificate.&lt;/p&gt;

&lt;p&gt;🌐 &lt;a href="https://emudhra.we-have-a-problem.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;eMudhra Intermediate CA Compromise&lt;/strong&gt;&lt;/a&gt;: a longer post with solutions to apply after the CA corrupted certificate.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://kaba.cx/posts/20261020_Tor/" rel="noopener noreferrer"&gt;&lt;strong&gt;How I got over 300 Tor exit nodes removed&lt;/strong&gt;&lt;/a&gt;: a huge attack on tor network, where 333 nodes have been deployed to do MITM attack on SSH connections.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://blog.29b.net/dispatches/viltrox_re/" rel="noopener noreferrer"&gt;&lt;strong&gt;Dumping Encrypted Viltrox Lens Firmware - two times&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://quentinkaiser.be/security/2026/10/16/one-parser-two-bugs/" rel="noopener noreferrer"&gt;&lt;strong&gt;One Parser, Two Bugs, Many Routers: Exploiting Broadcom WiFi Across eCos and Linux&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🌐 &lt;a href="https://exploitgrid.net/" rel="noopener noreferrer"&gt;&lt;strong&gt;ExploitGrid&lt;/strong&gt;&lt;/a&gt;: Get notified when a CVE hits the software you run.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://www.phoronix.com/news/LKML-New-Trend-Vulnerabilities" rel="noopener noreferrer"&gt;&lt;strong&gt;Several Linux Kernel Vulnerabilities Accidentally Posted To Public Kernel Mailing List&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://www.axios.com/2026/10/22/ai-agents-banks-unauthorized-accounts-access" rel="noopener noreferrer"&gt;&lt;strong&gt;Scoop: Unvetted AI agents are accessing U.S. bank accounts&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Security/cryptography
&lt;/h1&gt;

&lt;p&gt;📑 &lt;a href="https://www.anthropic.com/research/ecdsa-curve-origins" rel="noopener noreferrer"&gt;&lt;strong&gt;Claude reveals ECDSA curve origins&lt;/strong&gt;&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://saweis.net/posts/nist-curve-seed-origins.html" rel="noopener noreferrer"&gt;&lt;strong&gt;How were the NIST ECDSA curve parameters generated?&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://mrosenberg.pub/blog/cryptoslop/" rel="noopener noreferrer"&gt;&lt;strong&gt;Can You Slop Out High-Assurance Cryptography?&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Update/Upgrade
&lt;/h1&gt;

&lt;p&gt;🔄 &lt;a href="https://www.openbsd.org/80.html" rel="noopener noreferrer"&gt;&lt;strong&gt;OpenBSD 8.0&lt;/strong&gt;&lt;/a&gt;: another release of OpenBSD.&lt;/p&gt;

&lt;p&gt;🔄 &lt;a href="https://github.com/rabbitmq/rabbitmq-server/releases/tag/v4.4.0" rel="noopener noreferrer"&gt;&lt;strong&gt;RabbitMQ 4.4.0&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🔄 &lt;a href="https://github.com/phoenixframework/phoenix/releases/tag/v1.8.16" rel="noopener noreferrer"&gt;&lt;strong&gt;Phoenix 1.8.6&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Misc
&lt;/h1&gt;

&lt;p&gt;📝 &lt;a href="https://hackernoon.com/theo-de-raadt-the-man-who-built-the-internets-locks" rel="noopener noreferrer"&gt;&lt;strong&gt;Theo de Raadt: The Man Who Built the Internet's Locks&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🐦 &lt;a href="https://x.com/ProtonPrivacy/status/2113274715124945133" rel="noopener noreferrer"&gt;&lt;strong&gt;Meta just got hit with the largest penalty ever imposed on the company.&lt;/strong&gt;&lt;/a&gt;:  Meta will pay $25 bn for misleading Facebook users about how their data was protected. &lt;/p&gt;

&lt;h1&gt;
  
  
  Leaks of the week
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://frenchbreaches.com/alertes/pcf-fuite-donnees-personnelles-vente-forum-cybercriminel-mvl13xuxyt1dju2rbve" rel="noopener noreferrer"&gt;&lt;strong&gt;French Communist Party&lt;/strong&gt;&lt;/a&gt;: 183000 users impacted.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://frenchbreaches.com/alertes/fuite-donnees-lfi-porte-a-porte-rendez-vous-mvm6atypwytjz0coskh" rel="noopener noreferrer"&gt;&lt;strong&gt;La France Insoumise&lt;/strong&gt;&lt;/a&gt;: leaks about campaigns and organization.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://frenchbreaches.com/blog/admr-les-donnees-medicales-de-millions-de-francais-potentiellement-exposees" rel="noopener noreferrer"&gt;&lt;strong&gt;ADMR&lt;/strong&gt;&lt;/a&gt;: 4.5 millions people impacted, the leak include data about health and daily habits.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://frenchbreaches.com/alertes/association-m-dico-sociale-anne-morgan-amsam-rw_UVUxVFFVMUFZbkpoZG05NA" rel="noopener noreferrer"&gt;&lt;strong&gt;AMSAM&lt;/strong&gt;&lt;/a&gt;: 922GB of data stolen including invoices, bills, many kind of internal documents about 400 people.&lt;/p&gt;




&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-2113335587038167169-955" src="https://platform.twitter.com/embed/Tweet.html?id=2113335587038167169"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-2113335587038167169-955');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=2113335587038167169&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/jaosef/status/2111215671476379891?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqz43t9e3kp9ak9f2lhy1.png" alt=" " width="598" height="140"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/moti256/status/2111045235916623934?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fw1659mzg1ec7dd4j49cz.png" alt=" " width="598" height="242"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/defnotbeka/status/2111504841000517792?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbr48bgdc2o4xg9jf3va1.png" alt=" " width="598" height="178"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3zi1txh11sor7iakz206.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3zi1txh11sor7iakz206.png" alt=" " width="598" height="118"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/zekramu/status/2111485024239530140?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8en70jdwzr5jq8pv6d69.png" alt=" " width="598" height="198"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/ill_Scholar/status/2111335049744290182?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fev4vsxamj9piwnxdaf78.png" alt=" " width="598" height="408"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/JeffBohren/status/2111542985842135126?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbtyoq4wotw5q7d1l0sew.png" alt=" " width="598" height="368"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/satellitedown/status/2111879374056345937?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fiusg1zfx7jn3zet762xw.png" alt=" " width="598" height="138"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/tsoding/status/2112005201557098662?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fojhuu50fr0fvwz154e1k.png" alt=" " width="598" height="158"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/FinanceLancelot/status/2111879798003741028?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fttjiqdjslnwc50opu1c1.png" alt=" " width="598" height="884"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/PluckedFruit/status/2112585058649559187?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcvwy3fppiu2segef67do.png" alt=" " width="598" height="138"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/FinanceLancelot/status/2112677522588516504?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fhu7poio67oz0346u7n29.png" alt=" " width="598" height="655"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/IceSolst/status/2112639669913768363?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ficccnoy8y77lhvqjnj2i.png" alt=" " width="598" height="436"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/garybernhardt/status/2112680936060104802?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Famqtriktr6jr0t58wtfh.png" alt=" " width="598" height="158"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/shortmagsmle/status/2112758863758008613?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fllqbi5sy1ovmn14oy0az.png" alt=" " width="598" height="158"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/IzzatStatus/status/2112781125697589746?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0yk38gl4kozhihr7167p.png" alt=" " width="598" height="802"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/digitaldutta/status/2112763914249453763?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjd0fx4xsxa5r4pu46jmq.png" alt=" " width="598" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/lcamtuf/status/2112630915579162640?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Focjr6142k7ogmlzwo5go.png" alt=" " width="598" height="98"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/psankar/status/2112761583382446550?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fonukib7a1kswsqrfi43b.png" alt=" " width="598" height="178"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/IzzatStatus/status/2112781125697589746?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F381e3nniitcv6mo57hu8.png" alt=" " width="598" height="802"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/ghidraninja/status/2112616423004705070?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffu3fnrkznd5macnkffh6.png" alt=" " width="598" height="158"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/zephyr_z9/status/2113088278081741086?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fibzjfq6ikmvtkm4dxxf0.png" alt=" " width="598" height="580"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/Klotzkette/status/2113335392778723472?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjg41k6pgur1i9bvkk28w.png" alt=" " width="598" height="682"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F03781umx3cvga1uym9bo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F03781umx3cvga1uym9bo.png" alt=" " width="382" height="679"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs8wbj9jpd3q8msks2ll4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fs8wbj9jpd3q8msks2ll4.png" alt=" " width="500" height="374"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5ijv3nxv3rwn9yil2r0k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5ijv3nxv3rwn9yil2r0k.png" alt=" " width="400" height="144"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzyvqmb0t98wjk4684mp1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzyvqmb0t98wjk4684mp1.png" alt=" " width="680" height="208"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fae4e9nakuxnxve6fw2d3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fae4e9nakuxnxve6fw2d3.png" alt=" " width="556" height="680"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjuakhwerny8iiyy3ogkp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjuakhwerny8iiyy3ogkp.png" alt=" " width="548" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ff7qxszwv8i6cmwb4kkyu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ff7qxszwv8i6cmwb4kkyu.png" alt=" " width="680" height="383"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6l7iuv5buw4zfz5cum2n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F6l7iuv5buw4zfz5cum2n.png" alt=" " width="680" height="380"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8vo3kr8aju7tb0h9c9qk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8vo3kr8aju7tb0h9c9qk.png" alt=" " width="585" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4sevp74dpkskq4d9mkji.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4sevp74dpkskq4d9mkji.png" alt=" " width="479" height="679"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz1zpu8va1jps3tejlvpa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fz1zpu8va1jps3tejlvpa.png" alt=" " width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuqnb2qvn1vssn4j98rm3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuqnb2qvn1vssn4j98rm3.png" alt=" " width="680" height="383"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqcdsdr86hc5dtxwp3twz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqcdsdr86hc5dtxwp3twz.png" alt=" " width="451" height="90"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqweoeccvtdq6cco25xw0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fqweoeccvtdq6cco25xw0.png" alt=" " width="544" height="680"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Cover image by &lt;a href="https://unsplash.com/@thatsmrbio?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Matthew Hamilton&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/aerial-view-of-brown-leaves-I0sDI_paMq4?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>weekly</category>
      <category>review</category>
    </item>
    <item>
      <title>A review of the libsodium library in Dart</title>
      <dc:creator>Mathieu Kerjouan</dc:creator>
      <pubDate>Thu, 22 Oct 2026 08:00:00 +0000</pubDate>
      <link>https://dev.to/niamtokik/a-review-of-the-libsodium-library-in-dart-3b9i</link>
      <guid>https://dev.to/niamtokik/a-review-of-the-libsodium-library-in-dart-3b9i</guid>
      <description>&lt;p&gt;This article is a big sandbox based on the notes I took during my test of the &lt;a href="https://pub.dev/packages/sodium" rel="noopener noreferrer"&gt;&lt;code&gt;sodium&lt;/code&gt;&lt;/a&gt; Dart package, an implementation of the &lt;a href="https://libsodium.gitbook.io/" rel="noopener noreferrer"&gt;&lt;code&gt;libsodium&lt;/code&gt;&lt;/a&gt; (a well known C cryptographic library), itself coming from a fork of &lt;a href="https://nacl.cr.yp.to/" rel="noopener noreferrer"&gt;&lt;code&gt;NaCl&lt;/code&gt;&lt;/a&gt;. &lt;code&gt;libsodium&lt;/code&gt; was ported on many languages like &lt;a href="https://github.com/jedisct1/libsodium.js/" rel="noopener noreferrer"&gt;javascript&lt;/a&gt;, &lt;a href="https://docs.rs/libsodium-rs/latest/libsodium_rs/" rel="noopener noreferrer"&gt;rust&lt;/a&gt;, &lt;a href="https://github.com/GoKillers/libsodium-go" rel="noopener noreferrer"&gt;go&lt;/a&gt;, &lt;a href="https://github.com/ahrefs/ocaml-sodium" rel="noopener noreferrer"&gt;ocaml&lt;/a&gt;, &lt;a href="https://hackage.haskell.org/package/libsodium" rel="noopener noreferrer"&gt;haskell&lt;/a&gt;, &lt;a href="https://github.com/potatosalad/erlang-libsodium" rel="noopener noreferrer"&gt;erlang&lt;/a&gt;, &lt;a href="https://github.com/ArteMisc/libsalty" rel="noopener noreferrer"&gt;elixir&lt;/a&gt; and many others.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sodium&lt;/code&gt; implementation tries to be a 1:1 interface to &lt;code&gt;libsodium&lt;/code&gt; but with the object oriented paradigm in mind and the specificity of the Dart language. In fact, the few examples present in the source code and the documentation looks limited to me, and did not answer my questions. The test suite is huge, and a big part of the following code will be inherited from it, to avoid you, dear readers, to do the same annoying task. &lt;code&gt;sodium&lt;/code&gt; can simply be installed using the &lt;code&gt;dart pub add sodium&lt;/code&gt; command in your current project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;dart pub add sodium
&lt;span class="go"&gt;Resolving dependencies... 
Downloading packages... 
+ archive 4.5.2
+ code_assets 2.1.0
+ csslib 1.0.2
+ freezed_annotation 3.1.0
+ hooks 2.2.0
+ html 0.15.7
+ json_annotation 4.12.0
+ posix 6.5.2
+ record_use 1.1.1
+ sodium 4.1.2
Changed 10 dependencies!
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The following code can easily be copy/pasted, but you should probably not do it. Keep in mind those are simply examples for some use case. Cryptography is an hard topic requiring years of experiences to do something secure. So, be really careful with my code.&lt;/p&gt;

&lt;h1&gt;
  
  
  Bootstrapping
&lt;/h1&gt;

&lt;p&gt;The &lt;code&gt;sodium&lt;/code&gt; package offers 2 APIs, the "normal" one called &lt;code&gt;Sodium&lt;/code&gt; and the "sumo" one, called &lt;code&gt;SodiumSumo&lt;/code&gt;. In fact, it seems to matter ONLY if you plan to create a JavaScript/WEB application. In this case, you will need to chose the correct API depending of your needs and based on the &lt;a href="https://github.com/Skycoder42/libsodium_dart_bindings/tree/main/packages/sodium#api-status" rel="noopener noreferrer"&gt;API status table&lt;/a&gt;. In most of the case, if you plan to create a 100% native application, the &lt;code&gt;SodiumSumo&lt;/code&gt; API should be enough. One can read more on the &lt;a href="https://github.com/Skycoder42/libsodium_dart_bindings/tree/main/packages/sodium#sodium-vs-sodiumsumo" rel="noopener noreferrer"&gt;APIs differences from the README&lt;/a&gt;. To import the &lt;code&gt;SodiumSumo&lt;/code&gt; API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="s"&gt;'package:sodium/sodium_sumo.dart'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the normal API is required for some reason, simply use this header, and remove the &lt;code&gt;Sumo&lt;/code&gt; part of the next command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="s"&gt;'package:sodium/sodium.dart'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, the &lt;code&gt;sodium&lt;/code&gt; library needs to be &lt;a href="https://github.com/Skycoder42/libsodium_dart_bindings/tree/main/packages/sodium#loading-libsodium" rel="noopener noreferrer"&gt;initialized/loaded&lt;/a&gt;. Indeed, a global instance of this object is required, and can be created using the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium_sumo/SodiumSumoInit-class.html" rel="noopener noreferrer"&gt;&lt;code&gt;SodiumSumoInit&lt;/code&gt;&lt;/a&gt; class, with the help of the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium_sumo/SodiumSumoInit-class.html" rel="noopener noreferrer"&gt;&lt;code&gt;init()&lt;/code&gt;&lt;/a&gt; constructor. It should return an instance of &lt;code&gt;SodiumSumoFFI&lt;/code&gt; object (an instance of &lt;a href="https://pub.dev/documentation/sodium/latest/sodium_sumo/SodiumSumo-class.html" rel="noopener noreferrer"&gt;&lt;code&gt;SodiumSumo&lt;/code&gt;&lt;/a&gt; class).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;SodiumSumoInit&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;init&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"sodium: &lt;/span&gt;&lt;span class="si"&gt;$sodium&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"version: &lt;/span&gt;&lt;span class="si"&gt;${sodium.version}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"randombytes: &lt;/span&gt;&lt;span class="si"&gt;${sodium.randombytes}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"runtimeType: &lt;/span&gt;&lt;span class="si"&gt;${sodium.runtimeType}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let check that.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;dart run
&lt;span class="c"&gt;...
&lt;/span&gt;&lt;span class="go"&gt;sodium: Instance of 'SodiumSumoFFI'
version: 1.0.22
randombytes: Instance of 'RandombytesFFI'
runtimeType: SodiumSumoFFI
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Neat. It seems our main object is ready to do a bit of encryption/decryption.&lt;/p&gt;

&lt;h1&gt;
  
  
  PRNG
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://libsodium.gitbook.io/" rel="noopener noreferrer"&gt;&lt;code&gt;libsodium&lt;/code&gt;&lt;/a&gt; has been created with portability and security in mind. It embeds its own &lt;a href="https://en.wikipedia.org/wiki/Pseudorandom_number_generator" rel="noopener noreferrer"&gt;PRNG&lt;/a&gt;, but will the one exposed by the operating system if any. For example, on most of the Linux/Unix operating system, it will read the &lt;a href="https://manpages.debian.org/trixie/manpages/urandom.4.en.html" rel="noopener noreferrer"&gt;&lt;code&gt;/dev/urandom&lt;/code&gt;&lt;/a&gt; file. If you are using &lt;a href="https://www.openbsd.org/" rel="noopener noreferrer"&gt;OpenBSD&lt;/a&gt; (like me), it will probably use &lt;a href="https://man.openbsd.org/arc4random.3" rel="noopener noreferrer"&gt;&lt;code&gt;arc4random&lt;/code&gt;&lt;/a&gt; instead. The &lt;code&gt;sodium&lt;/code&gt;&amp;nbsp;Dart implementation requires an instance of the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Randombytes-class.html" rel="noopener noreferrer"&gt;&lt;code&gt;Randombytes&lt;/code&gt;&lt;/a&gt; object.&lt;/p&gt;

&lt;p&gt;The first method to test will be the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Randombytes/random.html" rel="noopener noreferrer"&gt;&lt;code&gt;random()&lt;/code&gt;&lt;/a&gt; one, and it will return a random integer. In the code below, 8 random integers are generated.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;random&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;List&lt;/span&gt;
  &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;generate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;randombytes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;random&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"random: &lt;/span&gt;&lt;span class="si"&gt;$random&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;random: [1516676843, 4096214122, 3177965578, 2291181405, 4245144458, 3289700635, 106475476, 1321601073]
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The next method that can be used is to return an uniform random integer (inside a range) and is called &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Randombytes/uniform.html" rel="noopener noreferrer"&gt;&lt;code&gt;uniform()&lt;/code&gt;&lt;/a&gt;. In the following code, 8 uniform random numbers are generated. The output should contain integer between &lt;code&gt;0&lt;/code&gt; and &lt;code&gt;1023&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;randomUniform&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;generate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;randombytes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;uniform&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"randomUniform: &lt;/span&gt;&lt;span class="si"&gt;$randomUniform&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;randomUniform: [322, 681, 185, 1000, 297, 457, 376, 872]
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is also possible to generate list of random integers using the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Randombytes/buf.html" rel="noopener noreferrer"&gt;&lt;code&gt;buf()&lt;/code&gt;&lt;/a&gt; method. The code snippet below will generate 8 random numbers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;randomBuf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;randombytes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"randomBuf: &lt;/span&gt;&lt;span class="si"&gt;$randomBuf&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;randomBuf: [241, 28, 11, 77, 198, 128, 177, 157]
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://libsodium.gitbook.io/" rel="noopener noreferrer"&gt;&lt;code&gt;libsodium&lt;/code&gt;&lt;/a&gt; is also offering a way to generate random numbers from a custom seed. It can be useful for many scenario, including testing. To do that the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Randombytes/bufDeterministic.html" rel="noopener noreferrer"&gt;&lt;code&gt;bufDeterministic&lt;/code&gt;&lt;/a&gt; method can be used, where the first argument is the length of the list returned, and the second is the seed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;Uint8List&lt;/span&gt; &lt;span class="n"&gt;seed1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Uint8List&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;fromList&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;generate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;Uint8List&lt;/span&gt; &lt;span class="n"&gt;deterministicBuf1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
  &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;randombytes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;bufDeterministic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;seed1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"seed1: &lt;/span&gt;&lt;span class="si"&gt;$seed1&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"deterministicBuf: &lt;/span&gt;&lt;span class="si"&gt;$deterministicBuf1&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;Uint8List&lt;/span&gt; &lt;span class="n"&gt;seed2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Uint8List&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;fromList&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;generate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;_&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;Uint8List&lt;/span&gt; &lt;span class="n"&gt;deterministicBuf2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
  &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;randombytes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;bufDeterministic&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;seed2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"seed2: &lt;/span&gt;&lt;span class="si"&gt;$seed2&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"deterministicBuf: &lt;/span&gt;&lt;span class="si"&gt;$deterministicBuf2&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;deterministicBuf1: [161, 31, 143, 18, 208, 135, 111, 115]
deterministicBuf2: [61, 161, 61, 31, 87, 207, 88, 221]
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same seed should always output the same random number. This MUST BE set to 32 bytes (a list of 32 integers), if it's not the case, it will throw a &lt;code&gt;RangError&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RangeError (seed): Only allowed value is 32, but was: 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you want to create test with reproducible output from &lt;code&gt;sodium&lt;/code&gt;, the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Randombytes/seedBytes.html" rel="noopener noreferrer"&gt;&lt;code&gt;seedBytes&lt;/code&gt;&lt;/a&gt; attribute can be used.&lt;/p&gt;

&lt;p&gt;Finally the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Randombytes/stir.html" rel="noopener noreferrer"&gt;&lt;code&gt;stir()&lt;/code&gt;&lt;/a&gt; method is more or less related to any kind of custom PRNG that could have been created by the developer. It will reseed the generator, like defined in the &lt;a href="https://libsodium.gitbook.io/doc/generating_random_data" rel="noopener noreferrer"&gt;&lt;code&gt;libsodium&lt;/code&gt;&lt;/a&gt; documentation.&lt;/p&gt;

&lt;h1&gt;
  
  
  Generic Hash Function (BLAKE2b)
&lt;/h1&gt;

&lt;p&gt;Hashes are another important tools to have when dealing with encryption, and authentication. The official &lt;a href="https://pub.dev/packages/crypto" rel="noopener noreferrer"&gt;&lt;code&gt;crypto&lt;/code&gt;&lt;/a&gt; package created by the Dart team already offers a great support for the most used algorithms, including MD5, SHA1, SHA2 and HMAC (only for a subset of the algorithms previously listed). On the other hand, &lt;a href="https://libsodium.gitbook.io/doc/hashing/generic_hashing" rel="noopener noreferrer"&gt;&lt;code&gt;libsodium&lt;/code&gt;&lt;/a&gt; selected the &lt;a href="https://www.rfc-editor.org/rfc/rfc7693.txt" rel="noopener noreferrer"&gt;&lt;code&gt;BLAKE2b&lt;/code&gt;&lt;/a&gt; hash function to be its generic one.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.blake2.net/" rel="noopener noreferrer"&gt;BLAKE2&lt;/a&gt; is a modern hash function specified in &lt;a href="https://tools.ietf.org/html/rfc7693" rel="noopener noreferrer"&gt;RFC7693&lt;/a&gt;. BLAKE2b is an optimized version of BLAKE2 for 64 bits platform and can create output from 1 to 64 bytes. The reference implementation in pure-C is available on the official BLAKE2 &lt;a href="https://github.com/BLAKE2/BLAKE2" rel="noopener noreferrer"&gt;Github repository&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;An hash can be created in two ways with &lt;code&gt;sodium&lt;/code&gt;. The first one is by using the instance present in the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Crypto/genericHash.html" rel="noopener noreferrer"&gt;&lt;code&gt;sodium.crypto.genericHash&lt;/code&gt;&lt;/a&gt; as a function (see the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/GenericHash/call.html" rel="noopener noreferrer"&gt;&lt;code&gt;call()&lt;/code&gt;&lt;/a&gt; method). The code snippet bellow will return the BLAKE2b hash of the string "test", with a 32 bytes (256 bits) output encoded in &lt;a href="https://api.flutter.dev/flutter/dart-convert/base64-constant.html" rel="noopener noreferrer"&gt;&lt;code&gt;Base64&lt;/code&gt;&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="n"&gt;Uint8List&lt;/span&gt; &lt;span class="n"&gt;message1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;utf8&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;hash1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;genericHash&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;message:&lt;/span&gt; &lt;span class="n"&gt;message1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;outLen:&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"hash1: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(hash1)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;hash1: kosgNmlD4q/RHrwOri5TqTvxd6T881vMZNUDcE5l4gI=
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The same can also be done using a &lt;code&gt;Stream&lt;/code&gt; object via the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/GenericHash/stream.html" rel="noopener noreferrer"&gt;&lt;code&gt;stream()&lt;/code&gt;&lt;/a&gt; method.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;message2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="kd"&gt;async&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;utf8&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;hash2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;genericHash&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;messages:&lt;/span&gt; &lt;span class="n"&gt;Stream&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;fromFuture&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message2&lt;/span&gt;&lt;span class="p"&gt;()),&lt;/span&gt;
  &lt;span class="nl"&gt;outLen:&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"hash2: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(hash2)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;hash2: kosgNmlD4q/RHrwOri5TqTvxd6T881vMZNUDcE5l4gI=
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both results are identical, like expected from a hash function using the same input. &lt;code&gt;libsodium&lt;/code&gt; is also giving access to &lt;a href="https://libsodium.gitbook.io/doc/advanced/sha-2_hash_function" rel="noopener noreferrer"&gt;SHA-2&lt;/a&gt; and &lt;a href="https://libsodium.gitbook.io/doc/advanced/sha-3_hash_function" rel="noopener noreferrer"&gt;SHA-3&lt;/a&gt; hash functions. Unfortunately, it seems the Dart implementation is not offering an interface to them. If you need them, the &lt;a href="https://pub.dev/packages/crypto" rel="noopener noreferrer"&gt;&lt;code&gt;crypto&lt;/code&gt;&lt;/a&gt; package will be required.&lt;/p&gt;

&lt;h1&gt;
  
  
  Short Input Hash Function (SipHash-2-4)
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://libsodium.gitbook.io/" rel="noopener noreferrer"&gt;&lt;code&gt;libsodium&lt;/code&gt;&lt;/a&gt; can use more specific hash functions. For example, when it comes to small input, a classic hash function can be a problem. It is useful for internal data-structure and algorithm. &lt;a href="https://github.com/veorq/SipHash" rel="noopener noreferrer"&gt;SipHash-2-4&lt;/a&gt; is the default algorithm used here.&lt;/p&gt;

&lt;p&gt;To create a digest, one can use the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Crypto/shortHash.html" rel="noopener noreferrer"&gt;&lt;code&gt;ShortHash&lt;/code&gt;&lt;/a&gt; object instance from the main sodium object, called &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Crypto/shortHash.html" rel="noopener noreferrer"&gt;&lt;code&gt;shortHash&lt;/code&gt;&lt;/a&gt;. This object is implementing the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/ShortHash/call.html" rel="noopener noreferrer"&gt;&lt;code&gt;call()&lt;/code&gt;&lt;/a&gt; and then, can be used as a function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;SecureKey&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;random&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;smallInput&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Uint8List&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;fromList&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;smallHash&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;shortHash&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;key:&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;message:&lt;/span&gt; &lt;span class="n"&gt;smallInput&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"key: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(key.extractBytes())}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"smallInput: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(smallInput)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"smallHash: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(smallHash)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;key: tbaaEL+9ztfX000L54FlDw==
smallInput: AAAAAA==
smallHash: baRxJQlLnXg=
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;More information about this hash (and its usage) can be found on the official &lt;a href="https://libsodium.gitbook.io/doc/hashing/short-input_hashing" rel="noopener noreferrer"&gt;&lt;code&gt;libsodium&lt;/code&gt; documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Extendable Output Functions (Shake and TurboShake)
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://libsodium.gitbook.io/" rel="noopener noreferrer"&gt;&lt;code&gt;libsodium&lt;/code&gt;&lt;/a&gt; also offers &lt;a href="https://libsodium.gitbook.io/doc/hashing/xof" rel="noopener noreferrer"&gt;Extendatable Output Functions (XOF)&lt;/a&gt;, these functions can be configured to return a flexible output size. A &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Xof-class.html" rel="noopener noreferrer"&gt;&lt;code&gt;Xof&lt;/code&gt;&lt;/a&gt; object instance of each of these algorithms can be found on the main &lt;a href="https://pub.dev/documentation/sodium/latest/sodium_sumo/SodiumSumo-class.html" rel="noopener noreferrer"&gt;&lt;code&gt;sodium&lt;/code&gt;&lt;/a&gt; object instance created during the initialization part:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Crypto/xofShake128.html" rel="noopener noreferrer"&gt;&lt;code&gt;xofShake128&lt;/code&gt;&lt;/a&gt; for &lt;a href="https://eprint.iacr.org/2026/2080" rel="noopener noreferrer"&gt;Shake128&lt;/a&gt; algorithm;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Crypto/xofShake256.html" rel="noopener noreferrer"&gt;&lt;code&gt;xofShake256&lt;/code&gt;&lt;/a&gt; for the Shake256 algorithm&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Crypto/xofTurboshake128.html" rel="noopener noreferrer"&gt;&lt;code&gt;xofTurboshake128&lt;/code&gt;&lt;/a&gt; for the &lt;a href="https://eprint.iacr.org/2023/342" rel="noopener noreferrer"&gt;TurboShake128&lt;/a&gt; algorithm;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Crypto/xofTurboshake256.html" rel="noopener noreferrer"&gt;&lt;code&gt;xofTurboshake256&lt;/code&gt;&lt;/a&gt; for the &lt;a href="https://eprint.iacr.org/2023/342" rel="noopener noreferrer"&gt;TurboShake256&lt;/a&gt; algorithm.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let have a look at the Shake128 function first. An instance of a  can be found in the initialized &lt;code&gt;sodium&lt;/code&gt; object created at the beginning of this post.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;Uint8List&lt;/span&gt; &lt;span class="n"&gt;xofShake128Input&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Uint8List&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;fromList&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;Uint8List&lt;/span&gt; &lt;span class="n"&gt;xofShake128Output8&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;xofShake128&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;message:&lt;/span&gt; &lt;span class="n"&gt;xofShake128Input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;outLen:&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;  
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;Uint8List&lt;/span&gt; &lt;span class="n"&gt;xofShake128Output32&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;xofShake128&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;message:&lt;/span&gt; &lt;span class="n"&gt;xofShake128Input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;outLen:&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
&lt;span class="p"&gt;);&lt;/span&gt;  
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;Uint8List&lt;/span&gt; &lt;span class="n"&gt;xofShake128Output64&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;xofShake128&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;message:&lt;/span&gt; &lt;span class="n"&gt;xofShake128Input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;outLen:&lt;/span&gt; &lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
&lt;span class="p"&gt;);&lt;/span&gt;  
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"xofShake128Input: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(xofShake128Input)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"xofShake128Output8: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(xofShake128Output8)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"xofShake128Output32: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(xofShake128Output32)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"xofShake128Output64: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(xofShake128Output64)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;xofShake128Input: AAAAAA==
xofShake128Output8: j5cMpCyEnKA=
xofShake128Output32: j5cMpCyEnKAMSPiNiDgMV0j0Lc9SkIgAHcUmt12xu74=
xofShake128Output64: j5cMpCyEnKAMSPiNiDgMV0j0Lc9SkIgAHcUmt12xu74TNSTXBo+lx6AI6GKH1Mc7+qGNds7/V7XPqcJ1ArqOvA==
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, the output is flexible, and the first part will always be the same (a propriety of XOF). Let check that with the TurboShake256 algorithm.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;  &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;Uint8List&lt;/span&gt; &lt;span class="n"&gt;xofTurboshake256Input&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Uint8List&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;fromList&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
  &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;Uint8List&lt;/span&gt; &lt;span class="n"&gt;xofTurboshake256Output8&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;xofTurboshake256&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nl"&gt;message:&lt;/span&gt; &lt;span class="n"&gt;xofTurboshake256Input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;outLen:&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;  
  &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;Uint8List&lt;/span&gt; &lt;span class="n"&gt;xofTurboshake256Output32&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;xofTurboshake256&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nl"&gt;message:&lt;/span&gt; &lt;span class="n"&gt;xofTurboshake256Input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;outLen:&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
  &lt;span class="p"&gt;);&lt;/span&gt;  
  &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;Uint8List&lt;/span&gt; &lt;span class="n"&gt;xofTurboshake256Output64&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;xofTurboshake256&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nl"&gt;message:&lt;/span&gt; &lt;span class="n"&gt;xofTurboshake256Input&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="nl"&gt;outLen:&lt;/span&gt; &lt;span class="mi"&gt;64&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; 
  &lt;span class="p"&gt;);&lt;/span&gt;  
  &lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"xofTurboshake256Input: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(xofTurboshake256Input)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"xofTurboshake256Output8: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(xofTurboshake256Output8)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"xofTurboshake256Output32: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(xofTurboshake256Output32)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"xofTurboshake256Output64: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(xofTurboshake256Output64)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;xofTurboshake256Input: AAAAAA==
xofTurboshake256Output8: /kSBXrzATNM=
xofTurboshake256Output32: /kSBXrzATNNdtXhOHkidRkpZ9IOK3jeHTWo+Zr1/pfg=
xofTurboshake256Output64: /kSBXrzATNNdtXhOHkidRkpZ9IOK3jeHTWo+Zr1/pfj20vK3er1FEbuD12Chmf11GTTi8VVe+OPfW3Tom3cI4w==
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;More information regarding these algorithms can be seen on the &lt;a href="https://libsodium.gitbook.io/doc/hashing/xof" rel="noopener noreferrer"&gt;&lt;code&gt;libsodium&lt;/code&gt; xof documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Password Hashing (Argon2)
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://libsodium.gitbook.io/" rel="noopener noreferrer"&gt;&lt;code&gt;libsodium&lt;/code&gt;&lt;/a&gt; offers an implementation of the &lt;a href="https://en.wikipedia.org/wiki/Argon2" rel="noopener noreferrer"&gt;Argon2&lt;/a&gt; algorithm, it can be an alternative to the &lt;a href="https://pub.dev/packages/argon2" rel="noopener noreferrer"&gt;argon2&lt;/a&gt; package. &lt;a href="https://en.wikipedia.org/wiki/Argon2" rel="noopener noreferrer"&gt;Argon2&lt;/a&gt; is a key derivativation function designed to be protected against brute-force; At this time, this is the recommended algorithm to store hashed password. &lt;a href="https://libsodium.gitbook.io/" rel="noopener noreferrer"&gt;&lt;code&gt;libsodium&lt;/code&gt;&lt;/a&gt; gives us 2 versions of the algorithm, Argon2i and Argon2id, this last one is recommended by the &lt;a href="https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html" rel="noopener noreferrer"&gt;OWASP team&lt;/a&gt;, but the default one used by &lt;code&gt;sodium&lt;/code&gt; is Argon2i. Anyway, let do some test here.&lt;/p&gt;

&lt;p&gt;To create a new hash, the already created instance of the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium_sumo/Pwhash-class.html" rel="noopener noreferrer"&gt;&lt;code&gt;Pwhash&lt;/code&gt;&lt;/a&gt; object in &lt;code&gt;sodium.crypto.pwhash&lt;/code&gt; can be used and the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium_sumo/Pwhash/str.html" rel="noopener noreferrer"&gt;&lt;code&gt;str()&lt;/code&gt;&lt;/a&gt;&amp;nbsp;can be invoked. It will return a formatted string containing the functions parameters and the random salt generated automatically. The &lt;code&gt;opsLimit&lt;/code&gt;&amp;nbsp;represents the amount of computations to use (more CPU usage) and the &lt;code&gt;memLimit&lt;/code&gt; represents the amount of memory in bytes to allocate.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;password&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"secret_password"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;hashedPassword&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;pwhash&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;password:&lt;/span&gt; &lt;span class="n"&gt;password&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;opsLimit:&lt;/span&gt; &lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;memLimit:&lt;/span&gt; &lt;span class="mi"&gt;8192&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;  
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;resultValid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;pwhash&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;strVerify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;passwordHash:&lt;/span&gt; &lt;span class="n"&gt;hashedPassword&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;password:&lt;/span&gt; &lt;span class="n"&gt;password&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;  
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;resultInvalid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;pwhash&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;strVerify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;passwordHash:&lt;/span&gt; &lt;span class="n"&gt;hashedPassword&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;password:&lt;/span&gt; &lt;span class="s"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;  
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"hashedPassword: &lt;/span&gt;&lt;span class="si"&gt;$hashedPassword&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"resultValid: &lt;/span&gt;&lt;span class="si"&gt;$resultValid&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"resultInvalid: &lt;/span&gt;&lt;span class="si"&gt;$resultInvalid&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;hashedPassword: $&lt;/span&gt;argon2id&lt;span class="nv"&gt;$v&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;19&lt;span class="nv"&gt;$m&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;8,t&lt;span class="o"&gt;=&lt;/span&gt;1024,p&lt;span class="o"&gt;=&lt;/span&gt;1&lt;span class="nv"&gt;$PfWonIyaTiDh0mhyUT55UA$Y63dvkUjVtKYnvBSdzstDN0QIhyi6xcba83efmMaa7I&lt;/span&gt;
&lt;span class="go"&gt;resultValid: true
resultInvalid: false
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A &lt;a href="https://pub.dev/documentation/sodium/latest/sodium_sumo/Pwhash-class.html" rel="noopener noreferrer"&gt;&lt;code&gt;Pwhash&lt;/code&gt;&lt;/a&gt; object exposes properties to know the limitations of these values, here a list of some of them.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://pub.dev/documentation/sodium/latest/sodium_sumo/Pwhash/memLimitInteractive.html" rel="noopener noreferrer"&gt;&lt;code&gt;memLimitInteractive&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://pub.dev/documentation/sodium/latest/sodium_sumo/Pwhash/memLimitMax.html" rel="noopener noreferrer"&gt;&lt;code&gt;memLimitMax&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://pub.dev/documentation/sodium/latest/sodium_sumo/Pwhash/memLimitMin.html" rel="noopener noreferrer"&gt;&lt;code&gt;memLimitMin&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://pub.dev/documentation/sodium/latest/sodium_sumo/Pwhash/opsLimitInteractive.html" rel="noopener noreferrer"&gt;&lt;code&gt;opsLimitInteractive&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://pub.dev/documentation/sodium/latest/sodium_sumo/Pwhash/opsLimitMax.html" rel="noopener noreferrer"&gt;&lt;code&gt;opsLimitMax&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://pub.dev/documentation/sodium/latest/sodium_sumo/Pwhash/opsLimitMin.html" rel="noopener noreferrer"&gt;&lt;code&gt;opsLimitMin&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want other flavor like Argon2id13, the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium_sumo/Pwhash/callStr.html" rel="noopener noreferrer"&gt;&lt;code&gt;callStr()&lt;/code&gt;&lt;/a&gt; can be used instead but it will require new parameters, like the length of the output, a random salt and the name of the algorithm to use.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;Uint8List&lt;/span&gt; &lt;span class="n"&gt;salt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Uint8List&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;fromList&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;randombytes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;hashPasswordBis&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;pwhash&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;callStr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;outLen:&lt;/span&gt; &lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;password:&lt;/span&gt; &lt;span class="n"&gt;password&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;salt:&lt;/span&gt; &lt;span class="n"&gt;salt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;opsLimit:&lt;/span&gt; &lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;memLimit:&lt;/span&gt; &lt;span class="mi"&gt;8192&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;alg:&lt;/span&gt; &lt;span class="n"&gt;CryptoPwhashAlgorithm&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;argon2id13&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;  
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"salt: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(salt)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"hashPasswordBis: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(hashPasswordBis.extractBytes())}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;salt: NAf4uZwlge7mm1kwT5pTZw==
hashPasswordBis: e47DIsAic0Tx9S1g/gIItsrCcf0WpLEaiIj8Jbzn1cneVfPz8w7PH50WmEbj2+kPUZFxgtZdyfRVsjP/N8l521BMxwxAA/hPWFz9a5qM4+BhaKFStMVl5JHQnq+P48ucYTTH7dNwoXe6KuyvR4/gI2kYYdzYQOnymeOzdZxl9Ipz85CfFSJD4S40zuGGLqzL/He2Edabnny1W2PFfBHQoBP1k7egv/b2ZoHVayAWyxOaRHbQ5wrsVIRzliKmG9x8bgDyq/sqP/M+MV2cdD8h5spPq6PFq88+KKAuXD4XORbnSocmCw84oqaOcscubsEcPOnMVhJYEAJIRgytDTlpHjgWNykNahQAkiLBp+UkLQx+pmVAwDG47zyTsEQmyjeAgVL+yVqRFPfT6m5hKJLVXC7wrttR/flDqh+TUgVrZ3FS6rQBOaJA6E4yc9IC/JSVO95UrsBRGABYd5K9tYJccOrEpbb3Rx69dPKw66RWUn8WIxeRB0yf+BiqD1xx6Mqp4axRmvSFTZmLV3Pz9fkXZqYDjGpucytLevUDmumtoHbP3dobuRk0lxhIIFDLfqx2cvymumnByePpwmnTC+1AXw83EX+NBMOzKcXPGVepGONNt0HnT3riW99+kBmRDDPmeHINT7I3k4VsAcWexRxdRHuGCbg9CjxQ4kzLD5DWdibS+FtivhR8D2UWgaH3QZGmNxYpslyhhzCNVcNGO+vgNVH3omyUh7gAbC/oMCL0j1u9u3he4sXBKfCERs5YACIHB7YHVEFTvgZHFfk78SNq4zyNQWfPeMlTGVLrshsOM5BjcTuUg8EJ6AnwiUVkygdSYih1wIX48jwprPW+K53SEig2exm4S6jbl4L65W/+9Ciaue9gobGQVN7zlL2+H9FopLdU+ieMXQJhIGemVZqL3+Geq1KoOm2H4ufJ9olyNbzry8cxZQpgFSdIAfqicgIYeJpBmH8Rdn4C0J9L/I6khDE+Ew63oVuw/Uk6xahYUnQDtveQG86A13F+p459DiSxQR7sJjNvUuSlKHkFWLF9qTU4wGmgzoiBIHCro9KZGegKA2H92kdQP1j+EhPxBeeeiQu/X59Miq+hDiMm0sqt4bIOra+lKBJJ8/T/Ly6VHU6NYvt0JozqazXkmFSh6rj0tfOWuZqmlRpn+OQPoWnLvPurm3iIVo+q3OS9QnZcpCKgrxQr3aJ3NBI5PnoYxslnWJUjwC9FCRTesYqmrMXjk09XCFmF+p96VqhYTXJ1hB3yu70fgFcARvY4jJocnqTfN9UBzGvWRWjK+lZDc/4imQRrbMlCzKxSVgnQKHZRjbG/xpMramlZxqn9WJ8SC3vgI2nZN7RpmCOrm9B7AAboNw==
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, the output is an &lt;code&gt;Uint8List&lt;/code&gt; and not a formatted &lt;code&gt;String&lt;/code&gt;. Unfortunately, in this mode, it is not possible to generate the Unix-like format. The &lt;a href="https://pub.dev/documentation/sodium/latest/sodium_sumo/CryptoSumo/pwhash.html" rel="noopener noreferrer"&gt;&lt;code&gt;libsodium&lt;/code&gt; official documentation&lt;/a&gt; contains more information on this feature.&lt;/p&gt;

&lt;h1&gt;
  
  
  Symmetric Encryption (chacha20-Poly1305)
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;sodium&lt;/code&gt; is offering 3 algorithms, all of them based on the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Aead-class.html" rel="noopener noreferrer"&gt;&lt;code&gt;Aead&lt;/code&gt;&lt;/a&gt; class&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Crypto/aeadAegis256.html" rel="noopener noreferrer"&gt;Aegis256&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Crypto/aeadChaCha20Poly1305.html" rel="noopener noreferrer"&gt;Chacha2020-Poly1305&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Crypto/aeadXChaCha20Poly1305IETF.html" rel="noopener noreferrer"&gt;XChaCha20Poly1305&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A message can be encrypted using the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Aead/encrypt.html" rel="noopener noreferrer"&gt;&lt;code&gt;encrypt()&lt;/code&gt;&lt;/a&gt; method.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;Uint8List&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;utf8&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"my message"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;Uint8List&lt;/span&gt; &lt;span class="n"&gt;nonce&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Uint8List&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;fromList&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;randombytes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;SecureKey&lt;/span&gt; &lt;span class="n"&gt;keyAead&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;SecureKey&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;random&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;encrypted&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;aeadChaCha20Poly1305&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;encrypt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;message:&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;nonce:&lt;/span&gt; &lt;span class="n"&gt;nonce&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;key:&lt;/span&gt; &lt;span class="n"&gt;keyAead&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"message: &lt;/span&gt;&lt;span class="si"&gt;$message&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"key: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(key.extractBytes())}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"encrypted: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(encrypted)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;message: [109, 121, 32, 109, 101, 115, 115, 97, 103, 101]
key: GkjKYnsKNITUsROWYOiujw==
encrypted: SsldZX2XkQqcRTgiqyP0KH97Yz/YkQ1BIE8=
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The ciphertext produced by the previous method can be decrypted using the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Aead/decrypt.html" rel="noopener noreferrer"&gt;&lt;code&gt;decrypt()&lt;/code&gt;&lt;/a&gt; method.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="n"&gt;Uint8List&lt;/span&gt; &lt;span class="n"&gt;decrypted&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;aeadChaCha20Poly1305&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;decrypt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;cipherText:&lt;/span&gt; &lt;span class="n"&gt;encrypted&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;nonce:&lt;/span&gt; &lt;span class="n"&gt;nonce&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;key:&lt;/span&gt; &lt;span class="n"&gt;keyAead&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"decrypted: &lt;/span&gt;&lt;span class="si"&gt;${utf8.decode(decrypted)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;decrypted: my message
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Nothing really fancy here, the interface is quite easy to use. Be careful regarding the nonce and the key to use though, both of them are important and must be configured accordingly.&lt;/p&gt;

&lt;h1&gt;
  
  
  Public Key Generation
&lt;/h1&gt;

&lt;p&gt;This post was - at first - created to understand how public key generation was done with &lt;code&gt;sodium&lt;/code&gt;. Indeed, the Dart community does not really offer a lot of choice when it comes to encryption, and instead of using yet another library created from scratch (this is usually not a good idea in cryptography), the port to &lt;code&gt;libsodium&lt;/code&gt; looked way more safer and interesting.&lt;/p&gt;

&lt;p&gt;Anyway, &lt;a href="https://libsodium.gitbook.io/" rel="noopener noreferrer"&gt;&lt;code&gt;libsodium&lt;/code&gt;&lt;/a&gt; is only supporting &lt;a href="https://ed25519.cr.yp.to/" rel="noopener noreferrer"&gt;Ed25519&lt;/a&gt; and &lt;a href="https://datatracker.ietf.org/doc/html/rfc7748#section-5" rel="noopener noreferrer"&gt;X25519&lt;/a&gt; algorithms. The first one is for authentication (signatured), the second is for key exchange. In both case, the method is the same to generate a pair of keys and then, return a &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/KeyPair-class.html" rel="noopener noreferrer"&gt;&lt;code&gt;KeyPair&lt;/code&gt;&lt;/a&gt; object.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;seedBytesPK&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;box&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;seedBytes&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;secureRandomSeedPK&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;secureRandom&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seedBytesPK&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;keyPair&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;box&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;seedKeyPair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;secureRandomSeedPK&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"seedBytesPK: &lt;/span&gt;&lt;span class="si"&gt;$seedBytesPK&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"secureRandomSeedPK: &lt;/span&gt;&lt;span class="si"&gt;$secureRandomSeedPK&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"keyPair: &lt;/span&gt;&lt;span class="si"&gt;$keyPair&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"publicKey: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(keyPair.publicKey)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"secretKey: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(keyPair.secretKey.extractBytes())}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;seedBytesPK: 32
secureRandomSeedPK: Instance of 'SecureKeyFFI'
keyPair: KeyPair(publicKey: [29, 132, 192, 107, 208, 25, 162, 211, 228, 70, 109, 169, 238, 124, 161, 248, 143, 24, 82, 64, 86, 39, 93, 254, 93, 54, 113, 62, 30, 145, 73, 50], secretKey: Instance of 'SecureKeyFFI')
publicKey: HYTAa9AZotPkRm2p7nyh+I8YUkBWJ13+XTZxPh6RSTI=
secretKey: /8SV7xv0ReOpTgau97cmmGZM5PdKSA13hbfxYYs0F1Q=
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A keypair can also created using a seed via the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Box/seedKeyPair.html" rel="noopener noreferrer"&gt;&lt;code&gt;seedKeyPair&lt;/code&gt;&lt;/a&gt; method. More information can be found in the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Box-class.html" rel="noopener noreferrer"&gt;&lt;code&gt;Box&lt;/code&gt;&lt;/a&gt; class documentation.&lt;/p&gt;

&lt;h1&gt;
  
  
  Public Key Signature (Ed25519)
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;libsodium&lt;/code&gt; is using Ed25519 to sign messages with a private key. 3 modes of signatures have been defined by this library, &lt;a href="https://libsodium.gitbook.io/doc/public-key_cryptography/public-key_signatures#detached-mode" rel="noopener noreferrer"&gt;detached mode&lt;/a&gt;, &lt;a href="https://libsodium.gitbook.io/doc/public-key_cryptography/public-key_signatures#combined-mode" rel="noopener noreferrer"&gt;combined mode&lt;/a&gt; and &lt;a href="https://libsodium.gitbook.io/doc/public-key_cryptography/public-key_signatures#multi-part-messages" rel="noopener noreferrer"&gt;multi-part messages mode&lt;/a&gt;. All of them have been ported to &lt;code&gt;sodium&lt;/code&gt; via the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Sign-class.html" rel="noopener noreferrer"&gt;&lt;code&gt;Sign&lt;/code&gt;&lt;/a&gt; class.&lt;/p&gt;

&lt;p&gt;Before using these modes, it is also necessary to understand the key generation process. One can sign a message by generating a new random key when calling the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Sign/keyPair.html" rel="noopener noreferrer"&gt;&lt;code&gt;keyPair()&lt;/code&gt;&lt;/a&gt; method, or derive a new key from an existing one using the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Sign/seedKeyPair.html" rel="noopener noreferrer"&gt;&lt;code&gt;seedKeyPair()&lt;/code&gt;&lt;/a&gt; method. For example, to derive a key from the keypair generated in the previous section:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;newSeedBytes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;box&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;seedBytes&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;newSecureRandomSeed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;secureRandom&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;newSeedBytes&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;newKeyPair&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;box&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;seedKeyPair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;newSecureRandomSeed&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;derivedKeyPair&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;sign&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;seedKeyPair&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;newKeyPair&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;secretKey&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"newSeedBytes: &lt;/span&gt;&lt;span class="si"&gt;$newSeedBytes&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"newSecureRandomSeed: &lt;/span&gt;&lt;span class="si"&gt;$newSecureRandomSeed&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"newKeyPair: &lt;/span&gt;&lt;span class="si"&gt;$newKeyPair&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"derivedKeyPair: &lt;/span&gt;&lt;span class="si"&gt;$derivedKeyPair&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"derivedKeyPair.publicKey: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(derivedKeyPair.publicKey)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"derivedKeyPair.secretKey: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(derivedKeyPair.secretKey.extractBytes())}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;newSeedBytes: 32
newSecureRandomSeed: Instance of 'SecureKeyFFI'
newKeyPair: KeyPair(publicKey: [17, 113, 139, 202, 227, 188, 47, 55, 65, 155, 129, 183, 29, 22, 170, 28, 186, 137, 114, 114, 10, 130, 235, 100, 124, 126, 64, 156, 63, 99, 192, 108], secretKey: Instance of 'SecureKeyFFI')
derivedKeyPair: KeyPair(publicKey: [12, 10, 30, 205, 0, 239, 115, 167, 34, 206, 106, 197, 126, 152, 34, 58, 162, 79, 75, 239, 76, 73, 249, 136, 211, 66, 86, 31, 187, 16, 201, 200], secretKey: Instance of 'SecureKeyFFI')
derivedKeyPair.publicKey: DAoezQDvc6cizmrFfpgiOqJPS+9MSfmI00JWH7sQycg=
derivedKeyPair.secretKey: S1dqHYqlbEO39PGZM1rY6smO/34FgEGKw7cq2G/HNy4MCh7NAO9zpyLOasV+mCI6ok9L70xJ+YjTQlYfuxDJyA==
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The combined mode is prepending the signature to the message. To sign a message with this mode, the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Sign/call.html" rel="noopener noreferrer"&gt;&lt;code&gt;call()&lt;/code&gt;&lt;/a&gt; method is used, and to validate the message, the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Sign/open.html" rel="noopener noreferrer"&gt;&lt;code&gt;open()&lt;/code&gt;&lt;/a&gt; method is required.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;messageCombined&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;utf8&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;signatureCombined&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;sign&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;message:&lt;/span&gt; &lt;span class="n"&gt;messageCombined&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;secretKey:&lt;/span&gt; &lt;span class="n"&gt;randomKeyPair&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;secretKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"signatureCombined: &lt;/span&gt;&lt;span class="si"&gt;$signatureCombined&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"signatureCombined: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(signatureCombined)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;verifyCombined&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;sign&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;signedMessage:&lt;/span&gt; &lt;span class="n"&gt;signatureCombined&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;publicKey:&lt;/span&gt; &lt;span class="n"&gt;randomKeyPair&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;publicKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"verifyCombined: &lt;/span&gt;&lt;span class="si"&gt;$verifyCombined&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"verifyCombined: &lt;/span&gt;&lt;span class="si"&gt;${utf8.decode(verifyCombined)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;signatureCombined: [175, 80, 179, 20, 23, 55, 168, 83, 169, 53, 225, 232, 239, 10, 9, 101, 53, 236, 192, 245, 177, 194, 17, 42, 195, 100, 161, 72, 62, 172, 251, 39, 160, 26, 90, 165, 49, 158, 220, 169, 183, 149, 174, 209, 44, 85, 214, 189, 62, 246, 93, 249, 215, 40, 54, 32, 240, 150, 56, 78, 93, 23, 101, 7, 116, 101, 115, 116]
signatureCombined: r1CzFBc3qFOpNeHo7woJZTXswPWxwhEqw2ShSD6s+yegGlqlMZ7cqbeVrtEsVda9PvZd+dcoNiDwljhOXRdlB3Rlc3Q=
verifyCombined: [116, 101, 115, 116]
verifyCombined: test
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The detached mode produces a signature without altering the message. To sign the message, the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Sign/detached.html" rel="noopener noreferrer"&gt;&lt;code&gt;detached()&lt;/code&gt;&lt;/a&gt; method is invoked, and to verify it, the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Sign/verifyDetached.html" rel="noopener noreferrer"&gt;&lt;code&gt;verifyDetached()&lt;/code&gt;&lt;/a&gt; is called.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;messageDetached&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;utf8&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"message: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(messageDetached)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;signatureDetached&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;sign&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;detached&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;message:&lt;/span&gt; &lt;span class="n"&gt;messageDetached&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;secretKey:&lt;/span&gt; &lt;span class="n"&gt;randomKeyPair&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;secretKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"signatureDetached: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(signatureDetached)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;verifyDetached&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;sign&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;verifyDetached&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;message:&lt;/span&gt; &lt;span class="n"&gt;messageDetached&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;publicKey:&lt;/span&gt; &lt;span class="n"&gt;randomKeyPair&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;publicKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;signature:&lt;/span&gt; &lt;span class="n"&gt;signatureDetached&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"verifyDetached: &lt;/span&gt;&lt;span class="si"&gt;$verifyDetached&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;message: dGVzdA==
signatureDetached: r1CzFBc3qFOpNeHo7woJZTXswPWxwhEqw2ShSD6s+yegGlqlMZ7cqbeVrtEsVda9PvZd+dcoNiDwljhOXRdlBw==
verifyDetached: true
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, the multi-part messages mode is used to sign/verify huge messages and is using a &lt;code&gt;Stream&lt;/code&gt; in the Dart implement. To sign a message in multi-part messages mode, the&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;messageMulti&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="kd"&gt;async&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;utf8&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;signatureMulti&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;sign&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;messages:&lt;/span&gt; &lt;span class="n"&gt;Stream&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;fromFuture&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;messageMulti&lt;/span&gt;&lt;span class="p"&gt;()),&lt;/span&gt;
  &lt;span class="nl"&gt;secretKey:&lt;/span&gt; &lt;span class="n"&gt;randomKeyPair&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;secretKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"signatureMulti: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(signatureMulti)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;verifyMulti&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;sign&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;verifyStream&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;messages:&lt;/span&gt; &lt;span class="n"&gt;Stream&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;fromFuture&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;messageMulti&lt;/span&gt;&lt;span class="p"&gt;()),&lt;/span&gt;
  &lt;span class="nl"&gt;signature:&lt;/span&gt; &lt;span class="n"&gt;signatureMulti&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;publicKey:&lt;/span&gt; &lt;span class="n"&gt;randomKeyPair&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;publicKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"verifyMulti: &lt;/span&gt;&lt;span class="si"&gt;$verifyMulti&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;signatureMulti: KqgvmypphuUC0aLzZCQ56rQQ2CwidxdQFoBBlVDqLhvqiyQKZSbBvq76UsChFy9GLm+rM6ncBocevJHTthMNBg==
verifyMulti: true
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Don't hesitate to check the API documentation, especially the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium_sumo/SignSumo-class.html" rel="noopener noreferrer"&gt;&lt;code&gt;SignSumo&lt;/code&gt;&lt;/a&gt; class and the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Sign/call.html" rel="noopener noreferrer"&gt;&lt;code&gt;call()&lt;/code&gt;&lt;/a&gt; method.&lt;/p&gt;

&lt;h1&gt;
  
  
  Public Key Encryption
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://libsodium.gitbook.io/" rel="noopener noreferrer"&gt;&lt;code&gt;libsodium&lt;/code&gt;&lt;/a&gt; offers an easy interface to encrypt data with via a public key. In fact, it will use the public/private key to authenticate the message while a secret a shared between both part of the communication. The messages are then encrypted using the &lt;a href="https://libsodium.gitbook.io/doc/advanced/stream_ciphers/xsalsa20" rel="noopener noreferrer"&gt;XSalsa20&lt;/a&gt; stream cipher. Key pairs can be generated using the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Box/keyPair.html" rel="noopener noreferrer"&gt;&lt;code&gt;keyPair()&lt;/code&gt;&lt;/a&gt; method from a&lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Box-class.html" rel="noopener noreferrer"&gt;&lt;code&gt;Box&lt;/code&gt;&lt;/a&gt; object instance.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;kpAlice&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;box&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;keyPair&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;kpBob&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;box&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;keyPair&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"kpAlice: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(kpAlice.publicKey)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"kpBob: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(kpBob.publicKey)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;kpAlice: UfVCLUDk7+W/8hdnGvGWXUAazrzhDmGJvx1b14ZTtRc=
kpBob: U9zxXl5KfUO3XcKNoLeYg/hZawnzjMIaLQ8kf01pNF8=
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Box/easy.html" rel="noopener noreferrer"&gt;&lt;code&gt;easy()&lt;/code&gt;&lt;/a&gt; method can be invoked to create an encrypted payload containing all required information for the exchange.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;msg1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;utf8&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"hello Bob!"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;nonce1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;randombytes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;cipher1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;box&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;easy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;message:&lt;/span&gt; &lt;span class="n"&gt;msg1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;nonce:&lt;/span&gt; &lt;span class="n"&gt;nonce1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;publicKey:&lt;/span&gt; &lt;span class="n"&gt;kpBob&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;publicKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;secretKey:&lt;/span&gt; &lt;span class="n"&gt;kpAlice&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;secretKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"msg1: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(msg1)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"nonce1: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(nonce1)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"cipher1: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(cipher1)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;msg1: aGVsbG8gQm9iIQ==
nonce1: ACpqcCbUEGfeUtqF4qhjJhKLZ/56mJHh
cipher1: t0dIKRIlLxTX3Cp656DN/XgRy8rka9GApsw=
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After the reception of the message by the receiver, the clear text can be extracted using the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Box/openEasy.html" rel="noopener noreferrer"&gt;&lt;code&gt;openEasy()&lt;/code&gt;&lt;/a&gt; method.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;recv1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;box&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;openEasy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;cipherText:&lt;/span&gt; &lt;span class="n"&gt;cipher1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;nonce:&lt;/span&gt; &lt;span class="n"&gt;nonce1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;publicKey:&lt;/span&gt; &lt;span class="n"&gt;kpAlice&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;publicKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;secretKey:&lt;/span&gt; &lt;span class="n"&gt;kpBob&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;secretKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"recv1: &lt;/span&gt;&lt;span class="si"&gt;${utf8.decode(recv1)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;recv1: hello Bob!
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Another exchange can be initiated using the same principle (for example to send a response to the previous message).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;msg2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;utf8&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hey alice"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;nonce2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;randombytes&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;cipher2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;box&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;easy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;message:&lt;/span&gt; &lt;span class="n"&gt;msg2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;nonce:&lt;/span&gt; &lt;span class="n"&gt;nonce2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;publicKey:&lt;/span&gt; &lt;span class="n"&gt;kpAlice&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;publicKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;secretKey:&lt;/span&gt; &lt;span class="n"&gt;kpBob&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;secretKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;msg2: SGV5IGFsaWNl
nonce2: XqvB6EwaF9GxPvSSM/TMuSkaXLmUfnDF
cipher2: q0fyatMRoWChE17eKUouJinJTqahCa8P3g==
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;recv2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;box&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;openEasy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;cipherText:&lt;/span&gt; &lt;span class="n"&gt;cipher2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;nonce:&lt;/span&gt; &lt;span class="n"&gt;nonce2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;publicKey:&lt;/span&gt; &lt;span class="n"&gt;kpBob&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;publicKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;secretKey:&lt;/span&gt; &lt;span class="n"&gt;kpAlice&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;secretKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"recv2: &lt;/span&gt;&lt;span class="si"&gt;${utf8.decode(recv2)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;recv2: Hey alice
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;libsodium&lt;/code&gt; is also offering a detached mode, it will give more flexibility when sending the information, instead of using a complete payload, the required information can be put in some other formats. To use this mode, the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Box/detached.html" rel="noopener noreferrer"&gt;&lt;code&gt;detached()&lt;/code&gt;&lt;/a&gt; and &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Box/openDetached.html" rel="noopener noreferrer"&gt;&lt;code&gt;openDetached()&lt;/code&gt;&lt;/a&gt; methods can be used.&lt;/p&gt;

&lt;p&gt;It is also possible to use a &lt;a href="https://libsodium.gitbook.io/doc/public-key_cryptography/sealed_boxes#usage" rel="noopener noreferrer"&gt;Sealed Box&lt;/a&gt; with the help of the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Box/seal.html" rel="noopener noreferrer"&gt;&lt;code&gt;seal()&lt;/code&gt;&lt;/a&gt; and &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Box/sealOpen.html" rel="noopener noreferrer"&gt;&lt;code&gt;sealOpen()&lt;/code&gt;&lt;/a&gt; methods. The idea is to make the exchange even more secure by always creating an ephemeral key.&lt;/p&gt;

&lt;p&gt;More information can be found on the &lt;a href="https://libsodium.gitbook.io/doc/public-key_cryptography/authenticated_encryption" rel="noopener noreferrer"&gt;official &lt;code&gt;libsodium&lt;/code&gt; documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Key Exchange
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;libsodium&lt;/code&gt; also offers some facilities to do &lt;a href="https://libsodium.gitbook.io/doc/key_exchange" rel="noopener noreferrer"&gt;key exchanges&lt;/a&gt; and &lt;a href="https://libsodium.gitbook.io/doc/key_derivation" rel="noopener noreferrer"&gt;key derivation&lt;/a&gt;. A keypair can be generate using the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Kx/keyPair.html" rel="noopener noreferrer"&gt;&lt;code&gt;keyPair()&lt;/code&gt;&lt;/a&gt; method from an instance of a &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Kx-class.html" rel="noopener noreferrer"&gt;&lt;code&gt;Kx&lt;/code&gt;&lt;/a&gt; object or by deriving an existing key using the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Kx/seedKeyPair.html" rel="noopener noreferrer"&gt;&lt;code&gt;seedKeyPair()&lt;/code&gt;&lt;/a&gt; method from the same instance.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;kpClient&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;kx&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;keyPair&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;kpServer&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;kx&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;keyPair&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"kpClient: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(kpClient.publicKey)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"kpServer: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(kpServer.publicKey)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;kpClient: dPmBU3994tkERAjQUyD+ibo7rBFujq+ZV197l8FvwVU=
kpServer: 52FiQPJtOJkkBDoRoZYzC3ASjJDFsHu6SbeEP3jrswg=
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A session can be started by sharing one's public key, signed with its private key, and by sharing a secret encrypted with the target public key. To do that, the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Kx/clientSessionKeys.html" rel="noopener noreferrer"&gt;&lt;code&gt;clientSessionKeys()&lt;/code&gt;&lt;/a&gt; method can be used. It will return a &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/SessionKeys-class.html" rel="noopener noreferrer"&gt;&lt;code&gt;SessionKeys&lt;/code&gt;&lt;/a&gt; object, containing the session keys to decrypt received data (&lt;a href="https://pub.dev/documentation/sodium/latest/sodium/SessionKeys/rx.html" rel="noopener noreferrer"&gt;&lt;code&gt;tx&lt;/code&gt;&lt;/a&gt; property) or encrypt (&lt;a href="https://pub.dev/documentation/sodium/latest/sodium/SessionKeys/tx.html" rel="noopener noreferrer"&gt;&lt;code&gt;tx&lt;/code&gt;&lt;/a&gt;) data to send.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;session1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;kx&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;clientSessionKeys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;clientPublicKey:&lt;/span&gt; &lt;span class="n"&gt;kpClient&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;publicKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;clientSecretKey:&lt;/span&gt; &lt;span class="n"&gt;kpClient&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;secretKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;serverPublicKey:&lt;/span&gt; &lt;span class="n"&gt;kpServer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;publicKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;  
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"session1: &lt;/span&gt;&lt;span class="si"&gt;$session1&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"session1.tx: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(session1.tx.extractBytes())}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"session1.rx: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(session1.rx.extractBytes())}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;session1: SessionKeys(rx: Instance of 'SecureKeyFFI', tx: Instance of 'SecureKeyFFI')
session1.tx: vzJw72Dib/qHhze9LOsUGwYxjFYNzWV3D6541pLMxZc=
session1.rx: r7QtsYaSFrydDg6ijk1mbNrvR3cVSJmFqMXVH3m2YV4=
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The previous example was using the client API, but a server can also take the lead by creating its session via the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Kx/serverSessionKeys.html" rel="noopener noreferrer"&gt;&lt;code&gt;serverSessionKeys()&lt;/code&gt;&lt;/a&gt; method. The same kind of object is returned.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;session2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;kx&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;serverSessionKeys&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;serverPublicKey:&lt;/span&gt; &lt;span class="n"&gt;kpServer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;publicKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;serverSecretKey:&lt;/span&gt; &lt;span class="n"&gt;kpServer&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;secretKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;clientPublicKey:&lt;/span&gt; &lt;span class="n"&gt;kpClient&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;publicKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;  
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"session2: &lt;/span&gt;&lt;span class="si"&gt;$session2&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"session2.tx: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(session2.tx.extractBytes())}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"session2.rx: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(session2.rx.extractBytes())}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;session2: SessionKeys(rx: Instance of 'SecureKeyFFI', tx: Instance of 'SecureKeyFFI')
session2.tx: r7QtsYaSFrydDg6ijk1mbNrvR3cVSJmFqMXVH3m2YV4=
session2.rx: vzJw72Dib/qHhze9LOsUGwYxjFYNzWV3D6541pLMxZc=
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Creating encrypted/authenticated sessions can be challenging, more information about this part can also be found on the &lt;a href="-%20https://libsodium.gitbook.io/doc/key_exchange"&gt;official &lt;code&gt;libsodium&lt;/code&gt; documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  Public Key Encapsulation
&lt;/h1&gt;

&lt;p&gt;Secrets can also be shared using &lt;a href="https://libsodium.gitbook.io/doc/public-key_cryptography/key_encapsulation" rel="noopener noreferrer"&gt;key encapsulation mechanism&lt;/a&gt;. The idea is to share a secret with someone using public key cryptography. Firstly, let generate a key pair with the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Kem/keyPair.html" rel="noopener noreferrer"&gt;&lt;code&gt;keyPair()&lt;/code&gt;&lt;/a&gt; method from a &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Kem-class.html" rel="noopener noreferrer"&gt;&lt;code&gt;Kem&lt;/code&gt;&lt;/a&gt; object instance.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="n"&gt;KeyPair&lt;/span&gt; &lt;span class="n"&gt;kpCarl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;kem&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;keyPair&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"kpCarl: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(kpCarl.publicKey)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;kpCarl: X0w77TyQOXGrhBQV/ypBYTYt6zx7kniSE4ttD1d+qKa8Wyt7nKZJXjFeAiI2tKh2KBHLR9J5QHSPOvIVy5q5ZXEVpnJL4rivkEcE+MKeqbGvsvaYv2iK3sN96ejMnWSMHBABucw+oJMMHUcnD5sHgLKtD6tDjwJkjnoIVlmNShzPiUHPinhdRIdPpEizBQsAYBo40Qwo0nAph8l6T7VoyOOCaLHJotGj/2Z3P7cqU6UUOIq6kUBkjPlKJ3e4Ojgd4whmNfg6HEQuxQvCMxfAyOWSKaZE9cETVDIy4WWIX1VDjmWNGISlEtaMwmdSbnVJB4pWNbAhbCZeJ3pWZoFP71Gy5yeH0tme+tg9S3C0CauNM5ZuevhVHfVeERZob1Ig7pEIRgB04qAW8kYlD9ZiMhWH/+PK8mQu3XxOiWUoCii3xdbLAsVvJfEUiAHDzzhzs4oerHe4WOEVGPAqjaGAvfNOEJYbC4NXL/NhRvenYcutteqMuKFDVuYo2gUZN9nEX/wzM2qNoLO2ByEi8kUkOmQgMXo8F3Y+P0woNZS6jYaBTip4ocuIP8N4YYRSEciJi+FcAK1PPGQ7kWNsNPFv2LVw8xl2DTFx8glsMsACz7wiSQgdWbkHzRkizKcLwSdYYdefz1FmaFaDL4wsXsAzjhaXvedG3Oou7OJtqHK9OwTL/DCWUZEavMCqqaqWYsxJZbol0qdhEWWL5hexm1GGzmYnCPNdsusKOOCItFUwQfB5v9qbBKCWOVBEN/dJ1scaT3cXhZaqrphT45R1EKgVKXCIwVxifDd7P9FwGlV7b1Acpfao00xtpha7DabC8NZkSoiHX2V8PnwveHUjBDqZUTIhlSZO71R2sBbB8kTC0YiU2PKgBspsf0ywenRHR8N0cFygn3a4LOCKMTd9kKUlbWbAi2o1QmtaaUwd7KfAXfShSwdt+murTOSgVjWi87sfhONml7tC4qDFo6SF5WI1nRFik5YexptOgteuRgVWkCpmVPJF1UJRMtaobzjDpGm+pfl2jDIHYml+XHMcHCkKy6KCnbxSj1MaAAyZLZI1nFbKHYpvYOLAsjQE1adf+TsfaOC7ydZ9ILp4QcxfzAFxlpiqVSyRmMiXhTdc4xQBoUEZnFM8IVcuy/Jec+pe1heu/UnA1zw0MtoB6SQ616RkAeq6zmuoRbKt/GgoQvyQq+tLfakFPcNAsdUU3/p/GeVkjXQa2Qx7M/osyrKmiUJvN7pNZ5lIe/VC9zpadLZnHoIODICIgqaIG4QFxLOdiTHP9hKB7dA4SmZxgJOn0Rl1nDBRAlIgvmiVW9lrPkO3cRGdDkE/3dGQppinn5OFxgjOtHFRJVi037hmuDaRZmW/OIiV8VCuTbkeCNUg3sUix8mxtxG0GrVsJypvMHY1DNWSV2soK4Mk/IjLUdUWImhhUeCudMBNaPINYiEJkQpd67g+YkuRXOlBy9djpRQjTQtaITVvwbbG3as9Q5RlunktEOQvqJg6zMK7i1Be/HFI4SLKqtxQg5ePYQhHIbUzppd1sweNpuDs+9XxRsxZKtUb2KjYeoKiltPFRojgHOr5Ik6yXD67oxPVMorCn3gZv8mMrPu5cg7vXiWnxXDuncdHEg==
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The public key can be then encrypted using the desired public key (the following example is wrong, the public key to use should have been another one, but the idea is the same). To encrypt the secret, the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Kem/enc.html" rel="noopener noreferrer"&gt;&lt;code&gt;enc()&lt;/code&gt;&lt;/a&gt; method can be used, it will return a ciphertext that can be send to to the recipient.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="n"&gt;KemEncResult&lt;/span&gt; &lt;span class="n"&gt;enc1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;kem&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;enc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;publicKey:&lt;/span&gt; &lt;span class="n"&gt;kpCarl&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;publicKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;  
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"enc1.ciphertext: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(enc1.ciphertext)}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"enc1.sharedSecret: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(enc1.sharedSecret.extractBytes())}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;enc1.ciphertext: GgIpamj4uT72RQi1PYs8wyr5DJWGW2wAsU1tBxQIBPF4d4xke/Q3fL16FE0v5dLlF7Esvoq9DBVxSMLuGLM0xM95FU9Hz/nup6AZ2hpJEJLnzWWyw8lTMUmVmgttiKPiFCRGlaPeoZZCnofy7ccbPnST+0w3Pb0pknaxmAF6y4x6Q+Kp/u+1jbhRtx49Lb4gIWDqH3UAxWke5srjzyGnQkLBHtwsh1KIHtpFuk4KWcc5wHgZRfGHGTrim6bUZXoD6hz4KebEE4bNNEZtYDJyyME4p3sPKTLuvIBbUfJKfn3bl8rjbWBeTgDubFBoPs37PPIvg9xsJtdBRoynVoSEG6njTyNU3ZQNxbYTPgi5tVbwPpTkBwDaDc9roypNyu6QiBFVxrtSi1brsfQAeWXy2qO3PNySHhO0mcvpz27VmKE+UbaB+i93IkosxpD3TndnSkEODb0Dwzq544oTv588Qk1n02sTbEgIqofTFNjeJfyHJ3VVM/zEwKxA7lX9ud214XVZpzfLKj7AkoXlpX/0unZYUuyfyr/ooUZkvOu5cA9MBYiowZMTPNWddMkcRxCz2mRGFyZyiAGu6Xqwz8Mpv3b7Ci5r8OEZaOewke2d9XqXRSjkTEYi7hy/dVYSrX2e1STvfKxPdqtoNXCyfhg9IE+v8C0qcYgh4b34EDC1qg8BITUJl7KFFw111Qm+5B+BipVCjyttHQJUO6OoqMsDztc0NlO2kY37bI3mlU7SgHVTFEReqMHMpoIOoNWcPF6V7FwksllBkjdG5XR7bF6c0ShhQtrJViJv+wV0u7I4LtYCuHKoKnFM2+QEWMjJyrk5jpSErI3g2izscF/ku94wC3JeYUyou9gcz0u4xqMdoPBPdahZRjinmF6MzK5pY0mRhnbf6rLVkoxe5NCexmO4+ZddTEEivMx+ZCb+IYLfYfhIiWLMYYUni6MEs0hXTAv4ylS5u2JH0Ke/2YYsZ/Dj3g/zrMNPemp3IDLRSxvjWdZcF6oxP+X+tlOY/UBAiWpKFXPCTUthlH9u2KRNQX8inl4wQjqurXG4oAKqHl5SWEvTIaw6otfawZMffQIe4LjNLS/OCVZIchoFXU1KBxZX1w1Z8OW9zDIj17zYCYy5Gt+Rf0oYmqtjzq58/jQ+oggkPgj1Ey05b5XTlN2RFaID2IRJFNUMU/C0nRbpHcQJ36pS0by8UgWSHRY8Umb8u4dh6+k5zXM2X+1wEtf5SV/yN6dr7L11N7X1rHhrUuLf68Tvpuqnb0ecb3b0V5RziRC7J+NpvndDXEyqKXvZJJzOReq+mXLuc0J6qGdGpzKu7IqQwX0iKrlcTWrMNzXR667PrMnSxgMQJx7CeWHigXJGwWhWck5vhiNpy7YAZL3Awk153Zqgs0sJ+nSPVpSqkuLe1f1whfLxbiyMMQvE3KfXzYR4JY7hy5AkhKWXpehGaO+mtbxxN7+HK7n5ggKl74RO/Pl/+pPWtpEs8KfB8CY+Ng==
enc1.sharedSecret: LV6LjDbXe1v33jkOLx1YPAktFzgj2wAvQ+ns3RT6CPs=
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The recipient receive the message and can decipher it using the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Kem/dec.html" rel="noopener noreferrer"&gt;&lt;code&gt;dec()&lt;/code&gt;&lt;/a&gt; method. It will return the shared secret, previously generated.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="n"&gt;SecureKey&lt;/span&gt; &lt;span class="n"&gt;dec1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;kem&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;dec&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;ciphertext:&lt;/span&gt; &lt;span class="n"&gt;enc1&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ciphertext&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;secretKey:&lt;/span&gt; &lt;span class="n"&gt;kpCarl&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;secretKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;  
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"dec1: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(dec1.extractBytes())}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;dec1: LV6LjDbXe1v33jkOLx1YPAktFzgj2wAvQ+ns3RT6CPs=
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Most of the time, the secret will be derived using a &lt;a href="https://libsodium.gitbook.io/doc/key_derivation" rel="noopener noreferrer"&gt;KDF&lt;/a&gt;, to do that, one can use &lt;a href="https://libsodium.gitbook.io/doc/key_derivation/hkdf" rel="noopener noreferrer"&gt;HKDF&lt;/a&gt; or the &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Kdf/deriveFromKey.html" rel="noopener noreferrer"&gt;&lt;code&gt;deriveFromKey()&lt;/code&gt;&lt;/a&gt; method from a &lt;a href="https://pub.dev/documentation/sodium/latest/sodium/Kdf-class.html" rel="noopener noreferrer"&gt;&lt;code&gt;KDF&lt;/code&gt;&lt;/a&gt; object instance.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="n"&gt;SecureKey&lt;/span&gt; &lt;span class="n"&gt;derivedKey1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;kdf&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;deriveFromKey&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;masterKey:&lt;/span&gt; &lt;span class="n"&gt;dec1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;context:&lt;/span&gt; &lt;span class="s"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;subkeyId:&lt;/span&gt; &lt;span class="n"&gt;BigInt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="nl"&gt;subkeyLen:&lt;/span&gt; &lt;span class="n"&gt;sodium&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;crypto&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;kdf&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;bytesMax&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;  
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"derivedKey1: &lt;/span&gt;&lt;span class="si"&gt;$derivedKey1&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"derivedKey1: &lt;/span&gt;&lt;span class="si"&gt;${base64.encode(derivedKey1.extractBytes())}&lt;/span&gt;&lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;derivedKey1: Instance of 'SecureKeyFFI'
derivedKey1: n1a5LPoQ80DNK0Sd3wwf4WrcjtELvPhGF6O58sM6YDk7izyipRBLpsXls42vqZNzEOrB27xuPgplF4YRIgJIDQ==
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Don't forget to check the official &lt;a href="https://libsodium.gitbook.io/" rel="noopener noreferrer"&gt;&lt;code&gt;libsodium&lt;/code&gt;&lt;/a&gt; documentation to have more information and study their examples.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;&lt;code&gt;libsodium&lt;/code&gt;, like most of the cryptographic libraries, is not easy to use. Why using &lt;code&gt;sodium&lt;/code&gt; when other packets can offer a simpler interface? Well, because of its portability, working almost everywhere. To be honest, this library was also in my toolbox for many years (the javascript implementation), and was used on many of my personal projects, but the Dart interface feels... different.&lt;/p&gt;

&lt;p&gt;A big part of the functions available on &lt;code&gt;libsodium&lt;/code&gt; have been ported via FFI, and it's really a good thing to use modern cryptographic algorithms on a modern language. Some parts are missing though, for example, the function to encode correctly a password hash in the Unix-like format. The &lt;a href="https://github.com/jedisct1/libsodium/blob/master/src/libsodium/crypto_pwhash/argon2/argon2-encoding.c" rel="noopener noreferrer"&gt;source code is available from &lt;code&gt;libsodium&lt;/code&gt;&lt;/a&gt;, but it would have been nice to have it in the Dart implementation.&lt;/p&gt;

&lt;p&gt;I hope I will have more time to write a better post, with real use case.As usual, if you want to know a bit more about all of this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://pub.dev/packages/sodium/" rel="noopener noreferrer"&gt;&lt;code&gt;sodium&lt;/code&gt; package in Dart&lt;/a&gt; using FFI on pub.dev, where you will find the global information about the Dart implementation;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://pub.dev/packages/sodium/example" rel="noopener noreferrer"&gt;&lt;code&gt;sodium&lt;/code&gt; examples in Dart&lt;/a&gt; on pub.dev, where you will find few examples;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/Skycoder42/libsodium_dart_bindings" rel="noopener noreferrer"&gt;&lt;code&gt;sodium&lt;/code&gt; source code&lt;/a&gt; on Github, where you will find the source code of the Dart package;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/Skycoder42/libsodium_dart_bindings/blob/main/packages/sodium/test/" rel="noopener noreferrer"&gt;&lt;code&gt;sodium&lt;/code&gt;&amp;nbsp;test suite&lt;/a&gt; on Github, where you will find the test suite, quite useful to see more examples;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://libsodium.gitbook.io/doc" rel="noopener noreferrer"&gt;Official &lt;code&gt;libsodium&lt;/code&gt; documentation&lt;/a&gt;, where you will find the original documentation for the &lt;code&gt;libsodium&lt;/code&gt;;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/jedisct1/libsodium" rel="noopener noreferrer"&gt;&lt;code&gt;libsodium&lt;/code&gt; source code&lt;/a&gt; on Github, where you will find the pure-C &lt;code&gt;libsodium&lt;/code&gt; source code, especially useful if you want to check the vectors and other test suite;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://nacl.cr.yp.to/" rel="noopener noreferrer"&gt;Official NaCl website&lt;/a&gt;, the original project from cr.yp.to, you should probably check, very instructive.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Always be careful when using cryptography in your code, try to reuse existing patterns and avoid creating your own stuff, it's most of the time a bad idea. &lt;/p&gt;

&lt;p&gt;But as always... Happy hacking and have fun!&lt;/p&gt;




&lt;p&gt;Cover image by &lt;a href="https://unsplash.com/@mariaspics?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Maria Petersson&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/brown-wooden-spoon-on-white-snow-OuvmgR815MQ?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>libsodium</category>
      <category>nacl</category>
      <category>cryptography</category>
      <category>dart</category>
    </item>
    <item>
      <title>WeeklyReview#202642</title>
      <dc:creator>Mathieu Kerjouan</dc:creator>
      <pubDate>Mon, 19 Oct 2026 10:00:00 +0000</pubDate>
      <link>https://dev.to/niamtokik/weeklyreview202642-488o</link>
      <guid>https://dev.to/niamtokik/weeklyreview202642-488o</guid>
      <description>&lt;p&gt;While reading &lt;a href="https://xeiaso.net/shitposts/no-way-to-prevent-this/memory-safety/CVE-2026-92392/" rel="noopener noreferrer"&gt;&lt;em&gt;"No way to prevent this" say users of only language where this regularly happens&lt;/em&gt;&lt;/a&gt;, yet another complaining about C code, I was thinking... During the past 20 years, many solutions have been created, but only a few C developers are using them. More recently, the &lt;a href="https://fil-c.org/" rel="noopener noreferrer"&gt;fil-c&lt;/a&gt; was created to make C memory safe, hopefully it will be used in the future. The compilers are way better than 20 years ago, and for example, it is now possible to easily export the AST of any C project with clang/llvm. Even more, many compilers are now offering their own tools like static analyser to check the code. In fact, I was currently using few them to test my own pet project sandbox, and it's amazingly pleasant to code with all the flags and all those tools. So, why should we rewrite everything in rust, go or any other "modern" language if the AST is available, and we have ways to convert existing C/C++ code into a safer binary version?&lt;/p&gt;

&lt;p&gt;Let's go back to the article, the &lt;a href="https://curl.se/docs/CVE-2026-92392.html" rel="noopener noreferrer"&gt;CVE-2026-92392&lt;/a&gt; is an use after free bug, a classical mistake anyone do at least one time in its developer life. &lt;a href="https://fil-c.org/" rel="noopener noreferrer"&gt;fil-c&lt;/a&gt; fixes that, but let's go a bit deeper. C is known to be an interface to low-level language (assembly) and will let you do whatever you want, it means the memory management must be done manually, like any other resources. It's a complex task, and can become a nightmare when dealing with concurrency. Why not using a pattern above that, always in charge to deal with those resources... Oh, wait, it's a kind of garbage collector, right? Or perhaps a kind of state machine, where the state is a resource that can be opened, used or closed. Anyway, adding another layer will increase the complexity of the existing code, but using something like fil-c could really help a lot.&lt;/p&gt;




&lt;p&gt;A part of my free-time was dedicated to find design inspiration with Flutter. Thanks to &lt;a href="https://flutterawesome.com" rel="noopener noreferrer"&gt;Flutter Awesome&lt;/a&gt;, a long list of open-source Flutter projects can be checked! Here a quick list with the ones I liked the most &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/alperefesahin/flutter_social_chat" rel="noopener noreferrer"&gt;&lt;code&gt;flutter_social_chat&lt;/code&gt;&lt;/a&gt;: A simple chat compatible with iOS and Android. The design is really cool.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/OstrichGram/OstrichGram" rel="noopener noreferrer"&gt;&lt;code&gt;OstrichGram&lt;/code&gt;&lt;/a&gt;: a desktop (linux/windows) Nostr client.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/droperr/dash_chat_2.1" rel="noopener noreferrer"&gt;&lt;code&gt;dash_chat_2.1&lt;/code&gt;&lt;/a&gt;: an interesting library with many reusable widgets.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/Hamad-Anwar/Flutter-Music-Player-App-With-BLoc" rel="noopener noreferrer"&gt;&lt;code&gt;Flutter-Music-Player-App-With-BLoc&lt;/code&gt;&lt;/a&gt;: I like the clean MVC organization of this application and the fact there is no route defined, only a navigator pushing screen between context.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://github.com/Suzefa/bloc_flutter_app" rel="noopener noreferrer"&gt;&lt;code&gt;bloc_flutter_app&lt;/code&gt;&lt;/a&gt;: another example application using the Bloc pattern.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;I was playing with the Erlang ssh key interface with Elixir (I wrote an article on that in a French magazine on this topic, but with Erlang). Let generate a public/private key.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;ssh-keygen &lt;span class="nt"&gt;-f&lt;/span&gt; t.key &lt;span class="nt"&gt;-t&lt;/span&gt; ed25519
&lt;span class="c"&gt;...
&lt;/span&gt;&lt;span class="go"&gt;Your identification has been saved in t.key 
Your public key has been saved in t.key.pub 
&lt;/span&gt;&lt;span class="c"&gt;...
&lt;/span&gt;&lt;span class="go"&gt;
&lt;/span&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;file t.key.pub
&lt;span class="go"&gt;t.key.pub: OpenSSH ED25519 public key
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, we can use parse and validate it. We are using the &lt;a href=""&gt;&lt;code&gt;:ssh_message&lt;/code&gt;&lt;/a&gt;&lt;a href="https://github.com/erlang/otp/blob/master/lib/ssh/src/ssh_message.erl" rel="noopener noreferrer"&gt;https://github.com/erlang/otp/blob/master/lib/ssh/src/ssh_message.erl&lt;/a&gt; Erlang module (undocumented) and the &lt;a href="https://www.erlang.org/doc/apps/public_key/public_key.html" rel="noopener noreferrer"&gt;&lt;code&gt;:public_key&lt;/code&gt;&lt;/a&gt; Erlang module to convert it from one format to another one.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight elixir"&gt;&lt;code&gt;&lt;span class="c1"&gt;# open the file, it can also from any kind of String.()&lt;/span&gt;
&lt;span class="c1"&gt;# element&lt;/span&gt;
&lt;span class="no"&gt;File&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"/t.key.pub"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# Split the key with null char, it should returns a list&lt;/span&gt;
&lt;span class="c1"&gt;# of 4 elements&lt;/span&gt;
&lt;span class="c1"&gt;#   ["ssh-ed25519", pubkey, comment, ""]&lt;/span&gt;
&lt;span class="o"&gt;|&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="no"&gt;Regex&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;~r"\s+"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;&amp;amp;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; 

&lt;span class="c1"&gt;# Returns only the pubkey&lt;/span&gt;
&lt;span class="o"&gt;|&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;Enum&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;at&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# SSH public key is base64 encoded, decode it.&lt;/span&gt;
&lt;span class="o"&gt;|&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;Base&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;decode64!&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# parse the result with ssh2_pubkey_decode/1 function.&lt;/span&gt;
&lt;span class="c1"&gt;# it returns something like that:&lt;/span&gt;
&lt;span class="c1"&gt;#   {{:ECPoint, ecpoint}, {:namedCurve, {1, 3, 101, 112}}}&lt;/span&gt;
&lt;span class="o"&gt;|&amp;gt;&lt;/span&gt; &lt;span class="ss"&gt;:ssh_message&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ssh2_pubkey_decode&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# this part is to convert it in PEM format (TLS)&lt;/span&gt;
&lt;span class="c1"&gt;# the firs step is to create an entry with the correct&lt;/span&gt;
&lt;span class="c1"&gt;# ASN1 type (e.g :SubjectPublicKeyInfo)&lt;/span&gt;
&lt;span class="c1"&gt;#   {:SubjectPublicKeyInfo, pubkey, :not_encrypted}&lt;/span&gt;
&lt;span class="o"&gt;|&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="ss"&gt;:public_key&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pem_entry_encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="ss"&gt;:SubjectPublicKeyInfo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;&amp;amp;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="c1"&gt;# the final step is to finalize the PEM encoding&lt;/span&gt;
&lt;span class="c1"&gt;#   "-----BEGIN PUBLIC KEY-----\nbase64\n-----END PUBLIC KEY-----\n\n"&lt;/span&gt;
&lt;span class="o"&gt;|&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="ss"&gt;:public_key&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pem_encode&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nv"&gt;&amp;amp;1&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h1&gt;
  
  
  Coding
&lt;/h1&gt;

&lt;p&gt;📝 &lt;a href="https://dthain.github.io/books/compiler/compilerbook.pdf" rel="noopener noreferrer"&gt;&lt;strong&gt;Introduction to Compilers and Language Design, Second Edition&lt;/strong&gt;&lt;/a&gt;: what a great book! It covers all compiling steps, from scanning, parsing, code generation and optimization.&lt;/p&gt;

&lt;p&gt;📖 &lt;a href="https://sdiehl.github.io/write-you-a-haskell/" rel="noopener noreferrer"&gt;&lt;strong&gt;Write You a Haskell&lt;/strong&gt;&lt;/a&gt;: yet another book in Haskell.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://eliasebner.com/blog/guides/arena-allocators-in-c/" rel="noopener noreferrer"&gt;&lt;strong&gt;Arena Allocators in C&lt;/strong&gt;&lt;/a&gt;: implementing memory allocators in C can be challenging, here a nice article on how to write one using &lt;a href="https://en.wikipedia.org/wiki/Region-based_memory_management" rel="noopener noreferrer"&gt;region-based memory management&lt;/a&gt; technique or arena allocator&lt;/p&gt;

&lt;p&gt;🏗️ &lt;a href="https://eyereasoner.github.io/eyelang/" rel="noopener noreferrer"&gt;&lt;strong&gt;eyelang&lt;/strong&gt;&lt;/a&gt;: An experimental symbolic logic programming language using a practical subset of Prolog syntax and .pl files, with query explanations and executable checks.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://ash-hq.org/blog/concentrated-liability/" rel="noopener noreferrer"&gt;&lt;strong&gt;Concentrated Liability&lt;/strong&gt;&lt;/a&gt;: a security audit report on Ash framework using LLMs.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://eliasebner.com/blog/guides/generic-dynamic-arrays-in-c/" rel="noopener noreferrer"&gt;&lt;strong&gt;Generic Dynamic Arrays in C&lt;/strong&gt;&lt;/a&gt;: Another great article by Eliase Ebner.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://eliasebner.com/blog/guides/fixing-strings-in-c/" rel="noopener noreferrer"&gt;&lt;strong&gt;Why C Strings Suck And How I Fixed Them&lt;/strong&gt;&lt;/a&gt;: A good way to fix C strings. I like it.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://eliasebner.com/blog/thoughts/advice-for-software-developers-with-large-language-models/" rel="noopener noreferrer"&gt;&lt;strong&gt;Some Advice for Software Developers in the Age of Large Language Models&lt;/strong&gt;&lt;/a&gt;: This post has many good points regarding LLM, especially the quote below. Indeed, I already saw that in a previous position, someone losing many weeks of developing, switching and switching between LLMs to solve a problem.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;what are you going to do when the LLM reaches its limit [...] and you are left having to solve the issue on your own? Ask a different LLM? And if that fails? Who are you going to turn to?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;📝 &lt;a href="https://eliasebner.com/blog/guides/c-sockets-from-scratch/" rel="noopener noreferrer"&gt;&lt;strong&gt;C Socket Programming in Linux: Build a TCP Client &amp;amp; Server (Complete Guide)&lt;/strong&gt;&lt;/a&gt;: this blog has really nice article! A must read for the one who wants to learn more about C programming!&lt;/p&gt;

&lt;p&gt;🌐 &lt;a href="https://www.cphof.org/" rel="noopener noreferrer"&gt;&lt;strong&gt;Competitive Programming Hall Of Fame&lt;/strong&gt;&lt;/a&gt;:  a project created to preserve the history of international championships in competitive programming. This website collects the results of final stages for both worldwide and regional contests. By international championship we mean a contest consisting of several stages available for competitors from more than one country.&lt;/p&gt;

&lt;h1&gt;
  
  
  System
&lt;/h1&gt;

&lt;p&gt;📝 &lt;a href="https://vermaden.wordpress.com/2026/10/10/freebsd-cope-with-signal-fuckup/" rel="noopener noreferrer"&gt;&lt;strong&gt;FreeBSD Cope with Signal Fuckup&lt;/strong&gt;&lt;/a&gt;: installing signal on FreeBSD using chrooted environment. It would have been better to use a jail there, but it looks okay.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://cybersect.substack.com/p/we-can-harden-c" rel="noopener noreferrer"&gt;&lt;strong&gt;We can harden C&lt;/strong&gt;&lt;/a&gt;: why talking about rust or IA, again? If you want to increase the security of you C application, the first step is to enable all warnings and errors, but also all security features offered by your favorite compiler. It will less fun - because the compiler will blame you for every weird stuff you are doing - be the result will be way better. The next step is to ALWAYS code in C with the help of a small test suite framework like &lt;a href="https://nemequ.github.io/munit/" rel="noopener noreferrer"&gt;&lt;code&gt;munit&lt;/code&gt;&lt;/a&gt; or &lt;a href="//github.com/siu/minunit/tree/master"&gt;&lt;code&gt;minunit&lt;/code&gt;&lt;/a&gt;. Easy to install and easy to use, it will easier to create your tests and design your application. Finally, don't forget to use the modern tools available on &lt;a href="https://gcc.gnu.org/" rel="noopener noreferrer"&gt;&lt;code&gt;gcc&lt;/code&gt;&lt;/a&gt; or &lt;a href="https://llvm.org/" rel="noopener noreferrer"&gt;&lt;code&gt;llvm&lt;/code&gt;&lt;/a&gt;, like &lt;a href="https://clang-analyzer.llvm.org/" rel="noopener noreferrer"&gt;static analyzers&lt;/a&gt;. Not everything will be fixed though, and if you need a really strong application, you should check the security features offered by FreeBSD (&lt;a href="https://man.freebsd.org/cgi/man.cgi?query=capsicum" rel="noopener noreferrer"&gt;capsicum&lt;/a&gt;), OpenBSD (&lt;a href="https://man.openbsd.org/pledge" rel="noopener noreferrer"&gt;pledge&lt;/a&gt;, &lt;a href="https://man.openbsd.org/unveil" rel="noopener noreferrer"&gt;unveil&lt;/a&gt;) or Linux. Anyway, C hardening can be challenging, not because of the complexity, but more because of our ignorance about all the tools available.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://www.opensourceprojects.dev/post/buildah" rel="noopener noreferrer"&gt;&lt;strong&gt;Building OCI Images Without a Daemon or a Dockerfile&lt;/strong&gt;&lt;/a&gt;: how to build OCI image from scratch, here the repository on &lt;a href="https://github.com/podman-container-tools/buildah" rel="noopener noreferrer"&gt;github&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://internals-for-interns.com/posts/linux-kernel-namespaces/" rel="noopener noreferrer"&gt;&lt;strong&gt;Understanding the Linux Kernel: Namespaces&lt;/strong&gt;&lt;/a&gt;: yet another article on the namespaces.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://hackaday.com/2026/10/12/your-computer-memory-is-a-lie/" rel="noopener noreferrer"&gt;&lt;strong&gt;Your Computer Memory Is A Lie&lt;/strong&gt;&lt;/a&gt;: a post doing a summary of the problems involving memory (in general).&lt;/p&gt;

&lt;h1&gt;
  
  
  Database
&lt;/h1&gt;

&lt;p&gt;📑 &lt;a href="https://arxiv.org/pdf/2610.12692" rel="noopener noreferrer"&gt;&lt;strong&gt;Distributed Datalog at Scale with Worst-Case Optimal Joins&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🏗️ &lt;a href="https://github.com/gmr/pglifecycle" rel="noopener noreferrer"&gt;&lt;strong&gt;pglifecycle&lt;/strong&gt;&lt;/a&gt;:  keeps your database schema in a version-controlled project of YAML files — one file per database object, validated against a JSON-Schema contract — and moves schema between the repository and live databases.&lt;/p&gt;

&lt;h1&gt;
  
  
  security
&lt;/h1&gt;

&lt;p&gt;📝 &lt;a href="https://calif.io/research/big-fish" rel="noopener noreferrer"&gt;&lt;strong&gt;Big Fish: Exploiting a 37-Year-Old Kernel Bug in OpenBSD&lt;/strong&gt;&lt;/a&gt;: an interesting report about one of the security issues recently published on OpenBSD. This is a nasty issue, present there for more than 3 decades.&lt;/p&gt;

&lt;p&gt;🌐 &lt;a href="https://zr.ax/" rel="noopener noreferrer"&gt;&lt;strong&gt;zr.ax&lt;/strong&gt;&lt;/a&gt;: classifies executables and raw firmware, with interactive Hilbert entropy maps, a hex inspector, and batch analysis. via &lt;a href="https://x.com/in19h/status/2109069625862570330?s=20" rel="noopener noreferrer"&gt;Kenan Sulayman&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://binsec.no/posts/2026/10/one-root-case" rel="noopener noreferrer"&gt;&lt;strong&gt;Azure's Weakest Link - Five Full Cross-Tenant Compromises&lt;/strong&gt;&lt;/a&gt;: oof. a violent and nasty security issue on azure cloud that can extract user secret via a craft URL encoded path.&lt;/p&gt;

&lt;p&gt;📑 &lt;a href="https://www.usenix.org/conference/woot16/workshop-program/presentation/spisak" rel="noopener noreferrer"&gt;&lt;strong&gt;Hardware-Assisted Rootkits: Abusing Performance Counters on the ARM and x86 Architectures&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://royfish.dev/fingerprints-are-the-new-cookies" rel="noopener noreferrer"&gt;&lt;strong&gt;Fingerprints are the new cookies&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://hackers-arise.com/confessions-of-a-professional-hacker-can-the-cia-or-other-intelligence-agencies-track-my-every-move-2/" rel="noopener noreferrer"&gt;&lt;strong&gt;Confessions of a Professional Hacker: Can the CIA or other Intelligence Agencies Track My Every Move?&lt;/strong&gt;&lt;/a&gt;: yes. Any state agencies with enough resources can track anybody without any problem. It's becoming very hard to be protected against that, even without any digital devices, you are becoming a target.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://adepts.of0x.cc/eufy-homestation2-firmware/" rel="noopener noreferrer"&gt;&lt;strong&gt;A story of wifi secrets, UART lockdowns and a damaged flash memory chip&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🏗️ &lt;a href="https://github.com/alphafox02/openwrt-one-sdr" rel="noopener noreferrer"&gt;&lt;strong&gt;openwrt-one-sdr&lt;/strong&gt;&lt;/a&gt;: Turns an OpenWrt One router into a wideband, receive-only software-defined receiver. The board's MediaTek MT7981B Wi-Fi SoC (with an MT7976 radio front end) captures raw 14-bit IQ from the 2.4 and 5 GHz bands at 40 Msps, the dual Cortex-A53 streams it over the 2.5 GbE port as VITA 49, and a Linux host shows it as a live spectrum and waterfall in the browser.&lt;/p&gt;

&lt;h1&gt;
  
  
  Security/Cryptography
&lt;/h1&gt;

&lt;p&gt;🌐 &lt;a href="https://ecdsa.fail/" rel="noopener noreferrer"&gt;&lt;strong&gt;ecdsa.fail&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Security/Red-Team
&lt;/h1&gt;

&lt;p&gt;🏗️ &lt;a href="https://github.com/dinosn/exploit-watch-archive" rel="noopener noreferrer"&gt;&lt;strong&gt;exploit-watch-archive&lt;/strong&gt;&lt;/a&gt;: durable, private aggregation of the exploit/PoC source repos tracked by the exploit-watch monitoring task.&lt;/p&gt;

&lt;h1&gt;
  
  
  Embedded
&lt;/h1&gt;

&lt;p&gt;📝 &lt;a href="https://hackaday.com/2026/10/13/the-fpga-chronicles-ready-to-probe/" rel="noopener noreferrer"&gt;&lt;strong&gt;The FPGA Chronicles: Ready To Probe&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://hackaday.com/2026/10/15/another-wireless-chip-has-a-hidden-sdr-revealed/" rel="noopener noreferrer"&gt;&lt;strong&gt;Another Wireless Chip Has A Hidden SDR Revealed&lt;/strong&gt;&lt;/a&gt;: some ESP32 chips are embedding SDR feature. It looks provising.&lt;/p&gt;

&lt;h1&gt;
  
  
  Update/Upgrade
&lt;/h1&gt;

&lt;p&gt;🔄 &lt;a href="https://x.com/abraxas_null/status/2110120094810693729?s=20" rel="noopener noreferrer"&gt;&lt;strong&gt;OpnSense&lt;/strong&gt;&lt;/a&gt;: 7 remote exploits. Some of them looks really dangerous, please update.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/abraxas/opnsense-firmware-mirror-sed" rel="noopener noreferrer"&gt;opnsense-firmware-mirror-sed&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/abraxas/opnsense-tunables-loader/" rel="noopener noreferrer"&gt;opnsense-tunables-loader&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/abraxas/opnsense-uidfield-system-uid0" rel="noopener noreferrer"&gt;opnsense-uidfield-system-uid0&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/abraxas/opnsense-ntp-gps-fudge" rel="noopener noreferrer"&gt;opnsense-ntp-gps-fudge&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/abraxas/opnsense-wlan-wpa-line" rel="noopener noreferrer"&gt;opnsense-wlan-wpa-line&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/abraxas/opnsense-captive-lastseen-roam" rel="noopener noreferrer"&gt;opnsense-captive-lastseen-roam&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/abraxas/opnsense-tunables-loader" rel="noopener noreferrer"&gt;opnsense-tunables-loader&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🔄 &lt;a href="https://x.com/abraxas_null/status/2110041481365057758?s=20" rel="noopener noreferrer"&gt;&lt;strong&gt;pfSense&lt;/strong&gt;&lt;/a&gt;: pfSense seems to have been impacted as well.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/abraxas/pfsense-qinq-parent-if" rel="noopener noreferrer"&gt;pfsense-qinq-parent-if&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/abraxas/pfsense-openvpn-wizard-crlf" rel="noopener noreferrer"&gt;pfsense-openvpn-wizard-crlf&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/abraxas/pfsense-limiter-number" rel="noopener noreferrer"&gt;pfsense-limiter-number&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/abraxas/pfsense-carp-vhid" rel="noopener noreferrer"&gt;pfsense-carp-vhid&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/abraxas/pfsense-ipsec-login-banner" rel="noopener noreferrer"&gt;pfsense-ipsec-login-banner&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🔄 &lt;a href="https://github.com/erlang/otp/releases/tag/OTP-29.1.2" rel="noopener noreferrer"&gt;&lt;strong&gt;Erlang/OTP 29.1.2&lt;/strong&gt;&lt;/a&gt;: bugs and security fixes.&lt;/p&gt;

&lt;h1&gt;
  
  
  Leaks of the week
&lt;/h1&gt;

&lt;p&gt;📝 &lt;a href="https://frenchbreaches.com/blog/fuite-de-donnees-chez-meta-1-500-personnes-touchees-apres-un-piratage-sur-github" rel="noopener noreferrer"&gt;&lt;strong&gt;Meta&lt;/strong&gt;&lt;/a&gt;: 1500 people impacted after github repositories hacked.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://frenchbreaches.com/blog/noms-numeros-de-secu-conversations-medicales-ce-que-revele-le-piratage-de-maquestionmedicale" rel="noopener noreferrer"&gt;&lt;strong&gt;MaQuestionMedicale&lt;/strong&gt;&lt;/a&gt;: 96000 people impacted, 369k private messages, with name, phone number, and more.&lt;/p&gt;

&lt;p&gt;📝 &lt;a href="https://frenchbreaches.com/alertes/solutions-30-mv5nto6keh511e3t4k7" rel="noopener noreferrer"&gt;&lt;strong&gt;Solution30&lt;/strong&gt;&lt;/a&gt;: more than 10millions identifiers impacted, 11 millions phone number, 2 millions e-mail address.&lt;/p&gt;

&lt;p&gt;🐦 &lt;a href="https://x.com/H4ckmanac/status/2110981593758056679?s=20" rel="noopener noreferrer"&gt;&lt;strong&gt;Canva&lt;/strong&gt;&lt;/a&gt;: 200 millions database rows including enterprise license, and orders.&lt;/p&gt;

&lt;p&gt;🐦 &lt;a href="https://x.com/H4ckmanac/status/2110686001337127028?s=20" rel="noopener noreferrer"&gt;&lt;strong&gt;Sourcenext Corporation&lt;/strong&gt;&lt;/a&gt;: 22.5 millions customer records including name, phone numbers, e-mail addresses, passwords, postal address...&lt;/p&gt;

&lt;h1&gt;
  
  
  Misc
&lt;/h1&gt;

&lt;p&gt;📝 &lt;a href="https://lkml.org/lkml/2026/10/13/3242" rel="noopener noreferrer"&gt;&lt;strong&gt;I don't understand this whole idiotic concept of "don't use AI for X".&lt;/strong&gt;&lt;/a&gt;: The problem is not the LLM/AI per se, but where the computation is made. A compiler and most of the software a developer is using are hosted on their own laptop or on a server they are owning. The result is their own binaries, on their own infrastructure. Today, most - if not all - LLMs are being used through big companies (e.g. Google, Microsoft, Apple, Meta, Anthropic and so on), where the definition of "freedom of usage" is globally incompatible with open-source software. Yes this is a tool, but a tool one is using remotely, on servers no one controls. That's crazy someone like Torvalds does not understand that. When local-LLMs will be working correctly, I think it will be huge win for the open-source world, but for now, this is a future trap.&lt;/p&gt;




&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-2109301986189324775-605" src="https://platform.twitter.com/embed/Tweet.html?id=2109301986189324775"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-2109301986189324775-605');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=2109301986189324775&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/gmkurtzer/status/2109302135846555882?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F4w6xzbvxdh20lxyv06zw.png" alt=" " width="598" height="858"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/johnennis/status/2108958121133510760?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftdnqp4nr8gy2gyocn7qk.png" alt=" " width="598" height="218"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/a_musingcat/status/2109447042460479703?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fn8ei05xr5luuh1hhgm3k.png" alt=" " width="598" height="118"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/msimoni/status/2109349273234231676?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frfsr3u90kijdn768690v.png" alt=" " width="598" height="138"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/CodeWisdom/status/2109597719983517740?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F02zjhhhmvm3g4g1xhe32.png" alt=" " width="598" height="118"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/mcnabbd/status/2109341118550991034?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fztx4m03o290ob82quoua.png" alt=" " width="598" height="524"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/jiratickets/status/2109764284972679404?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fon2k5wbqvbhtdbw2u390.png" alt=" " width="598" height="626"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/badcop_/status/2110083558215975161?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fc4eynfmwfgsw463v824w.png" alt=" " width="598" height="178"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/aiandcloud/status/2110164468244140205?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjnzfxa983801xzen8gzm.png" alt=" " width="598" height="566"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/herrmann1001/status/2110199064822489351?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fd6fyn71uuyxvsqtdpldm.png" alt=" " width="598" height="178"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/chrisbanes/status/2109919479388160087?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fstqtxkmuqahrr2xcseoa.png" alt=" " width="598" height="158"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/CodeWisdom/status/2110340681759658408?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcvzvlebp168iakg7v69b.png" alt=" " width="598" height="118"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/OfMikeAndMen/status/2110708163112759448?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fce32ovyq6vjgdw0dmgqx.png" alt=" " width="598" height="499"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F488hbgbf41g866c97ly9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F488hbgbf41g866c97ly9.png" alt=" " width="598" height="98"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://x.com/ThePrimeagen/status/2111100293941219644?s=20" rel="noopener noreferrer"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5eoghuubjaldlc74org3.png" alt=" " width="598" height="576"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5fnpi6kcf1rexujcpipt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5fnpi6kcf1rexujcpipt.png" alt=" " width="675" height="499"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcrehlkd0c3qnnm60tkgp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcrehlkd0c3qnnm60tkgp.png" alt=" " width="500" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffeo651hs1demadi7byic.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffeo651hs1demadi7byic.png" alt=" " width="680" height="680"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fet4weo7mur2dty19hmaq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fet4weo7mur2dty19hmaq.png" alt=" " width="500" height="667"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F44b3qmein49q7v2ld82r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F44b3qmein49q7v2ld82r.png" alt=" " width="658" height="680"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Cover Image by &lt;a href="https://unsplash.com/@freestocks?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;freestocks&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/pumpkin-between-lighted-candles-kVv8AvoKJ7g?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>weekly</category>
      <category>review</category>
    </item>
    <item>
      <title>Q&amp;D: Using WebView with Flutter</title>
      <dc:creator>Mathieu Kerjouan</dc:creator>
      <pubDate>Thu, 15 Oct 2026 08:00:00 +0000</pubDate>
      <link>https://dev.to/niamtokik/qd-using-webview-with-flutter-2379</link>
      <guid>https://dev.to/niamtokik/qd-using-webview-with-flutter-2379</guid>
      <description>&lt;p&gt;Your website is already working well, compatible with mobile device? Why recreating the wheel, and simply recreate your application around the &lt;a href="https://developer.android.com/reference/android/webkit/WebView" rel="noopener noreferrer"&gt;&lt;code&gt;WebView&lt;/code&gt;&lt;/a&gt; feature? The idea is simple, use the native Android (or iOS) browser inside your application. It will not fix everything though, but you will be able to reuse your website without rewriting everything from scratch.&lt;/p&gt;

&lt;p&gt;Another purpose of &lt;code&gt;WebView&lt;/code&gt; objects is to create an interface to a platform without public API. Indeed, with &lt;code&gt;WebView&lt;/code&gt; you will have access to a real web browser capabilities, including executing requests on a remote service, storing cookies or executing Javascript script. on Dart/Flutter, the &lt;code&gt;webview_flutter&lt;/code&gt; package is required.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;flutter pub add webview_flutter
&lt;span class="go"&gt;Resolving dependencies... 
Downloading packages... 
  cupertino_icons 1.0.9 (2.0.0 available)
  material_color_utilities 0.13.0 (0.13.1 available)
  meta 1.18.3 (1.19.0 available)
+ plugin_platform_interface 2.1.8
  test_api 0.7.12 (0.7.15 available)
  vector_math 2.4.2 (2.4.3 available)
+ webview_flutter 4.14.1
+ webview_flutter_android 4.14.1
+ webview_flutter_platform_interface 2.15.1
+ webview_flutter_wkwebview 3.27.0
Changed 5 dependencies!
5 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information.
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;WebView&lt;/code&gt; objects are objects to display web content (usually website) inside an application. This kind of object can be found on &lt;a href="https://developer.android.com/reference/android/webkit/WebView" rel="noopener noreferrer"&gt;Android&lt;/a&gt; and on &lt;a href="https://developer.apple.com/documentation/webkit/wkwebview" rel="noopener noreferrer"&gt;iOS&lt;/a&gt;, both implementation offering similar (but not perfectly identical) features. When one &lt;code&gt;WebView&lt;/code&gt; object is instantiated, it can be used like a browser where a part of its interfaces are exposed to the application.&lt;/p&gt;

&lt;p&gt;The best way to demonstrate this is to create a &lt;a href="https://pub.dev/documentation/webview_flutter/latest/webview_flutter/WebViewController-class.html" rel="noopener noreferrer"&gt;&lt;code&gt;WebViewController&lt;/code&gt;&lt;/a&gt; object. The one presented in the example should do the job for now (with few modification):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The &lt;a href="https://pub.dev/documentation/webview_flutter/latest/webview_flutter/WebViewController/setJavaScriptMode.html" rel="noopener noreferrer"&gt;&lt;code&gt;setJavaScriptMode&lt;/code&gt;&lt;/a&gt; method is called, it can be set to &lt;a href="https://pub.dev/documentation/webview_flutter/latest/webview_flutter/JavaScriptMode.html#disabled" rel="noopener noreferrer"&gt;&lt;code&gt;disabled&lt;/code&gt;&lt;/a&gt; or &lt;a href="https://pub.dev/documentation/webview_flutter/latest/webview_flutter/JavaScriptMode.html#unrestricted" rel="noopener noreferrer"&gt;&lt;code&gt;unrestricted&lt;/code&gt;&lt;/a&gt;;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The &lt;a href="https://pub.dev/documentation/webview_flutter/latest/webview_flutter/WebViewController/setNavigationDelegate.html" rel="noopener noreferrer"&gt;&lt;code&gt;setNavigationDelegate&lt;/code&gt;&lt;/a&gt; method is called, and a &lt;a href="https://pub.dev/documentation/webview_flutter/latest/webview_flutter/NavigationDelegate-class.html" rel="noopener noreferrer"&gt;&lt;code&gt;NavigationDelegate&lt;/code&gt;&lt;/a&gt; object is created. This last one is used to accept or reject the navigation changes. The following callback functions can be configured:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://pub.dev/documentation/webview_flutter/latest/webview_flutter/NavigationDelegate/onNavigationRequest.html" rel="noopener noreferrer"&gt;&lt;code&gt;onNavigationRequest&lt;/code&gt;&lt;/a&gt;: executed to accept/deny navigation;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://pub.dev/documentation/webview_flutter/latest/webview_flutter/NavigationDelegate/onPageFinished.html" rel="noopener noreferrer"&gt;&lt;code&gt;onPageFinished&lt;/code&gt;&lt;/a&gt;: executed when the page is fully loaded;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://pub.dev/documentation/webview_flutter/latest/webview_flutter/NavigationDelegate/onPageStarted.html" rel="noopener noreferrer"&gt;&lt;code&gt;onPageStarted&lt;/code&gt;&lt;/a&gt;: executed when the page loading started;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://pub.dev/documentation/webview_flutter/latest/webview_flutter/NavigationDelegate/onProgress.html" rel="noopener noreferrer"&gt;&lt;code&gt;onProgress&lt;/code&gt;&lt;/a&gt;: executed during the page loading progression;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://pub.dev/documentation/webview_flutter/latest/webview_flutter/NavigationDelegate/onWebResourceError.html" rel="noopener noreferrer"&gt;&lt;code&gt;onWebResourceError&lt;/code&gt;&lt;/a&gt;: executed when an error occurs.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;a href="https://pub.dev/documentation/webview_flutter/latest/webview_flutter/WebViewController/clearCache.html" rel="noopener noreferrer"&gt;&lt;code&gt;cacheClear&lt;/code&gt;&lt;/a&gt; method is called: use the remove the cache from the &lt;code&gt;WebView&lt;/code&gt;;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;a href="https://pub.dev/documentation/webview_flutter/latest/webview_flutter/WebViewController/clearLocalStorage.html" rel="noopener noreferrer"&gt;&lt;code&gt;clearLocalStorage&lt;/code&gt;&lt;/a&gt; method is called: used to clear the local storage from the &lt;code&gt;WebView&lt;/code&gt;;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;a href="https://pub.dev/documentation/webview_flutter/latest/webview_flutter/WebViewController/loadRequest.html" rel="noopener noreferrer"&gt;&lt;code&gt;loadRequest&lt;/code&gt;&lt;/a&gt; method is called: used to load an URL.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="n"&gt;WebViewController&lt;/span&gt; &lt;span class="nf"&gt;controller&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;'https://authenticationtest.com/simpleFormAuth/'&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// parse an URL from a string&lt;/span&gt;
  &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;Uri&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// Return a WebViewController Object with custom callbacks&lt;/span&gt;
  &lt;span class="c1"&gt;// and parameters&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;WebViewController&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="c1"&gt;// set the javascript mode to unrestricted (javascript&lt;/span&gt;
    &lt;span class="c1"&gt;// can be executed)&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setJavaScriptMode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;JavaScriptMode&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;unrestricted&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="c1"&gt;// configure the authorized navigation pattern&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;setNavigationDelegate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="n"&gt;NavigationDelegate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;

        &lt;span class="c1"&gt;// a progression gauge can be created if necessary&lt;/span&gt;
        &lt;span class="nl"&gt;onProgress:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;progress&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"loading in progress (&lt;/span&gt;&lt;span class="si"&gt;$progress&lt;/span&gt;&lt;span class="s"&gt;)..."&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;

        &lt;span class="c1"&gt;// when the connection to the page start&lt;/span&gt;
        &lt;span class="nl"&gt;onPageStarted:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"page start to be loaded (&lt;/span&gt;&lt;span class="si"&gt;$url&lt;/span&gt;&lt;span class="s"&gt;)."&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;

        &lt;span class="c1"&gt;// when the page is totally loaded&lt;/span&gt;
        &lt;span class="nl"&gt;onPageFinished:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"page loaded successfully (&lt;/span&gt;&lt;span class="si"&gt;$url&lt;/span&gt;&lt;span class="s"&gt;)."&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
          &lt;span class="n"&gt;showCookies&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt;

        &lt;span class="c1"&gt;// what to do in case of error&lt;/span&gt;
        &lt;span class="nl"&gt;onHttpError:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;HttpResponseError&lt;/span&gt; &lt;span class="n"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="p"&gt;},&lt;/span&gt; 

        &lt;span class="c1"&gt;// this callback is used to select what kind of request&lt;/span&gt;
        &lt;span class="c1"&gt;// is allowed (to which website).&lt;/span&gt;
        &lt;span class="nl"&gt;onNavigationRequest:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;NavigationRequest&lt;/span&gt; &lt;span class="n"&gt;request&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;NavigationDecision&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;navigate&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}))&lt;/span&gt;

    &lt;span class="c1"&gt;// when a new object is created, clear up the cache&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;clearCache&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="c1"&gt;// clear also the local storage&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;clearLocalStorage&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

    &lt;span class="c1"&gt;// and finally, load the requested url&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;loadRequest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this future object created, it is possible to include it in the flutter tree. To that, one can use a &lt;a href="https://pub.dev/documentation/webview_flutter/latest/webview_flutter/WebViewWidget-class.html" rel="noopener noreferrer"&gt;&lt;code&gt;WebViewWidget&lt;/code&gt;&lt;/a&gt; object, with the previous controller passed as argument.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="nd"&gt;@override&lt;/span&gt;
&lt;span class="n"&gt;Widget&lt;/span&gt; &lt;span class="nf"&gt;build&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BuildContext&lt;/span&gt; &lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;Scaffold&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nl"&gt;appBar:&lt;/span&gt; &lt;span class="n"&gt;AppBar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="nl"&gt;backgroundColor:&lt;/span&gt; 
        &lt;span class="n"&gt;Theme&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;of&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;colorScheme&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;inversePrimary&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nl"&gt;title:&lt;/span&gt; &lt;span class="n"&gt;Text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;widget&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="nl"&gt;body:&lt;/span&gt; &lt;span class="n"&gt;Center&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="nl"&gt;child:&lt;/span&gt; &lt;span class="n"&gt;Column&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nl"&gt;mainAxisAlignment:&lt;/span&gt; &lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;center&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nl"&gt;children:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
          &lt;span class="n"&gt;Container&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="nl"&gt;child:&lt;/span&gt; &lt;span class="n"&gt;Row&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nl"&gt;children:&lt;/span&gt; &lt;span class="p"&gt;[])&lt;/span&gt;
          &lt;span class="p"&gt;),&lt;/span&gt;
          &lt;span class="n"&gt;Expanded&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nl"&gt;child:&lt;/span&gt; &lt;span class="n"&gt;WebViewWidget&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nl"&gt;controller:&lt;/span&gt; &lt;span class="n"&gt;_controller&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;controller&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="n"&gt;_controller&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
          &lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="p"&gt;),&lt;/span&gt;
      &lt;span class="p"&gt;),&lt;/span&gt;
    &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Some variable states can eventually store the reference of the current controller, initialized in the &lt;a href="https://api.flutter.dev/flutter/widgets/State/initState.html" rel="noopener noreferrer"&gt;&lt;code&gt;initState()&lt;/code&gt;&lt;/a&gt; method. This code was defined inside a &lt;a href="https://api.flutter.dev/flutter/widgets/StatefulWidget-class.html" rel="noopener noreferrer"&gt;&lt;code&gt;StatefulWidget&lt;/code&gt;&lt;/a&gt; Widget.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="n"&gt;WebViewController&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;_controller&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nd"&gt;@override&lt;/span&gt;
&lt;span class="n"&gt;initState&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;initState&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="n"&gt;_controller&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;controller&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here the log output during the loading. Yeah, the &lt;code&gt;authenticationtest.com&lt;/code&gt; was used to retrieve some session cookies.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;I/flutter (19018): page start to be loaded (https://authenticationtest.com/simpleFormAuth/).
I/flutter (19018): loading in progress (20)...
I/flutter (19018): loading in progress (20)...
I/flutter (19018): loading in progress (29)...
I/flutter (19018): loading in progress (70)...
I/flutter (19018): loading in progress (87)...
I/flutter (19018): loading in progress (100)...
I/flutter (19018): loading in progress (100)...
I/flutter (19018): loading in progress (100)...
I/flutter (19018): page loaded successfully (https://authenticationtest.com/simpleFormAuth/)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The cookies from the &lt;code&gt;WebView&lt;/code&gt; can also be retrieved (and if needed stored in a local store). This can be achieved by created a new &lt;a href="https://pub.dev/documentation/webview_flutter/latest/webview_flutter/WebViewCookieManager-class.html" rel="noopener noreferrer"&gt;&lt;code&gt;WebViewCookieManager&lt;/code&gt;&lt;/a&gt; object. After having been successfully instantiated, the cookies can be exported using the &lt;a href="https://pub.dev/documentation/webview_flutter/latest/webview_flutter/WebViewCookieManager/getCookies.html" rel="noopener noreferrer"&gt;&lt;code&gt;getCookies()&lt;/code&gt;&lt;/a&gt; method.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="n"&gt;WebViewController&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;_controller&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nd"&gt;@override&lt;/span&gt;
&lt;span class="n"&gt;initState&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;initState&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="n"&gt;_controller&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;controller&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="n"&gt;_cookieManager&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;WebViewCookieManager&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;Future&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;showCookies&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="kd"&gt;async&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;currentUrl&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;_controller&lt;/span&gt;&lt;span class="o"&gt;?.&lt;/span&gt;&lt;span class="na"&gt;currentUrl&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="s"&gt;''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 
  &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="kt"&gt;Uri&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt; &lt;span class="n"&gt;domain&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;Uri&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;tryParse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;currentUrl&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;cookies&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;_cookieManager&lt;/span&gt;&lt;span class="o"&gt;?.&lt;/span&gt;&lt;span class="na"&gt;getCookies&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nl"&gt;domain:&lt;/span&gt; &lt;span class="n"&gt;domain&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cookies&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here the log output when some cookies have been received from the website. Those cookies are using the &lt;a href="https://pub.dev/documentation/webview_flutter/latest/webview_flutter/WebViewCookie-class.html" rel="noopener noreferrer"&gt;&lt;code&gt;WebViewCookie&lt;/code&gt;&lt;/a&gt; object, containing 4 fields, &lt;a href="https://pub.dev/documentation/webview_flutter/latest/webview_flutter/WebViewCookie/name.html" rel="noopener noreferrer"&gt;&lt;code&gt;name&lt;/code&gt;&lt;/a&gt;, &lt;a href="https://pub.dev/documentation/webview_flutter/latest/webview_flutter/WebViewCookie/value.html" rel="noopener noreferrer"&gt;&lt;code&gt;value&lt;/code&gt;&lt;/a&gt;, &lt;a href="https://pub.dev/documentation/webview_flutter/latest/webview_flutter/WebViewCookie/domain.html" rel="noopener noreferrer"&gt;&lt;code&gt;domain&lt;/code&gt;&lt;/a&gt; and &lt;a href="https://pub.dev/documentation/webview_flutter/latest/webview_flutter/WebViewCookie/path.html" rel="noopener noreferrer"&gt;&lt;code&gt;path&lt;/code&gt;&lt;/a&gt;. The other cookies attributes like &lt;code&gt;expires&lt;/code&gt; are not available on Android (but it seems they can be found on iOS).&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="go"&gt;I/flutter (19018): [WebViewCookie{name: PHPSESSID, value: 8035d936660419d25f1969de60945682, domain: https://authenticationtest.com/simpleFormAuth/, path: /}]
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here a screenshot of the &lt;code&gt;WebView&lt;/code&gt; from the Android emulator. Few buttons have been added to do tests, like extract the cookies and save same in a permanent store, or switch to another URL.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frbt24bgfuk8t8kqycuz7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frbt24bgfuk8t8kqycuz7.png" alt="WebView Flutter Screenshot from Android Application" width="800" height="1778"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;WebView&lt;/code&gt;&amp;nbsp;is a really interesting feature to bypass some website limitations, especially the one with public API only. Collecting those cookies can then be reused afterward. Some of you would probably ask why I was playing with this package. Well, I needed to fetch some cookies from another website (not the one used here for test), on one of my project. Having access to the cookies will help me to query my target when authenticated. Anyway, here some interesting links if you want to know more:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://pub.dev/packages/webview_flutter" rel="noopener noreferrer"&gt;&lt;code&gt;webview_flutter&lt;/code&gt; package&lt;/a&gt; from pub.dev;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;a href="https://pub.dev/documentation/webview_flutter/latest/" rel="noopener noreferrer"&gt;official &lt;code&gt;webview_flutter&lt;/code&gt;&amp;nbsp;API documentation&lt;/a&gt; on pub.dev;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;a href="https://github.com/flutter/packages/tree/main/packages/webview_flutter/webview_flutter" rel="noopener noreferrer"&gt;&lt;code&gt;webview_flutter&lt;/code&gt; source code&lt;/a&gt; from github;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;a href="https://developer.android.com/reference/android/webkit/WebView" rel="noopener noreferrer"&gt;official &lt;code&gt;WebView&lt;/code&gt; documentation&lt;/a&gt; from the Android developer website;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;a href="https://developer.apple.com/documentation/webkit/wkwebview" rel="noopener noreferrer"&gt;official &lt;code&gt;mkWebView&lt;/code&gt; documentation&lt;/a&gt; from the Apple developer website;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://curl.se/docs/http-cookies.html" rel="noopener noreferrer"&gt;cURL HTTP cookies documentation&lt;/a&gt; where the cURL cookies format is explained;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The &lt;a href="https://www.rfc-editor.org/info/rfc6265/" rel="noopener noreferrer"&gt;RFC6265&lt;/a&gt; where the &lt;code&gt;set-cookie&lt;/code&gt; is explained, containing also the official cookies attributes with their specifications;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/theotherdevs/starting-with-flutter-how-to-embed-a-webview-5g91"&gt;Starting with Flutter: How to embed a webview&lt;/a&gt; by &lt;a class="mentioned-user" href="https://dev.to/theotherdevs"&gt;@theotherdevs&lt;/a&gt;; &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/franciscodex/converting-any-website-into-an-app-flutter-webview-55i7"&gt;Converting any website into an app: Flutter webview&lt;/a&gt; by &lt;a class="mentioned-user" href="https://dev.to/franciscodex"&gt;@franciscodex&lt;/a&gt;; &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/__2ea5fee000c/not-just-a-webview-building-a-native-engine-on-flutter-to-convert-sites-to-apps-with-sdui-4j0e"&gt;Not Just a WebView: Building a Native Engine on Flutter to Convert Sites to Apps with SDUI&lt;/a&gt; by &lt;a class="mentioned-user" href="https://dev.to/__2ea5fee000c"&gt;@__2ea5fee000c&lt;/a&gt;; &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://dev.to/diamantidis/flutter-two-way-communication-between-a-webview-and-a-web-page-iji"&gt;Flutter: Two-way communication between a WebView and a web page&lt;/a&gt; by &lt;a class="mentioned-user" href="https://dev.to/diamantidis"&gt;@diamantidis&lt;/a&gt;; &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://stackoverflow.com/questions/80009751/is-there-a-way-to-show-more-cookies-fields-from-webview-flutters-webviewcookiem" rel="noopener noreferrer"&gt;Is there a way to show more cookies fields from webview_flutter's WebViewCookieManager&lt;/a&gt; on StackOverflow, where I asked a question regarding the extra cookies attributes.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As usual, have fun and happy hacking!&lt;/p&gt;




&lt;p&gt;The stackoverflow user who answered me on my question found a bug in the parser (I missed it), when a value is set to base64, it returns an empty string. In fact, while I was reading the code, I did not see any limits on the size of the key or the value. This should also be tested, a malicious server could eventually overflow an application with badly crafted cookies. This protected could be implemented on the &lt;code&gt;WebView&lt;/code&gt; (Kotlin) part though and not in the &lt;code&gt;flutter&lt;/code&gt; interface.&lt;/p&gt;

&lt;p&gt;Anyway, I will need a way to reproduce (at least) the following bug. Notes from &lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Set-Cookie" rel="noopener noreferrer"&gt;Mozilla documentation&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A &lt;code&gt;&amp;lt;cookie-name&amp;gt;&lt;/code&gt; can contain any US-ASCII characters except for control characters (ASCII characters 0 up to 31 and ASCII character 127) or separator characters (space, tab and the characters: &lt;code&gt;(&lt;/code&gt; &lt;code&gt;)&lt;/code&gt; &lt;code&gt;&amp;lt;&lt;/code&gt; &lt;code&gt;&amp;gt;&lt;/code&gt; &lt;code&gt;@&lt;/code&gt; &lt;code&gt;,&lt;/code&gt; &lt;code&gt;;&lt;/code&gt; &lt;code&gt;:&lt;/code&gt; &lt;code&gt;\&lt;/code&gt; &lt;code&gt;"&lt;/code&gt; &lt;code&gt;/&lt;/code&gt; &lt;code&gt;[&lt;/code&gt; &lt;code&gt;]&lt;/code&gt; &lt;code&gt;?&lt;/code&gt; &lt;code&gt;=&lt;/code&gt; &lt;code&gt;{&lt;/code&gt; &lt;code&gt;}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;A &lt;code&gt;&amp;lt;cookie-value&amp;gt;&lt;/code&gt; can optionally be wrapped in double quotes and include any US-ASCII character excluding control characters (ASCII characters 0 up to 31 and ASCII character 127), Whitespace, double quotes, commas, semicolons, and backslashes.&lt;/p&gt;

&lt;p&gt;Encoding: Many implementations perform percent-encoding on cookie values. However, this is not required by the RFC specification. The percent-encoding does help to satisfy the requirements of the characters allowed for &lt;code&gt;&amp;lt;cookie-value&amp;gt;&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
&lt;li&gt;set a cookie with a base64 value (e.g. &lt;code&gt;dGVzdAo=&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;fetch the cookie as &lt;code&gt;WebCookie&lt;/code&gt;, the value returned is &lt;code&gt;""&lt;/code&gt;" instead of &lt;code&gt;"dGVzdAo="&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This issue is due to the current implementation of the parser used in the &lt;a href="https://github.com/flutter/packages/blob/a1ed23c8f76035baa4edb2003d50349d07e7d6e0/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_cookie_manager.dart#L87" rel="noopener noreferrer"&gt;&lt;code&gt;AndrdoiWebViewCookieManager&lt;/code&gt;&lt;/a&gt; implementation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="s"&gt;'package:flutter/material.dart'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="s"&gt;'package:flutter_test/flutter_test.dart'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// code exfiltred from official sources&lt;/span&gt;
&lt;span class="n"&gt;poc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;cookies&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kd"&gt;dynamic&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;store&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt; 
  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="kt"&gt;String&lt;/span&gt; &lt;span class="n"&gt;cookie&lt;/span&gt; &lt;span class="k"&gt;in&lt;/span&gt; &lt;span class="n"&gt;cookies&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'; '&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="kt"&gt;List&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;String&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;cookieValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;cookie&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'='&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;add&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;cookieValue&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;first&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;cookieValue&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;last&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;store&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kt"&gt;void&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;test&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"poc"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;poc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"test=dGVzdAo"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="n"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;poc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"test=dGVzdAo"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"dGVzdAo"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

    &lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;poc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"test=dGVzdAo="&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="n"&gt;expect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;poc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"testdGVzdAo="&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"test"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"dGVzdAo="&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt; 
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight console"&gt;&lt;code&gt;&lt;span class="gp"&gt;$&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;flutter &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;span class="c"&gt;...
&lt;/span&gt;&lt;span class="go"&gt;00:00 +0: poc                                                                               
[(test, dGVzdAo)]
00:01 +0 -1: poc [E]                                                                        
&lt;/span&gt;&lt;span class="gp"&gt;  Expected: (String, String):&amp;lt;(test, dGVzdAo)&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="go"&gt;    Actual: [(String, String):(test, dGVzdAo)]

  package:matcher                                     expect
  package:flutter_test/src/widget_tester.dart 473:18  expect
&lt;/span&gt;&lt;span class="gp"&gt;  test/widget_test.dart 25:5                          main.&amp;lt;fn&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="c"&gt;...
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here a quick nginx configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight conf"&gt;&lt;code&gt;&lt;span class="n"&gt;events&lt;/span&gt; {
    &lt;span class="n"&gt;worker_connections&lt;/span&gt;   &lt;span class="m"&gt;2000&lt;/span&gt;;
}

&lt;span class="n"&gt;http&lt;/span&gt; {
  &lt;span class="n"&gt;server&lt;/span&gt; {
    &lt;span class="n"&gt;listen&lt;/span&gt; &lt;span class="m"&gt;4001&lt;/span&gt;;
    &lt;span class="n"&gt;add_header&lt;/span&gt; &lt;span class="n"&gt;Set&lt;/span&gt;-&lt;span class="n"&gt;Cookie&lt;/span&gt; &lt;span class="s2"&gt;"test=dGVzdAo=; Path=/"&lt;/span&gt;;
    &lt;span class="n"&gt;return&lt;/span&gt; &lt;span class="m"&gt;200&lt;/span&gt;;
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thanks to &lt;a href="https://stackoverflow.com/users/19418150/mahendra-dhakad" rel="noopener noreferrer"&gt;Mahendra Dhakad&lt;/a&gt;](&lt;a href="https://stackoverflow.com/a/80009898/6782635" rel="noopener noreferrer"&gt;https://stackoverflow.com/a/80009898/6782635&lt;/a&gt;) on stackoverflow.&lt;/p&gt;




&lt;p&gt;Cover Image by &lt;a href="https://unsplash.com/@pawelskor?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Paul Skorupskas&lt;/a&gt; on &lt;a href="https://unsplash.com/photos/person-holding-camera-lens-7KLa-xLbSXA?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText" rel="noopener noreferrer"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>webview</category>
      <category>android</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
