<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>encryption &amp;mdash; progressiv.dev blog</title>
    <link>https://blog.progressiv.dev/suguru/tag:encryption</link>
    <description></description>
    <pubDate>Tue, 28 Apr 2026 21:19:31 +0000</pubDate>
    <item>
      <title>Encrypt data anywhere, decrypt data with your hardware key</title>
      <link>https://blog.progressiv.dev/suguru/encrypt-data-anywhere-decrypt-data-with-your-hardware-key</link>
      <description>&lt;![CDATA[One of the merits of encrypting your data with OpenPGP using a Yubikey is that the private key to decrypt data is stored offline on the hardware and it will not be hacked online.&#xA;&#xA;!--more--&#xA;&#xA;Even if your Yubikey is stolen physically, the data should not be decrypted, since the key is protected with a PIN code and it will be unusable if incorrect PIN is entered more than three times. This case the hardware needs to be reset, which results in the removal of the private key from it. So it is important to change the default PIN and back up the private key somewhere safe.&#xA;&#xA;Also, once you register your public key associated with the private key to a keyserver like https://keys.openpgp.org/, you can download it anywhere you want and encrypt data, keeping the private key on your hand. Private key is required only when you decrypt the data.&#xA;&#xA;OpenPGP + Yubikey -  data encryption unhackable yet&#xA;&#xA;It is unfortunate that the whole #OpenPGP ecosystem is centered on communication tools such as email or chat clients, since those applications are either slowly deprecated or implementing another #encryption protocol. But OpenPGP can be used generally to protect your data from being read by someone.&#xA;&#xA;For example, you can install your public key to a remote server and encrypt data with it online, so that actual server owners cannot read, sell, or hand it over to someone else for whatever reason (technically they may do so but the data is encrypted, so they can do nothing but making an educated guess about its content at best). It is also possible to encrypt data on Android thanks to OpenKeychain. Prepare yourself beforehand in case you lose your phone. Unless encrypted, data is available to someone who gains the physical access to it.&#xA;&#xA;Encrypt your data with your public key and decrypt it when you need to do so, using a physical key such as Yubikey. Only you who have the hardware can decrypt the data. If you do not need an access to the data, destroy the hardware and nobody should be able to decrypt it unless the encryption protocol would be deprecated eventually.&#xA;&#xA;Thanks to the developers community OpenPGP implementation is universally available, and its concept of encryption has not been breached yet. If you are worried about privacy of your data, go ahead and protect data by yourself. You are not forced to trust anyone.&#xA;&#xA;p class=&#34;p--img&#34;span class=&#34;p--img__span&#34;img src=&#34;/img/upload/YubiKey-4-keychain-and-YubiKey-4-Nano.png&#34; alt=&#34;YubiKey 4 keychain and YubiKey 4 Nano&#34; //span/p&#xA;&#xA;p class=&#34;p--detail&#34;a href=&#34;https://commons.wikimedia.org/wiki/File:YubiKey-4-keychain-and-YubiKey-4-Nano.png&#34;Yubico/a, a href=&#34;https://creativecommons.org/licenses/by-sa/4.0&#34;CC BY-SA 4.0/a, via Wikimedia Commons/p]]&gt;</description>
      <content:encoded><![CDATA[<p>One of the merits of encrypting your data with <a href="https://support.yubico.com/hc/en-us/articles/360013790259-Using-Your-YubiKey-with-OpenPGP" rel="nofollow">OpenPGP using a Yubikey</a> is that the private key to decrypt data is stored <strong>offline</strong> on the hardware and it will not be hacked online.</p>



<p>Even if your Yubikey is stolen physically, the data should not be decrypted, since the key is protected with a PIN code and it will be unusable if incorrect PIN is entered more than three times. This case the hardware needs to be reset, which results in the removal of the private key from it. So it is important to change the default PIN and back up the private key somewhere safe.</p>

<p>Also, once you register your public key associated with the private key to a keyserver like <a href="https://keys.openpgp.org/" rel="nofollow">https://keys.openpgp.org/</a>, you can download it anywhere you want and encrypt data, keeping the private key on your hand. Private key is required <em>only</em> when you decrypt the data.</p>

<h2 id="openpgp-yubikey-data-encryption-unhackable-yet">OpenPGP + Yubikey –&gt; data encryption unhackable yet</h2>

<p>It is unfortunate that the whole <a href="/suguru/tag:OpenPGP" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">OpenPGP</span></a> ecosystem is centered on communication tools such as <a href="https://blog.thunderbird.net/2020/09/openpgp-in-thunderbird-78/" rel="nofollow">email</a> or <a href="https://conversations.im/" rel="nofollow">chat</a> clients, since those applications are either slowly deprecated or implementing another <a href="/suguru/tag:encryption" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">encryption</span></a> protocol. But OpenPGP can be used generally to protect your data from being read by someone.</p>

<p>For example, you can install your public key to a remote server and encrypt data with it online, so that actual server owners cannot read, sell, or hand it over to someone else for whatever reason (technically they may do so but the data is encrypted, so they can do nothing but making an educated guess about its content at best). It is also possible to encrypt data on Android thanks to <a href="https://www.openkeychain.org/" rel="nofollow">OpenKeychain</a>. Prepare yourself beforehand in case you lose your phone. Unless encrypted, data is available to someone who gains the physical access to it.</p>

<p>Encrypt your data with your public key and decrypt it when you need to do so, using a physical key such as Yubikey. <strong>Only you who have the hardware can decrypt the data.</strong> If you do not need an access to the data, destroy the hardware and nobody should be able to decrypt it unless the encryption protocol would be deprecated eventually.</p>

<p>Thanks to the developers community OpenPGP implementation is universally available, and its concept of encryption has not been breached <em>yet</em>. If you are worried about privacy of your data, go ahead and protect data by yourself. You are not forced to trust anyone.</p>

<p class="p--img"><span class="p--img__span"><img src="/img/upload/YubiKey-4-keychain-and-YubiKey-4-Nano.png" alt="YubiKey 4 keychain and YubiKey 4 Nano"/></span></p>

<p class="p--detail"><a href="https://commons.wikimedia.org/wiki/File:YubiKey-4-keychain-and-YubiKey-4-Nano.png" rel="nofollow">Yubico</a>, <a href="https://creativecommons.org/licenses/by-sa/4.0" rel="nofollow">CC BY-SA 4.0</a>, via Wikimedia Commons</p>
]]></content:encoded>
      <guid>https://blog.progressiv.dev/suguru/encrypt-data-anywhere-decrypt-data-with-your-hardware-key</guid>
      <pubDate>Tue, 22 Jun 2021 06:33:28 +0000</pubDate>
    </item>
    <item>
      <title>Syncthing: decentralized file sync software</title>
      <link>https://blog.progressiv.dev/suguru/syncthing-decentralized-file-sync-software</link>
      <description>&lt;![CDATA[When it comes to file synchronization, there are several choices based on free software:&#xA;&#xA;Set up Nextcloud or Cryptpad instance by yourself: file synchronization service on-premise.&#xA;Run Syncthing on your devices: continuous file synchronization, which is completely decentralized.&#xA;&#xA;!--more--&#xA;&#xA;I have tried both and I preferred the latter for personal use. Nextcloud is obviously a great way of sharing files with your friends. It enables you to collaborate with them and work on the same project at the same time. However, setting up a service on a central server, which is often physically out of your hand, is a little bit overkill for personal use. As long as you synchronize your files among your own devices you would not need the server, which can be a single point of failure (data can be lost if it fails).&#xA;&#xA;On the other hand, #Syncthing does not require a central server at all. By default it transmits data only among your devices. For example, you can set up Syncthing on your desktop, laptop, and smartphone. If they are connected with LAN data can be synchronized locally, and it is not sent outside of it. You can decide by yourself where to store your data, and there is not a single point of failure.&#xA;&#xA;Syncthing is available on not only Windows, macOS, Android, and iOS but also GNU/Linux distributions and FreeBSD. This level of availability cannot be expected from proprietary software, of course.&#xA;&#xA;Encrypt private data&#xA;&#xA;If you synchronize private data such as recovery passphrase of your online accounts I highly recommend you to encrypt them beforehand to make sure that nobody but you can read the data.&#xA;&#xA;From the perspective of versatility you may use GnuPG for data #encryption. As long as the private key is kept safely, practically there is almost zero chance for other people to read data, even if you lost your device and someone got an access to the encrypted files.&#xA;&#xA;After you create the key pair you can upload the public key to a distribution service such as https://keys.openpgp.org/. Once you have the public key, you can encrypt the file without the private key. It will not be required until you decrypt the file to read it.&#xA;&#xA;In order to keep the private key secure, you can store it on Yubikey, following the official guide available here. Because the private key is stored on the hardware key, it cannot be hacked online.&#xA;&#xA;Create a backup on Storj DCS with rclone&#xA;&#xA;Syncthing provides you a function to store file history, but data loss can happen for whatever reason. You may set it up in a wrong way or there may be a bug on Syncthing. If your devices were broken from a natural disaster like flood, your data would be lost forever, so you should always prepare backup in case.&#xA;&#xA;Following the golden rule of data backup, it should be outside of your Syncthing ecosystem. This means that it should be available online, meaning it comes to full circle: storing data online, outside of the local area network.&#xA;&#xA;The backup itself should also be encrypted and decentralized. For if the backup data was available to someone, what is the point of setting up decentralized file synchronization among your devices in the first place?&#xA;&#xA;For backup solution I would pick up Storj DCS this case as well. #Storj DCS, renamed from #Tardigrade recently, provides an encrypted and decentralized cloud storage. I have covered the service on this site multiple times such as here.&#xA;&#xA;To synchronize local data with cloud storage services, rclone is one of the popular choices. After installing, you can configure it for Storj DCS. &#xA;&#xA;For daily use you can run a .sh script like this:&#xA;&#xA;!/bin/sh&#xA;rclone sync -i --progress /home/local/directory/ remote:bucket/path/to/dir/ --exclude=&#34;.stversions/&#34;&#xA;&#xA;Running that script synchronizes the source to the destination, changing the destination only, deleting any excess files. Folders inside .stversions store versioning files, which Syncthing on each computer saves for itself, so they should only stay local and be excluded from synchronization between Storj DCS.&#xA;&#xA;Since the command can cause data loss, test with --dry-run flag at first to see exactly what would be copied and deleted.&#xA;&#xA;Warning: you are not supposed to upload a huge number of files as the fee is calculated not only how large files are, but also how much files are uploaded! You should read ToS carefully before using the service. &#xA;&#xA;Restore backup&#xA;&#xA;If data loss or conflicts happen locally, you may recover the latest state from backup with this command:&#xA;&#xA;!/bin/sh&#xA;rclone sync -i --progress remote:bucket/path/to/dir/ /home/local/directory/ --exclude=&#34;.stversions/&#34;&#xA;&#xA;It downloads data from Storj DCS, changing the local directories only, deleting any excess files. Test with --dry-run in this case as well.&#xA;&#xA;Copyright (C) 2021 Suguru Hirahara. This work is available under GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation. See https://blog.progressiv.dev/yq31akw3jj for copying conditions.]]&gt;</description>
      <content:encoded><![CDATA[<p>When it comes to file synchronization, there are several choices based on free software:</p>
<ul><li>Set up <a href="https://nextcloud.com/" rel="nofollow">Nextcloud</a> or <a href="https://cryptpad.fr" rel="nofollow">Cryptpad</a> instance by yourself: file synchronization service on-premise.</li>
<li>Run <a href="https://syncthing.net/" rel="nofollow">Syncthing</a> on your devices: continuous file synchronization, which is completely decentralized.</li></ul>



<p>I have tried both and I preferred the latter for personal use. Nextcloud is obviously a great way of sharing files with your friends. It enables you to collaborate with them and work on the same project at the same time. However, setting up a service on a central server, which is often physically out of your hand, is a little bit overkill for personal use. As long as you synchronize your files among your own devices you would not need the server, which can be a single point of failure (data can be lost if it fails).</p>

<p>On the other hand, <a href="/suguru/tag:Syncthing" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Syncthing</span></a> does not require a central server at all. By default it transmits data only among your devices. For example, you can set up Syncthing on your desktop, laptop, and smartphone. If they are connected with LAN data can be synchronized locally, and it is not sent outside of it. You can decide by yourself where to store your data, and there is not a single point of failure.</p>

<p>Syncthing is available on not only Windows, macOS, Android, and iOS but also GNU/Linux distributions and <a href="https://www.freshports.org/net/syncthing" rel="nofollow">FreeBSD</a>. This level of availability cannot be expected from proprietary software, of course.</p>

<h2 id="encrypt-private-data">Encrypt private data</h2>

<p>If you synchronize private data such as recovery passphrase of your online accounts I highly recommend you to encrypt them beforehand to make sure that nobody but you can read the data.</p>

<p>From the perspective of versatility you may use <a href="https://gnupg.org/" rel="nofollow">GnuPG</a> for data <a href="/suguru/tag:encryption" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">encryption</span></a>. As long as the private key is kept safely, practically there is almost zero chance for other people to read data, even if you lost your device and someone got an access to the encrypted files.</p>

<p>After you create the key pair you can upload the public key to a distribution service such as <a href="https://keys.openpgp.org/" rel="nofollow">https://keys.openpgp.org/</a>. Once you have the public key, you can encrypt the file without the private key. It will not be required until you decrypt the file to read it.</p>

<p>In order to keep the private key secure, you can store it on Yubikey, following the official guide available <a href="https://support.yubico.com/hc/en-us/articles/360013790259-Using-Your-YubiKey-with-OpenPGP" rel="nofollow">here</a>. Because the private key is stored on the hardware key, it cannot be hacked online.</p>

<h2 id="create-a-backup-on-storj-dcs-with-rclone">Create a backup on Storj DCS with rclone</h2>

<p>Syncthing provides you a function to store file history, but data loss can happen for whatever reason. You may set it up in a wrong way or there may be a bug on Syncthing. If your devices were broken from a natural disaster like flood, your data would be lost forever, so you should always prepare backup in case.</p>

<p>Following the <a href="https://docs.oracle.com/cd/B10501_01/server.920/a96519/strategy.htm" rel="nofollow">golden rule of data backup</a>, it should be outside of your Syncthing ecosystem. This means that it should be available online, meaning it comes to full circle: storing data online, outside of the local area network.</p>

<p>The backup itself should also be encrypted and decentralized. For if the backup data was available to someone, what is the point of setting up decentralized file synchronization among your devices in the first place?</p>

<p>For backup solution I would pick up <a href="https://www.storj.io/" rel="nofollow">Storj DCS</a> this case as well. <a href="/suguru/tag:Storj" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Storj</span></a> DCS, renamed from <a href="/suguru/tag:Tardigrade" class="hashtag" rel="nofollow"><span>#</span><span class="p-category">Tardigrade</span></a> recently, provides an encrypted and decentralized cloud storage. I have covered the service on this site multiple times such as <a href="https://blog.progressiv.dev/suguru/encrypted-and-decentralized-cloud-storage-tardigrade" rel="nofollow">here</a>.</p>

<p>To synchronize local data with cloud storage services, <a href="https://rclone.org/" rel="nofollow">rclone</a> is one of the popular choices. After installing, you can configure it <a href="https://rclone.org/tardigrade/" rel="nofollow">for Storj DCS</a>.</p>

<p>For daily use you can run a .sh script like this:</p>

<pre><code>#!/bin/sh
rclone sync -i --progress /home/local/directory/ remote:bucket/path/to/dir/ --exclude=&#34;.stversions/**&#34;
</code></pre>

<p>Running that script synchronizes the source to the destination, changing the destination only, deleting any excess files. Folders inside <code>.stversions</code> store versioning files, which Syncthing on each computer saves for itself, so they should only stay local and be excluded from synchronization between Storj DCS.</p>

<p>Since the command can cause data loss, test with <code>--dry-run</code> flag at first to see exactly what would be copied and deleted.</p>

<p><strong>Warning: you are not supposed to upload a huge number of files as the fee is calculated not only how large files are, but also how much files are uploaded! You should read ToS carefully before using the service.</strong></p>

<h2 id="restore-backup">Restore backup</h2>

<p>If data loss or conflicts happen locally, you may recover the latest state from backup with this command:</p>

<pre><code>#!/bin/sh
rclone sync -i --progress remote:bucket/path/to/dir/ /home/local/directory/ --exclude=&#34;.stversions/**&#34;
</code></pre>

<p>It downloads data from Storj DCS, changing the local directories only, deleting any excess files. Test with <code>--dry-run</code> in this case as well.</p>

<p>Copyright © 2021 Suguru Hirahara. This work is available under GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation. See <a href="https://blog.progressiv.dev/yq31akw3jj" rel="nofollow">https://blog.progressiv.dev/yq31akw3jj</a> for copying conditions.</p>
]]></content:encoded>
      <guid>https://blog.progressiv.dev/suguru/syncthing-decentralized-file-sync-software</guid>
      <pubDate>Sat, 19 Jun 2021 17:16:57 +0000</pubDate>
    </item>
  </channel>
</rss>