<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Piotr Włodarek on Medium]]></title>
        <description><![CDATA[Stories by Piotr Włodarek on Medium]]></description>
        <link>https://medium.com/@qertoip?source=rss-675d1215953a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*NA5jNBlTcqgVnh-f.jpg</url>
            <title>Stories by Piotr Włodarek on Medium</title>
            <link>https://medium.com/@qertoip?source=rss-675d1215953a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 18:58:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@qertoip/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Self-supervised learning is great for both AI and humans]]></title>
            <link>https://qertoip.medium.com/self-supervised-learning-is-great-for-both-ai-and-humans-8b3c926221d7?source=rss-675d1215953a------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b3c926221d7</guid>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[self-supervised-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Piotr Włodarek]]></dc:creator>
            <pubDate>Fri, 01 Sep 2023 07:24:52 GMT</pubDate>
            <atom:updated>2023-09-01T07:24:52.408Z</atom:updated>
            <content:encoded><![CDATA[<p>The self-supervised methods are “filling in the blank” approach where the model attempts to come up with a missing piece of information given the context (missing word in a sentence, missing image patch, etc).</p><p>The model’s answer is then compared to the original (which we must have) and the difference is the loss value to be minimized.</p><p>At scale, this allows models to build useful representations and extract semantics from data. Most modern deep neural networks are trained this self-supervised way before they are useful for the target upstream task.</p><p>What I realized is that <strong>humans learn best the same way!</strong> Do not simply read or listen. Instead, try to answer a tough question at hand to the best of your current ability (even when starting with a new topic — guess, find analogies etc).</p><p>Then compare your answer with the notes (ground truth), notice your mistakes and missing components of your answer. Then again attempt to perfectly answer the question on your own. Repeat.</p><p>It is the act of forcing ourselves to formulate a coherent answer that organizes representations of information in our mind. Mere focused reading or focused listening doesn’t come close.</p><p>The best way to learn is to iteratively re-create the knowledge and spot the gaps in understanding. By the way, this is why it’s often said that teaching is a great way to enhance our own understanding.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b3c926221d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Prefer G-mean over Accuracy as Classification Score]]></title>
            <link>https://qertoip.medium.com/prefer-g-mean-over-accuracy-as-classification-score-7cf772339e48?source=rss-675d1215953a------2</link>
            <guid isPermaLink="false">https://medium.com/p/7cf772339e48</guid>
            <category><![CDATA[classification-metrics]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Piotr Włodarek]]></dc:creator>
            <pubDate>Fri, 28 Jul 2023 10:01:38 GMT</pubDate>
            <atom:updated>2023-09-01T12:48:57.879Z</atom:updated>
            <content:encoded><![CDATA[<h3>Consider G-mean over Accuracy as Classification Score</h3><p>Deficiencies of accuracy score are well known. It is simple but often misleading metric. Accuracy answers the question how often a model is correct (say model is correct 82% of the time). But it fails to capture practical implications of class imbalance.</p><p>If you want to reliably capture classification performance in a single metric then consider using G-mean instead.</p><p>G-mean = (<strong>sensitivity</strong> * <strong>specificity</strong>)^1/2</p><p>It’s a square root of the product of sensitivity and specificity.</p><p>In a nice symmetrical way it captures both <em>sensitivity on positive class</em> and <em>sensitivity on negative class</em> while giving them <strong>equal weights</strong>, contrary to “global” accuracy. With accuracy the weights are somewhat incidental (equal to proportions of observations in the classes).</p><p>How to practically go about it? In case of scikit-learn you pass a custom scorer. Simple example in this <a href="https://stackoverflow.com/questions/66920782/how-to-integrate-g-mean-in-cross-validate-sklearn-function">StackOverflow thread</a>.</p><p>Another alternative to plain accuracy is balanced accuracy, this scorer is offered by scikit-learn out of the box.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7cf772339e48" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Clean Python: prefer dict() over {} for simple keys]]></title>
            <link>https://qertoip.medium.com/clean-python-prefer-dict-over-for-simple-keys-ecb9b7b886f7?source=rss-675d1215953a------2</link>
            <guid isPermaLink="false">https://medium.com/p/ecb9b7b886f7</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[http-request]]></category>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[python3]]></category>
            <dc:creator><![CDATA[Piotr Włodarek]]></dc:creator>
            <pubDate>Wed, 01 Jun 2022 07:17:11 GMT</pubDate>
            <atom:updated>2022-06-01T07:17:11.888Z</atom:updated>
            <content:encoded><![CDATA[<h3>TL;DR</h3><p>Prefer <strong>dict()</strong> over <strong>{}</strong> when keys are simple literals that are valid Python identifiers. With <strong>dict()</strong> we avoid noisy apostrophes around keys.</p><h3>Rationale</h3><p>Get less visual noise by avoiding repetitive apostrophes. This is especially beneficial when dealing with dictionaries where keys are naturally simple, like HTTP/URL params.</p><p>Consider which param list is easier to read:</p><p>params = {‘id’: 1234, ‘page’: 2, ‘limit’: 20, ‘v’: 0}</p><p>params = dict(id=1234, page=2, limit=20, v=0)</p><p>There is just <strong>fewer symbols involved</strong> and actual pairs are easier to grasp in the <strong>dict()</strong> version. Drop the apostrophes.</p><p>Additionally, specifically in the context of HTTP/URL params, the equal sign is more natural than colon because this is how they look in the wild.</p><p>Fall back to <strong>{}</strong> literal for any other keys like not-strings, uppercase strings, strings with whitespace, etc. Basically everything that is impossible to express or would look stupid in the dict() version.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ecb9b7b886f7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Clean Python: get rid of __init__.py]]></title>
            <link>https://qertoip.medium.com/clean-python-get-rid-of-init-py-9e62ae87424f?source=rss-675d1215953a------2</link>
            <guid isPermaLink="false">https://medium.com/p/9e62ae87424f</guid>
            <category><![CDATA[craftsmanship]]></category>
            <category><![CDATA[clean-code]]></category>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Piotr Włodarek]]></dc:creator>
            <pubDate>Tue, 31 May 2022 11:29:21 GMT</pubDate>
            <atom:updated>2022-05-31T11:29:21.853Z</atom:updated>
            <content:encoded><![CDATA[<h3>TL;DR</h3><p>Since Python 3.3 it is possible and practical to avoid __init__.py clatter and its implicit package initialization. Prefer the new<strong> namespace packages</strong> (no __init__.py) over <strong>regular packages</strong> (with __init__.py) where possible.</p><h3>Rationale</h3><p>The __init__.py was originally introduced to Python to explicitly mark directory as Python package. The intention was to avoid accidental override of Python builtin packages by random directories programmers may have in their projects (like maybe a “sys” or “os” directories). This is not a concern with new<strong> namespace packages</strong> because in case of conflict they have lesser priority and won’t override builtins.</p><p>The __init__.py marked packages (<strong>regular packages</strong>) are not deprecated and will continue to be fully supported. But it’s a good idea to clean up the code.</p><p>My first concern with __init__.py in each source directory is visual clutter. The sheer ugliness of it.</p><p>In practice, the more pressing problem is implicit and oftentimes surprising package initialization happening in __init__.py. No matter how long I code in Python, I still find myself puzzled by code hiding in these files, implicit timeline and order this code gets executed and unexpected side effects it causes. I prefer code to be called explicitly and predictably.</p><p>Are there any drawbacks to the new namespace packages? Not many. You can’t use the __name__ == “__main__” pattern but that was a bad idea anyway. Use tests to exercise your code instead. Some legacy development tools may rely on regular packages. For example, I had to add __init__.py aside pytest’s conftest.py files in sibling directories.</p><p>Summing up, Python significantly improved on its arguably biggest flaw, package/namespace system. Take advantage of this.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9e62ae87424f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to fix DNS issues when using Mullvad + Wireguard + NetworkManager on Linux?]]></title>
            <link>https://qertoip.medium.com/how-to-fix-dns-issues-when-using-mullvad-wireguard-networkmanager-on-linux-55fc14453a91?source=rss-675d1215953a------2</link>
            <guid isPermaLink="false">https://medium.com/p/55fc14453a91</guid>
            <dc:creator><![CDATA[Piotr Włodarek]]></dc:creator>
            <pubDate>Tue, 08 Jun 2021 08:43:34 GMT</pubDate>
            <atom:updated>2021-06-08T18:03:37.368Z</atom:updated>
            <content:encoded><![CDATA[<h3>Desired setup</h3><p>The desired setup is what we call “should just work”:</p><ul><li>We want to use official Mullvad Daemon and Mullvad GUI</li><li>Mullvad to <strong>auto-connect</strong> once Internet connection is established by NetworkManager</li><li>Mullvad to <strong>auto-reconnect</strong> when Internet connection changes (like, you moved to another WiFi) — roaming</li><li>Mullvad to use its own DNS servers when it is ON to not leak DNS queries</li><li>Mullvad to not break default DNS servers when it is OFF</li></ul><p>The primary issue is which piece of software, when and how modifies DNS servers via /etc/resolv.conf and/or resolvconf to not confuse other pieces.</p><p>After a long trial and error here is the setup that worked for me.</p><h3>Cleanup</h3><pre># Uninstall resolvconf providers if you have any:<br>pacman -Rs systemd-resolvconf openresolv</pre><pre># Uninstall local DNS servers if you have any:<br>pacman -Rs dnsmasq bind unbound</pre><pre># Mind stopping any local DNS servers still running</pre><h3>Use systemd-resolved DNS server</h3><p>The systemd-resolved is built-in part of systemd and does not require installation. It does require enabling though:</p><pre># Symlink /etc/resolv.conf properly<br>ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf</pre><pre># Enable and start systemd-resolved<br>systemctl enable systemd-resolved<br>systemctl start systemd-resolved</pre><h3>Configure NetworkManager</h3><p>Make it use systemd-resolved DNS server:</p><pre># /etc/NetworkManager/conf.d/dns.conf</pre><pre>[main]<br>dns=systemd-resolved</pre><p>Make sure it does <strong>not</strong> use resolvconf :</p><pre># /etc/NetworkManager/conf.d/rc-manager.conf</pre><pre># These must be commented out:<br>#[main]<br>#rc-manager=resolvconf</pre><h3>Restart everything</h3><pre>systemctl stop mullvad-daemon</pre><pre>systemctl restart systemd-resolved<br>systemctl restart NetworkManager</pre><pre>systemctl enable mullvad-daemon<br>systemctl start mullvad-daemon</pre><p>Hopefully, all should work just fine now!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=55fc14453a91" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[You will randomly lose access to your DigitalOcean account]]></title>
            <link>https://qertoip.medium.com/you-will-randomly-lose-access-to-your-digitalocean-account-2fb7b4d799b5?source=rss-675d1215953a------2</link>
            <guid isPermaLink="false">https://medium.com/p/2fb7b4d799b5</guid>
            <category><![CDATA[digitalocean]]></category>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[2fa]]></category>
            <category><![CDATA[hosting]]></category>
            <category><![CDATA[rant]]></category>
            <dc:creator><![CDATA[Piotr Włodarek]]></dc:creator>
            <pubDate>Mon, 05 Apr 2021 09:37:58 GMT</pubDate>
            <atom:updated>2021-04-05T09:44:14.493Z</atom:updated>
            <content:encoded><![CDATA[<p>The <strong>verification code</strong> just won’t come to my email. Being locked out of my DigitalOcean account I wasted many hours of my life with pointless trial and error.</p><p>Yes, my mailbox is working perfectly fine. In fact I <strong>do</strong> receive <strong>other</strong> DigitalOcean e-mails.</p><p>Yes, I verified spam million times, as well as other folders.</p><p>No, I don’t have custom filters silently removing verification codes.</p><p>Yes, my MX DNS record is correct. Again, all e-mails arrive fine, except DO verification codes.</p><p>I’ve been using email for 24 years, and yes, I can receive email proficiently.</p><p>As it turned out:</p><p><em>“We temporarily blacklisted your email address so our system wouldn’t keep sending more emails to you”</em> <strong>Wait, WAT?</strong> They explain further: <em>“It looks like your email service provider has bounced emails from our email address </em><a href="/service/mailto:support@support.digitalocean.com"><em>support@support.digitalocean.com</em></a><em> that sends account and billing notifications.”</em></p><p>Well, this specific email I had with Google, so it’s not like a niche email provider issue. Also, I’ve been a paying client for about two years (this account alone / no billing issues) while hosting the most boring stuff like git repositories, a few static websites and an open source service.</p><p>The most infuriating thing is there was <strong>no error message at all</strong> during the sign-in process. Should they pop up “we blacklisted your email because we felt like it, please contact support” I wouldn’t have lost hours debugging the shit.</p><p>Another issue is, <strong>DigitalOcean does not support any proper 2FA</strong>. You can pick from a joke-2FA based on SMS and half-joke 2FA based on a shared secret. No modern WebAuthn/U2F could be configured, which says tons about general company stance on security.</p><p>Finally, a less relevant issue is, there is no good way to opt-out of this “verification code”. It’s forced on the user every single time if user browser is amnestic (which it should be).</p><p>Ultimately the issue was resolved by contacting support and manual removal of my email from a blacklist.</p><p>I am now closing my DigitalOcean account as I can’t risk randomly losing control over my infrastructure.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2fb7b4d799b5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[BitBox2 is underrated: a review]]></title>
            <link>https://qertoip.medium.com/bitbox2-is-underrated-a-review-f39be9816f7c?source=rss-675d1215953a------2</link>
            <guid isPermaLink="false">https://medium.com/p/f39be9816f7c</guid>
            <category><![CDATA[cypherpunk]]></category>
            <category><![CDATA[hodl]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[hardware-wallet]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Piotr Włodarek]]></dc:creator>
            <pubDate>Sat, 05 Dec 2020 13:38:37 GMT</pubDate>
            <atom:updated>2020-12-28T15:15:10.802Z</atom:updated>
            <content:encoded><![CDATA[<h3>BitBox02 Review</h3><p><em>This article is </em><strong><em>not sponsored</em></strong><em> and contains </em><strong><em>no referral links</em></strong><em> to any products. I acquired all mentioned hardware wallets at my own cost.</em></p><p><strong>TL;DR: BitBox02 is a quality and well balanced hardware wallet good for general public and small-to-medium funds. There are some controversial design choices. Power users will still prefer Coldcard MK3.</strong></p><h3>What I find nice</h3><ul><li>Similar to Coldcard, BitBox02 employs the “best of both worlds” approach to open-source vs secure-element and packages it into a less scary (but less powerful) UX.</li><li>BitBox App (desktop/mobile) is exemplary with respect to security copywriting and security usability. It carefully onboards and teaches a newbie user on key principles along the way. Accompanying online docs are also very clear. The whole App feels like quality engineering.</li><li>BitBox App has full node support, Tor proxy support, Bech32 by default, and even basic coin control. Glad to see <a href="https://shiftcrypto.ch/">Shift Crypto</a> is serious about Bitcoin best practices. However, after initial setup I recommend using a proper, established wallet.</li><li>Encrypted device-to-wallet communication with reliable pairing.</li><li>Website and checkout process are Tor Browser compatible. Payment gets recognized immediately.</li><li>Appealing, premium packaging.</li><li>The microSD card is included (SanDisk 8GB) as well as thick USB cable and *two* USB A/C adapters.</li><li>Convenience random number generator (256 bits displayed as hexadecimal string). I will probably never use it but cool anyway :)</li></ul><h3>What I find troubling</h3><ul><li>Unclear how am I supposed to HODL the BitBox device in my hand. The long edges are all active with invisible touch buttons. Whether on cable or plugged in the laptop, there is no firm way to hold and operate it.</li><li>The default microSD backup will end badly for some users. Electronics fragility aside, the tiny-tiny microSD is simply too easy to get lost. Thanks to “no paper” the setup is quick, convenient and refreshing. But it does feel like cheating. One idea would be to add a beautifully branded case for the microSD card. This way it is at least less likely to get lost. BitBox02 does support classic paper backup but the default microSD backup is what 90%+ users will follow. If you have BitBox02, I strongly recommend going the classic way with recovery words backed up on paper or in steel.</li><li>Anonymous delivery is significantly hindered. Firstly, UPS does not deliver to PO Box (human recipient required) and it is the only option. Secondly, the package won’t fit the common/standard PO Box as it is too large. Counter-intuitively, Coldcard/Trezor/Ledger cheap packaging schemes are advantageous here.</li><li>Anti-tampering bag is not unique per device (it has no unique number). At least it is specific to Shift Crypto (has Shift logotypes on the edges). There are plans to improve on that.</li><li>Device setup requires official “BitBox App” (desktop or mobile). While the app is beneficial for newbie users, power users would prefer to not install another potentially compromised piece of cryptocurrency software. Ideally, the setup step should not require a computer at all.</li><li>The swipe gesture isn’t really a swipe you know from smartphones. It’s more like a drag but one can quickly adjust the habits. No big deal.</li><li>When reviewing transaction on device you cannot go back to address verification. You can only “scroll further” or decline and start over. Annoying.</li></ul><p>Issues aside, <a href="https://shiftcrypto.ch/bitbox02/">BitBox02</a> impressed me as modern and well thought out hardware wallet. Refreshing balance of <a href="https://en.bitcoin.it/wiki/Main_Page">Bitcoin</a> principles, security and usability. Just be sure to backup recovery words on paper. Do not rely solely on microSD.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f39be9816f7c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DeFi is a decentralization theater but there is still merit to it]]></title>
            <link>https://qertoip.medium.com/defi-is-a-decentralization-theater-but-there-is-still-merit-to-it-24642e0a705b?source=rss-675d1215953a------2</link>
            <guid isPermaLink="false">https://medium.com/p/24642e0a705b</guid>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[defi]]></category>
            <dc:creator><![CDATA[Piotr Włodarek]]></dc:creator>
            <pubDate>Tue, 25 Aug 2020 09:06:11 GMT</pubDate>
            <atom:updated>2020-08-25T09:06:11.189Z</atom:updated>
            <content:encoded><![CDATA[<p>It’s pretty well established DeFi is actually CeFi — centralized finance — as ultimately there are always some actors running the show from behind the curtains, at least in the Ethereum smart contracts world. There is tons of counter party risks involved.</p><p>However, decentralization is just means to an end. The end goal is uncensored, parallel financial system resistant to regulations and tyranny of the state.</p><p>Surprisingly, on that front DeFi is actually delivering some value. Instead of comprehensive decentralization, DeFi employs layered obfuscation.</p><p>DeFi goes well beyond usual “blockchain” obfuscation layer. A web of cooperating smart contracts is a new level of conceptual barrier for state clerks and LE to tackle.</p><p>Is obfuscation-based regulatory resistance sustainable in the long run? Probably not, but current DeFi buys time to develop more resilient solutions.</p><p>Meanwhile you can enjoy the thrill of anonymous participation in uncensored, experimental financial services. As you would expect, in such a world, most offerings are scams. It is your personal responsibility to navigate this — as it should be.</p><p>Soon, you will notice gems of non-scam and potentially useful services.</p><p>To name one example, efficient anonymous p2c exchanges are on the rise. These exchanges go one step further than peer-to-peer exchanges: they operate in a peer-to-contract model. You are effectively trading against a robotic contract. The contract is a highly autonomous entity pre-programmed to trade with anonymous users on one hand and paying anonymous liquidity providers on the other side.</p><p>The main limitation of these exchange tools is that you cannot trade arbitrary cryptocurrencies like Bitcoin or Monero. You cannot trade against real USD either. You can only trade standardized Ethereum tokens. Anything else like Bitcoin or USD only exist in this ecosystem as IOU-s of actual assets (wrapped BTC, stablecoin USD, etc). But that is a story for another time.</p><p>In summary DeFi is ultra complex phenomenon. While far from “decentralized” and while riddled with scams it does have a merit and does further the grand goal of apolitical, parallel financial infrastructure you cannot be “cancelled” from.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=24642e0a705b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ledger + Electrum error  “Failed to create a client for this device.]]></title>
            <link>https://qertoip.medium.com/ledger-electrum-error-failed-to-create-a-client-for-this-device-555a16b86fe8?source=rss-675d1215953a------2</link>
            <guid isPermaLink="false">https://medium.com/p/555a16b86fe8</guid>
            <category><![CDATA[ledger]]></category>
            <category><![CDATA[electrum]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[ledger-nano-s]]></category>
            <dc:creator><![CDATA[Piotr Włodarek]]></dc:creator>
            <pubDate>Wed, 22 May 2019 06:59:15 GMT</pubDate>
            <atom:updated>2019-05-22T06:59:15.210Z</atom:updated>
            <content:encoded><![CDATA[<h3>Electrum Ledger error “Failed to create a client for this device. Make sure it is in the correct state”</h3><p>A pro-tip regarding connecting Ledger Nano S to your Electrum desktop wallet.</p><p>If you face the following error:</p><blockquote>Failed to create a client for this device. Make sure it is in the correct state.</blockquote><blockquote>error getting device info</blockquote><blockquote>open failed</blockquote><p>Remember that you need to:</p><ol><li>Close Electrum wallet</li><li>Run Ledger Live</li><li><strong>Install the Bitcoin app</strong> via Ledger Live</li><li><strong>Start the Bitcoin app on the Ledger</strong> — the Ledger should display “Use wallet to view accounts”</li><li>Close Ledger Live</li><li>Only then run your Electrum wallet and pick hardware device</li></ol><p>Hope this helps!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=555a16b86fe8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pragmatic Cypherpunk’s Personal Backup]]></title>
            <link>https://qertoip.medium.com/pragmatic-cypherpunks-personal-backup-d47425453a06?source=rss-675d1215953a------2</link>
            <guid isPermaLink="false">https://medium.com/p/d47425453a06</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[backup]]></category>
            <category><![CDATA[cypherpunk]]></category>
            <category><![CDATA[privacy]]></category>
            <dc:creator><![CDATA[Piotr Włodarek]]></dc:creator>
            <pubDate>Mon, 18 Feb 2019 14:34:51 GMT</pubDate>
            <atom:updated>2019-02-18T14:34:51.967Z</atom:updated>
            <content:encoded><![CDATA[<p>The hardest thing about backups is not preventing data loss but preventing data leakage, either by accident or by targeted attack.</p><h3>Requirements</h3><p>Here are my personal requirements for a backup solution:</p><ul><li><strong>Locally encrypted</strong>. Solution must natively support modern authenticated encryption. Files metadata must also be encrypted. Archive structure must ensure it is not possible to reason about existence of specific files in a backup (for example, based on size proximity).</li><li><strong>Offsite</strong>. Backing up to external HDD or NAS is a no-go. That wouldn’t protect from malware, theft, fire or confiscation by LE. Backups must be sent off site to a reputable and “privacy sensitive” storage.</li><li><strong>Fully automated</strong>. Any requirement for human action makes solution unrealistic — backups would be postponed and eventually abandoned if they add any friction to the otherwise happy day.</li><li><strong>Open source</strong>. This is critical to facilitate auditing, including reviewing cryptography soundness.</li><li><strong>Linux native.</strong></li><li><strong>Incremental.</strong> It must be very efficient transfer-wise and storage-wise. Low transfer requirements are important because of home internet limited uplink. Low storage requirements are important because cloud storage is expensive and the intention here is to keep a large number of snapshots.</li><li><strong>Historical snapshots. </strong>The snapshots must be available and easy to manage and prune. It should be possible to recover individual files from many months ago.</li><li><strong>Root filesystem compatible</strong>. Solution must support backing up the whole root filesystem (excluding devices, external file systems, and other irrelevant pieces).</li></ul><h3>Backups as Attack Vector</h3><p>Unfortunately, backups are very hard to setup in a safe and privacy preserving way.</p><p>The only thing worse than losing your data is leaking your data. Imagine your password manager database, PGP keys, SSH keys, cryptocurrency wallets, 15 years of Thunderbird email history, all leaked through backups.</p><p>In case of average Joe that would be his browser history and porn habits that redefine him as a person (and unlikely for the better).</p><h4>Accidental backups leakage</h4><p>Example 1: local HDD/NAS backups got confiscated by LE or stolen. One have not employed encryption because, well, the backups were supposed to be stored safely at one’s apartment.</p><p>Example 2: same as above + user employed “strong encryption”. Unfortunately, his password is trivial to brute force against the leaked password databases. But even w/o brute forcing the password, user encrypted files but forgot about metadata, thus allowing attackers to easily correlate with known content. Finally, user randomly picked popular AES-CBC, having no idea that this effectively decreases content resolution, making his porn content trivial to understand.</p><p>Example 3: user picked popular commercial-grade solution like Crashplan, Acronis or Carbonite. However, user went with the default or easiest path and have not configured local encryption. All her data leaked to the cloud and are impossible to delete reliable. Hundreds of current and future employees can access the data.</p><p>Example 4: same as above + user turned on “strong encryption” in the software. User couldn’t make much mistakes because all complexity is handled by the software. Some years down the road it turned out the software encryption <strong>implementation</strong> was severely flawed — as it is most often the case(!). All users data is freely available in the cloud. The software was never really openly audited because it is proprietary.</p><h4>Government surveillance</h4><p>The “unlikely” event where a government kindly asks Crashplan/Acronis/Carbonite to introduce a subtle flaw via its software updates mechanism either for all or for specific users. The flaw may simply send the local encryption key to company’s servers as part of the backup.</p><p>Make no mistake: these companies state explicitly in their ToS they will share your data with government when required by law. They also don’t offer a warrant canary!</p><h3>The Solution: Borg Backup + Borg Helper + Rsync.net</h3><p><a href="https://www.borgbackup.org/"><strong>Borg Backup</strong></a> is a proven, mature and reliable <strong>open source</strong> software for making backups. It is Linux-first and ticks all check-boxes by offering local authenticated encryption, advanced de-duplication, compression, efficient remote backups, snapshots, auto-pruning, smart exclusions, etc.</p><p>Borg developers appear to understand intricacies of modern encryption and typical pitfalls. They committed a whole comprehensive chapter of documentation for <a href="https://borgbackup.readthedocs.io/en/stable/internals/security.html?highlight=aes">potential attack vectors and implemented mitigations</a>.</p><p>I did a quick peek at the code and found no obvious problems with the encryption, although I am nowhere close to a cryptographer, and review was nowhere close to exhaustive:</p><ul><li>it relies on AES-256 implementation from OpenSSL because AES is <a href="https://docs.python.org/3/library/crypto.html">not present</a> in Python standard library; borg authors apparently did not want to use external modules like pycrypto; this looks like a good conservative choice; borg statically links to OpenSSL’s libcrypto</li><li>CTR mode of operation; for CTR the requirement for nonce is to never repeat for the same secret key; borg implements this via NonceManager which stores used nonces both locally and in the remote repository</li><li>it uses recommended encrypt-then-MAC approach with either SHA256 or Blake2 (up to the user)</li><li>the SHA256 is from Python standard library (hashlib); Blake2 is the reference C implementation by one of Blake2 authors Samuel Neves</li><li>the MAC is calculated over aad + iv + ciphertext which is what one would expect</li></ul><p>Summing up, borg appears to take privacy very seriously.</p><p>Borg is super flexible but it does not cover “the last mile” some users would expect — things like periodic running, default opinionated setup, and desktop notifications integration. This last mile is covered by the <a href="https://github.com/qertoip/borg-helper/">Borg Helper</a>.</p><p><a href="https://github.com/qertoip/borg-helper/"><strong>Borg Helper</strong></a> is born out of my own research, choices and setup. It is a thin convenience layer over Borg. It adds periodic running and verification via systemd timers. It also offers opinionated borg configuration for pragmatic remote backups with focus on security and efficiency. It is a handful of short scripts that you can easily audit and modify to your needs:</p><p><a href="https://github.com/qertoip/borg-helper">https://github.com/qertoip/borg-helper</a></p><p>We still need a remote storage for our backups with server-side support for Borg.</p><p><a href="https://www.rsync.net/products/attic.html"><strong>Rsync.net</strong></a> is a very interesting choice. It seems very conservative regarding security and privacy, runs on FreeBSD and offers a weekly warrant canary.</p><p>The price is also reasonable with $0.02 per GB per month. Rsync.net proved reliable and fast in my experience.</p><p>The big minus is that one cannot use <a href="https://getmonero.org/">Monero</a> to pay for rsync.net anonymously to decouple data from identity.</p><p>All in all though, rsync.net seems the most secure among popular borg-servers.</p><h3>Remaining Issues</h3><p>No setup is perfect. Some remaining issues to be aware of (many of them not specific to borg):</p><p><strong>Must backup your decryption key separately</strong>. The root partition backup is as complete as one could get. But to unlock the backup you need AES-256 secret key. This key should be kept in your password manager. You must back it up independently of your borg backup. One way to do it is to store encrypted PM database in a bank safe deposit box and/or in your wallet. Of course this is not specific to borg — it’s common to any encrypted backup solution — you need to store decryption key <em>somewhere</em>.</p><p><strong>Borg is a SPOF</strong> in terms of security — as many other components in your system, BTW. Borg is assumed trusted software that is ran as root to backup the root partition. Should borg ever be compromised the whole scheme breaks. The only mitigations are 1) Borg is open source and quite popular 2) Borg is officially packaged and packages are signed (at least on Arch Linux).</p><p><strong>Above filesystem backups are inherently inconsistent</strong>. As with any above-the-filesystem backup solution, backups can not be guaranteed to be consistent. This is because backup event is not a point in time, but rather a process carried on while underlying files are potentially modified. In practice, this is most evident with VM images if VM is running while its drive is being backed up. The only definitive solution would be to use filesystem snapshotting feature to create a point-in-time version of reality. Unfortunately, ZFS support for Linux is still far from stellar. There are also other trade-offs to the below-the-filesystem backup approach. The workaround is to have more frequent backups — very often the previous snapshot will have the data in question in a consistent state (unless you run your VM-s or DBs 24/7 on desktop).</p><p><strong>Won’t protect against targeted malware</strong>. This setup is <strong>safe</strong> against generic malware that — for example — encrypts all network drives to demand <a href="https://bitcoin.org/">Bitcoin</a>. The borg repository is not a network drive; it’s a custom protocol over SSH. However, should the malware be written specifically to access resources over SSH, the backup could still be removed or re-encrypted by malware. The mitigation would be to further copy (not sync!) the repository to non-SSH cloud storage — but that is increasing complexity and costs — so I selected to accept the trade offs as they are.</p><p><strong>Rsync.net</strong> is assumed semi-trusted. The setup also relies on rsync.net to be available and not remove the data. The setup also relies on rsync.net to never reveal the data as a second layer of privacy on top of encryption (because the encryption could be potentially broken).</p><h3>Conclusion</h3><p>Backups are hard. Privacy preserving backups are even harder.</p><p>This article presents a complete and ready to use recipe for privacy preserving personal backups on Linux: Borg + Borg Helper + Rsync.net.</p><p>Author is not affiliated with Rsync.net and links are not referral.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d47425453a06" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>