<?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 xorio on Medium]]></title>
        <description><![CDATA[Stories by xorio on Medium]]></description>
        <link>https://medium.com/@xorio42?source=rss-9f881fb74f74------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*FUErsKVQA-qx-U6pZqc5zQ.jpeg</url>
            <title>Stories by xorio on Medium</title>
            <link>https://medium.com/@xorio42?source=rss-9f881fb74f74------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 15:24:45 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@xorio42/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[Interview with blog.rust.careers]]></title>
            <link>https://xorio42.medium.com/interview-with-blog-rust-careers-1fe9332e2db0?source=rss-9f881fb74f74------2</link>
            <guid isPermaLink="false">https://medium.com/p/1fe9332e2db0</guid>
            <category><![CDATA[interview]]></category>
            <dc:creator><![CDATA[xorio]]></dc:creator>
            <pubDate>Wed, 22 Jan 2025 04:29:19 GMT</pubDate>
            <atom:updated>2025-01-22T04:29:19.826Z</atom:updated>
            <content:encoded><![CDATA[<p>I was a pleasure to have this interview <a href="https://blog.rust.careers/post/radu_interview/">https://blog.rust.careers/post/radu_interview/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1fe9332e2db0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rust + rencfs: The best decision of my life]]></title>
            <link>https://xorio42.medium.com/rust-rencfs-the-best-decision-of-my-life-0431a8a9f16b?source=rss-9f881fb74f74------2</link>
            <guid isPermaLink="false">https://medium.com/p/0431a8a9f16b</guid>
            <category><![CDATA[life-lessons]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[community]]></category>
            <category><![CDATA[teaching]]></category>
            <dc:creator><![CDATA[xorio]]></dc:creator>
            <pubDate>Tue, 31 Dec 2024 15:36:19 GMT</pubDate>
            <atom:updated>2025-01-01T20:15:16.355Z</atom:updated>
            <cc:license>https://creativecommons.org/publicdomain/mark/1.0/</cc:license>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4xtVEgEJVgpB-qGnDn_rvw.jpeg" /></figure><p><strong>2024 *</strong></p><p>What a journey it has been on this project :)</p><p><strong>Mar *</strong></p><p>It all started after a rough period in my life when I needed a change and something new and decided to learn Rust. I must say that in the first months, I felt like a student again when I learned all those new programming languages and concepts by myself. I was very curious, and my brain was like a sponge absorbing all this new information and learning all these new things. It was great, beautiful, and a new beginning, one of which I was really in need of.</p><p>I needed a learning project to keep me motivated, so I built an encrypted filesystem, thinking it would be a great learning experience. And what an experience it was, indeed :)</p><p><strong>Mar 25</strong></p><p>At first, I started with an <a href="https://github.com/radumarias/in-mem-fs">in-memory filesystem</a> to learn FUSE and Rust concepts.<br>Then, I moved to this project. First name was <a href="https://crates.io/crates/encrypted_fs">encrypted_fs</a>, it has <strong>15,127</strong> downloads :)</p><p><strong>Apr 5</strong></p><p>The first <a href="https://github.com/xoriors/rencfs/commit/a5455afc85cca8d608bc798e1aa41db2c16bdf57">commit</a> is the beginning of something interesting :). 11 files changed, +2608 -0 lines changed.<br>It is a pleasure looking back at the basic implementation of the encrypted fs logic and FUSE wrapper and how much it has evolved since then :)</p><p><strong>June *</strong></p><p>At some point, I wanted to do more with this project and not limit it to just a learning project. I was thinking about monetizing it, but I realized there’s a lot of work to be done for that, and I can’t do all that alone. I was thinking of hiring some freelancers, but I don’t make money from the project, so it’s not sustainable.<br>Then, I posted on some Rust communities saying, <em>“Look, I have this interesting FOSS project. Do you want to contribute to OSS?”</em> Many responded, joined, and started pushing code, and PRs came. It was beautiful.<br>Not only did they come, but they stayed and continued contributing. We also extended our collaboration to other <a href="https://xorio.rs/#projects">projects</a>.</p><p><strong>I really appreciate all of you, and I’m honored to be part of such a community with great, intelligent, curious, open-minded, always willing to learn, and hardworking people. Thank you all for all that you are doing.</strong></p><p><strong>Sep *</strong></p><p>Razvan, Associate Professor at University POLITEHNICA of Bucharest, contacted me to say that they are organizing <a href="https://omniopencon.org/">OmniOpenCon</a> to motivate students to get into development.<br>He found me on <a href="https://committers.top/romania#radumarias">committers.top</a> telling me I’m the <a href="https://committers.top/romania#radumarias">5th most active GitHub user in Romania</a> (6th now). I was shocked :)<br><strong>3500+ commits and 4000+ contributions in about 6 months</strong>, all these on rencfs. The ones above were working with web tech, so that means I’m <strong>#1 for Rust in Romania</strong> :)</p><p>While working on this project, I learned a lot about cryptography, filesystems, Rust, building clean code, and a lot more, and decided to do my part in giving something back to the community by writing several articles, small ones too, holding talks and presentation and I enjoyed it. Online and community <a href="https://github.com/xoriors/rencfs?tab=readme-ov-file#introduction">presence</a>.</p><p><strong>Nov 16</strong></p><p>After I gave the talk at OmniOpenCon, Razvan told me he organizes courses where students are given tasks from open-source projects to initiate them into programming. He asked me if I wanted to provide them with some good first issues from rencfs, which I accepted.<br>This is how the <strong>#cdl-courses</strong> channel was born. For <strong>several weeks</strong>, <strong>13 students</strong> tackled the mysteries of Rust, cryptography, and filesystems. It was an interesting experience for me, and I hope it was for them, too. I hope they learned much and developed valuable skills for their next journey in this beautiful universe.<br>You can see their <a href="https://github.com/xoriors/rencfs/tree/cdl">contributions</a><a href="https://github.com/xoriors/rencfs/tree/cdl.">.</a> After we test them a bit more, they will be merged into the main branch.<br><strong>Thank you to all of you CDL course students. I hope to see you again soon.</strong></p><p><strong>Oct 28</strong></p><p>To motivate people, I decided to organize weekly coding challenges. In these challenges, we learn various computing concepts and implement interesting concepts. We also learn more about algorithms, data structures, programming languages, and how to perform complex tasks.</p><p><strong>Dec *</strong></p><p><strong>Rust is not an easy language to learn</strong>. Learning it was difficult for me, too, although I had more than 20 years of experience in tech, working with several programming languages. I learned it by myself. I have to admit there were also hard moments, and a few times, I thought I was not a good enough developer for Rust and thought to give up. I would have appreciated having someone by my side back then to motivate, encourage, and tell me to continue the journey so that, in time, the dots would connect, and all these hard times would only make me more resilient and a better programmer.</p><p>So I decided to <strong>be the mentor I didn’t have</strong> for others in those Rust’s valleys and help them continue the journey, ensuring they would all get better and have the greatest adventure of their lives.</p><p>I can now confidently say that <strong>learning Rust was the best decision of my life on all levels</strong>. It changed my life, making me a better developer, mentor, human being, and advocate of Open Source.</p><p>This is how the <a href="https://www.linkedin.com/posts/radumarias_courses-course-i-activity-7277791177511194624-5coh?utm_source=share&amp;utm_medium=member_desktop">teaching</a> journey began. On February 3, we started several <a href="https://www.linkedin.com/posts/radumarias_courses-course-i-activity-7277791177511194624-5coh?utm_source=share&amp;utm_medium=member_desktop">courses</a>, such as Rust for Beginners, Blockchain, and the QA manual. More are on the way.<br>I hope this will help others to be the best they can be.</p><p><strong>Dec 31</strong></p><p>We got to the present moment. There are some <a href="https://github.com/xoriors/rencfs/pulse">stats</a> of the repo.</p><p><strong>1427 commits<br>18 contributors<br>29 people have access to this repository<br>22 outside collaborators<br>Issues<br> - 96 open<br> - 44 closed<br>milestone: 1.0.0-rc1: the first stable release we are working on<br> - 39 open<br> - 12 closed<br>Slack: 67 members in the rencfs community</strong></p><p><strong>Conclusion</strong></p><p>It all started as a learning experience for Rust. It evolved into something more, and others learned from it, too. It is soon to become a stable product used in real-use cases.</p><p>As a <strong>new year resolution</strong>, I wish this project, and all others of <a href="https://xorio.rs/">xorio</a> community, to become <strong>essential contributors to security, privacy, tech, and well-being</strong>, helping people <strong>learn and experiment</strong> with new tech and <strong>build interesting solutions</strong> and why now have them <strong>teach and give back to the OSS community too</strong>.</p><p><strong>Thank you all for being part of this community and for all you do for it and the project. Let’s keep the adventure going by learning and building great products.</strong></p><p><strong>I wish you all a Happy New Year, health and happiness, and a great journey ahead in this beautiful universe, simulation, or creation — whatever it is, it’s special and maybe unique.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0431a8a9f16b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FOSE (Free and Open Source Education)]]></title>
            <link>https://xorio42.medium.com/fose-free-and-open-source-education-f334fb4e4bfb?source=rss-9f881fb74f74------2</link>
            <guid isPermaLink="false">https://medium.com/p/f334fb4e4bfb</guid>
            <category><![CDATA[open-source-contribution]]></category>
            <category><![CDATA[foss]]></category>
            <category><![CDATA[open-source-intelligence]]></category>
            <dc:creator><![CDATA[xorio]]></dc:creator>
            <pubDate>Fri, 27 Dec 2024 06:50:04 GMT</pubDate>
            <atom:updated>2024-12-27T06:50:04.098Z</atom:updated>
            <content:encoded><![CDATA[<p>Information used for education, and access to it, should be free and publicly available, just like sunlight, air, and rainwater</p><p>If you want to make money from education, teach and help people to learn, and sell that, but using free and publicly available information</p><p><a href="https://www.linkedin.com/posts/radumarias_courses-course-i-activity-7277791177511194624-5coh?utm_source=share&amp;utm_medium=member_android">https://www.linkedin.com/posts/radumarias_courses-course-i-activity-7277791177511194624-5coh?utm_source=share&amp;utm_medium=member_android</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f334fb4e4bfb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Free courses]]></title>
            <link>https://xorio42.medium.com/free-courses-75a87257550f?source=rss-9f881fb74f74------2</link>
            <guid isPermaLink="false">https://medium.com/p/75a87257550f</guid>
            <dc:creator><![CDATA[xorio]]></dc:creator>
            <pubDate>Thu, 26 Dec 2024 07:47:35 GMT</pubDate>
            <atom:updated>2024-12-26T07:47:35.947Z</atom:updated>
            <content:encoded><![CDATA[<p>Free courses <a href="https://www.linkedin.com/posts/radumarias_courses-course-i-activity-7277791177511194624-5coh?utm_source=share&amp;utm_medium=member_android">https://www.linkedin.com/posts/radumarias_courses-course-i-activity-7277791177511194624-5coh?utm_source=share&amp;utm_medium=member_android</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=75a87257550f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Contribute to open source]]></title>
            <link>https://xorio42.medium.com/contribute-to-open-source-a53d3524e6a7?source=rss-9f881fb74f74------2</link>
            <guid isPermaLink="false">https://medium.com/p/a53d3524e6a7</guid>
            <category><![CDATA[development]]></category>
            <category><![CDATA[contribute]]></category>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[xorio]]></dc:creator>
            <pubDate>Sun, 01 Dec 2024 10:26:51 GMT</pubDate>
            <atom:updated>2024-12-01T10:26:51.181Z</atom:updated>
            <content:encoded><![CDATA[<p>Contribute to open source</p><p>Hi,</p><p>If you want to contribute to open source projects you can see more https://xorio.rs</p><p>First one is the most active. You can read more about it https://github.com/radumarias/rencfs<br>We are a team of 53 pasionate people from devs to QA, designers and front-end developers who collaborate in building interesting and beautifully coded products and learn from each other.</p><p>We also have a coding bounty each week, current one is https://meetu.ps/e/NGLRw/wRhNG/i to build a WAL library (Write-ahead logging) similar to https://crates.io/crates/okaywal<br>Prize is 42 USD from which we buy books and share with the team and the rest we donate to some IT entities.</p><p>if you&#39;re interested plese write me on any platform from the site.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a53d3524e6a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Update: Cap’n Proto in gRPC over HTTP/3 (QUIC). Old Idea: Apache Flight over HTTP/3 with RDMA]]></title>
            <link>https://xorio42.medium.com/project-idea-81c5a7faf307?source=rss-9f881fb74f74------2</link>
            <guid isPermaLink="false">https://medium.com/p/81c5a7faf307</guid>
            <category><![CDATA[quic]]></category>
            <category><![CDATA[tonic]]></category>
            <category><![CDATA[grpc]]></category>
            <category><![CDATA[http3]]></category>
            <category><![CDATA[apache-arrow]]></category>
            <dc:creator><![CDATA[xorio]]></dc:creator>
            <pubDate>Thu, 21 Nov 2024 06:40:30 GMT</pubDate>
            <atom:updated>2024-12-25T05:48:24.427Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Update: The plan is to use </strong><a href="https://capnproto.org/"><strong>Cap’n Proto</strong></a><strong> instead of Apache Arrow, which offers true zero-copy, and create a communication protocol similar to Apache Flight or even more straightforward to use directly QUIC or HTTP/3. Maybe we can do both implementations with Apache Arrow and Cap’n Proto.</strong></p><p>https://docs.google.com/document/d/1Ru5UlOz-4dz9ors3FKEg2Ac-KxKVqI_wR0EitECp-mo/edit?usp=drivesdk</p><p>Idea: Make Apache Flight (gRPC) work over HTTP/3 (QUIC) and make use of RDMA (fast memory transfer). All made in Rust</p><p>Motivation<br>- challenge: there are no well-known production-ready implementations<br>- faster transfers<br>- faster connection time<br>- reduced latency<br>- Reduced Downtime<br>- High Throughput<br>- multiplexing without head-of-line blocking<br>- particularly beneficial for short-lived connections or high-frequency RPC calls<br>- QUIC retransmits lost packets faster than TCP, reducing delays<br>- QUIC allows connections to migrate between network interfaces (e.g., Wi-Fi to cellular) without disconnecting<br>- QUIC includes TLS 1.3 at the transport layer, so all HTTP/3 connections are encrypted by design<br>- HTTP/3 allows prioritizing certain streams, optimizing resource utilization for high-performance data pipelines<br>- QUIC supports an unlimited number of concurrent streams without degrading performance</p><p>Using HTTP/3 and QUIC for Arrow Flight and Tonic brings several potential advantages, especially in scenarios requiring high-performance data exchange and improved reliability over modern networks. Below are the key advantages:</p><p>This would involve<br>- extend Quinn crate for HTTP/3<br>- change the transport layer in tonic crate to use the above, hence we&#39;ll have gRPC over HTTP/3<br>- have Apache Flight with Arrow working with the above, this will give us Flight over HTTP/3<br>- make use of RDMA for fast memory transfer</p><p>here are some details <a href="https://chatgpt.com/share/673ec4ef-ccdc-8003-8dab-d1a4ecd5005d">https://chatgpt.com/share/673ec4ef-ccdc-8003-8dab-d1a4ecd5005d</a></p><p>Does anyone care to get involved? all this will be open source</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81c5a7faf307" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[#job hi, if you know some Rust job or collaboration contract, would appreciate it if you let me…]]></title>
            <link>https://xorio42.medium.com/job-hi-if-you-know-some-rust-job-or-collaboration-contract-would-appreciate-it-if-you-let-me-d700646d0794?source=rss-9f881fb74f74------2</link>
            <guid isPermaLink="false">https://medium.com/p/d700646d0794</guid>
            <dc:creator><![CDATA[xorio]]></dc:creator>
            <pubDate>Tue, 01 Oct 2024 12:06:02 GMT</pubDate>
            <atom:updated>2024-10-01T12:06:02.019Z</atom:updated>
            <content:encoded><![CDATA[<p>#job hi, if you know some Rust job or collaboration contract, would appreciate it if you let me know, I’m looking for now<br>This is me https://xorio.rs</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d700646d0794" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I'm the 5th most active GitHub user in Romania :)
https://committers.top/romania]]></title>
            <link>https://xorio42.medium.com/im-the-5th-most-active-github-user-in-romania-https-committers-top-romania-07b10353604d?source=rss-9f881fb74f74------2</link>
            <guid isPermaLink="false">https://medium.com/p/07b10353604d</guid>
            <dc:creator><![CDATA[xorio]]></dc:creator>
            <pubDate>Wed, 28 Aug 2024 23:37:10 GMT</pubDate>
            <atom:updated>2024-08-28T23:37:10.154Z</atom:updated>
            <content:encoded><![CDATA[<p>I&#39;m the 5th most active GitHub user in Romania :)<br>https://committers.top/romania</p><p>With projects from https://xorio.rs/</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=07b10353604d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[No new article this time, just a technical question.]]></title>
            <link>https://xorio42.medium.com/no-new-article-this-time-just-a-technical-question-06a6c1d03614?source=rss-9f881fb74f74------2</link>
            <guid isPermaLink="false">https://medium.com/p/06a6c1d03614</guid>
            <dc:creator><![CDATA[xorio]]></dc:creator>
            <pubDate>Fri, 23 Aug 2024 13:32:20 GMT</pubDate>
            <atom:updated>2024-08-23T13:32:20.044Z</atom:updated>
            <content:encoded><![CDATA[<p>No new article this time, just a technical question.</p><p>How to build a virtualized GPU that executes remotely and keeping your data local?</p><p>The idea is to build something like this:</p><p>Virtualization for GPU that allows you to run local GPU apps and the code is actually run in the cloud, keeping your data local.</p><p>Functionality:<br>- `vGPU` is a `virtualization` layer for a `GPU`<br>- your local app &quot;runs&quot; on local `vGPU`<br>- local app decrypts the actual local data and sends the (`CUDA`) instructions to the remote `GPU-Coortinator`<br>- `GPU-Coortinator` distribute the instructions to multiple real `GPU`s<br>- then it sends the results back to `vGPU` which sends them to the local app</p><p>**The advantage is your private data never leaves your network in plain. Only actual GPU instructions (CUDA instructions) are sent over the wire but encrypted with TLS.**</p><p>I know it will be slow, but in cases where the data flow is small compared to processing time it could be a reasonable compromise for the security it gives you.</p><p>Also because instructions are distributed to multiple GPUs, when possible, it could offer better performance, in some cases, than locally</p><p>schema https://github.com/radumarias/rvirt-gpu/blob/main/website/resources/schema2.png</p><p>implementation ideas https://github.com/radumarias/rvirt-gpu/wiki/Implementation</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=06a6c1d03614" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Hitchhiker’s Guide to Building an Encrypted Filesystem in Rust]]></title>
            <link>https://systemweakness.com/the-hitchhikers-guide-to-building-an-encrypted-filesystem-in-rust-4d678c57d65c?source=rss-9f881fb74f74------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d678c57d65c</guid>
            <category><![CDATA[privacy]]></category>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[fuse]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[filesystem]]></category>
            <dc:creator><![CDATA[xorio]]></dc:creator>
            <pubDate>Mon, 12 Aug 2024 20:59:21 GMT</pubDate>
            <atom:updated>2024-09-24T02:15:49.909Z</atom:updated>
            <content:encoded><![CDATA[<p>This is the first from a <a href="https://medium.com/@xorio42/list/828492b94c23">series</a> on how to build an encrypted filesystem in Rust. There is also a <a href="https://drive.google.com/file/d/1IMs0GJdQvQ3oT5nUU2pL865zTsWPeQfr/view?usp=drivesdk">one pager</a> about it.</p><p>Also It was the <a href="https://this-week-in-rust.org/blog/2024/08/14/this-week-in-rust-560/#crate-of-the-week">crate of the week</a> in Aug 2024 in <a href="https://this-week-in-rust.org/">This Week in Rust</a> newsletter.</p><p>If you want to see more interesting projects and contribute to open source please see <a href="https://xorio.rs/">my site</a>.</p><h3>The beginning</h3><p>It all started after I began learning <strong>Rust</strong> and wanted an interesting learning project to stay motivated. Initially, I had some ideas and consulted <em>ChatGPT</em>, which suggested common apps, like a <strong>Todo</strong> list :) However, I pushed it to more interesting and challenging realms, leading to suggestions like a <strong>distributed filesystem</strong>, <strong>password manager</strong>, <strong>proxy</strong>, <strong>network traffic monitor</strong>… Now these all sound interesting, but some are maybe a bit too complicated for a learning project, like the <em>distributed filesystem</em>.</p><h3>My idea</h3><p>My project idea originated from having a work directory with projects information, including some private data (not credentials, which I keep in <strong>KeePassXC</strong>. I synced this directory with <strong>Resilio</strong> across multiple devices but considered using <strong>Google Drive</strong> or <strong>Dropbox</strong>, but hey, there is private info in there, not ideal for them to have access to it. So a solution like <strong>encrypted directories</strong>, keeping the privacy, was appealing. So I decided to build one. This would be a great learning experience after all. <strong>And it was indeed</strong>.</p><p>From a learning project it evolved into something more and soon ready for a stable release with many interesting features. You can view the <a href="https://github.com/radumarias/rencfs"><strong>project</strong></a>.</p><h3>Key features</h3><p>Some of these are still being worked on, marked with [WIP].</p><ul><li>Security using well-known audited AEAD cryptography primitives;</li><li>[WIP] Data integrity, data is written with WAL to ensure integrity even on crash or power loss;</li><li>[WIP] Hide all info for enhanced privacy, all metadata, content, file name, file size, *time fields, files count, directory structure are encrypted;</li><li>Safely manage credentials in memory with mlock(2), mprotect, zeroize and expiry to mitigate cold boot attacks;</li><li>Memory safety, performance and optimized for concurrency with Rust;</li><li>Simplicity;</li><li>Encryption key generated from password;</li><li>Password saved in OS’s keyring;</li><li>Change password without re-encrypting all data;</li><li>[WIP] Generate unique nonce in offline mode;</li><li>Fast seek on both reads and writes;</li><li>Writes in parallel;</li><li>Exposed with FUSE;</li><li>Fully concurrent for all operations;</li><li>[WIP] Handle long file names;</li><li>[WIP] Abstraction layer for Rust File and fs API to use it as lib to switch to using encrypted files by just changing the use statements;</li><li>[WIP] Abstraction layer to access the storage with implementation for desktop, wasm, Android, iOS and ability to write your own implementation.</li></ul><h3>Layers</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ifs1L_gpgCwADIgd6g1VXg.png" /></figure><h3>GUI</h3><p>How the GUI looks like, we’ll discuss more about this project later on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j_TTxN03O3MUEdz25875dw.gif" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FMkWMS3Qmk1I%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DMkWMS3Qmk1I&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FMkWMS3Qmk1I%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/b059bf3b48f3ec71820efce1727034a2/href">https://medium.com/media/b059bf3b48f3ec71820efce1727034a2/href</a></iframe><h3>Concepts and technologies</h3><p>Will briefly go over the concepts involved and some tech details and later on will detail them in separate articles.</p><h4>FUSE (Filesystem in Userspace)</h4><p>I used it before and I could use it to expose the filesystem to the OS to access it from <strong>File Manager</strong> and <strong>terminal</strong>. I looked for <strong>FUSE</strong> implementations in Rust and found <a href="https://crates.io/fuser"><strong>fuser</strong></a>, and later migrated to <a href="https://crates.io/fuse3"><strong>fuse3</strong></a> which is async. I began with its <em>examples</em> and found a useful one called simple.rs which was a basic implementation that kept <strong>metadata</strong> in files with <strong>inode</strong> number as name and <strong>content</strong> of files the same. Folders were saved as a <strong>B-Tree</strong> with children in the file content. It also had some permissions checks.<br>This was a good <strong>starting point</strong> but it was not <strong>multi-instance</strong> safe, we need to change it to be, as the folder is synced among multiple devices our app could run on <strong>multiple devices</strong> in <strong>parallel</strong> or even <strong>offline</strong>. We need to generate a unique inode for new files/dirs and the children <em>B-Tree</em> in a file clearly wouldn’t work.</p><h4>In-memory FS</h4><p>I started with a simple in-memory FS using <em>FUSE</em>, where I learned more about <strong>smart pointers</strong> like <strong>Box</strong>, <strong>Rc</strong>, <strong>RefCell</strong>, <strong>Arc</strong> and <strong>lifetimes</strong>. <em>Aargh… lifetimes</em>, would say many, one of the most complicated concepts in Rust, after the <strong>borrow checker</strong>. They are quite complicated, at first, but after you fight with them for a while, then you bury the hatchet and they are easier to live with. After you understand <strong>how</strong> and <strong>why</strong> <strong>compiler</strong> <em>lets you</em> do things, you understand that’s the <strong>correct</strong> way to do them and it <strong>saves</strong> you from a lot of problems, and you <strong>appreciate it</strong>. After all, these are the promises of Rust, <strong>memory safety</strong>, <strong>no data race</strong> and <strong>race conditions</strong>. And indeed it lives to its <strong>premise</strong>. You need to come from other languages where you had all sort of problems to really <strong>appreciate</strong> what Rust is offering you. You can view the <a href="https://github.com/radumarias/in-mem-fs">project</a>.</p><h4>Multi instance</h4><p>We need to run in <strong>multi instance</strong>, as the folder will be synced over <strong>several devices</strong> the app could run in <em>parallel</em> or even <em>offline</em>. We need to generate <strong>unique inodes</strong> for new files. Solution is to assign a <strong>random id</strong> to each device (or set by command arg) and generate as $<strong>instance_id | $inode seq</strong>.<br>I have used this technique before on a mobile apps that runs offline on multiple devices, collects data and then when we have network connection we push those to the server. They need a way to <strong>generate unique ids in offline mode</strong>. But couldn’t use <strong>UUID</strong> (also that is not 100% unique) because our ids had to respect a <strong>predefined pattern</strong> like “<strong>00000”</strong> as a sequence. What we did was to assign an <strong>instance_id</strong> to each user and generate unique ids like <strong>$instance_id-$seq</strong>, like <strong>42–00037</strong>. We didn’t had the case where same user is connected on multiple device, but in that case at login you can assign a sequence to the user and use that along side with <strong>instance_id</strong>.</p><p>To ensure unique inode between instances we will have this flow:</p><ul><li>when app starts it generates a unique random u8 (unique in data_dir/seq), use this as instance_id</li><li>also have a param --instance-id</li><li>save that id keyring and use it next time</li><li>if app is uninstalled when we start next time we will generate a new random id</li><li>generate nonce like instance_id | inode_seq</li><li>keep inode_seq in data_dir/seq/instance_id/inode</li><li>when generating inode first increment and save the inode_seq and then use that in inode</li></ul><p>A possible problem:</p><blockquote><em>Consider this example: one uses our program, creates a backup of the data, keeps using the program. If they restore the backup, then they will restart from an earlier counter, and reuse the same inode. We will use inode as nonce when for filename in that folder so it will end-up reusing nonces (</em>which ends up in catastrophic failure<em>).</em></blockquote><p>To mitigate this we can keep the inode_seq in <strong>keyring</strong> also and use max(keyring, app_data).</p><p><strong>Limits</strong>: using first 8 bits for instance_id reduces the number of inodes to <strong>2⁵⁶ — 3</strong>, it’s -3 and not -1 because inode 0 is not used, and 1 is reserved for root dir, so we’re left with value <strong>72,057,594,037,927,933</strong>, which is more than enough.</p><h4>Security</h4><p>Same we do for nonce, <strong>$instance_id | $nonce_seq</strong>. The sequences we keep in data dir in a per instance folder. To resolve problem where user restores a backup and hence would reuse nonces and inodes (which ends up in catastrophic failure) we keep sequences in keyring too and use <strong>max(keyring, data_dir)</strong>.</p><p><strong>Limits</strong>: if the instance_id is <strong>u8</strong>, and we encrypt in blocks of 256KB, the max<br>data we can encrypt is <strong>2⁵⁶ — 1 * 256 KB</strong>, which is <strong>1.845×10¹⁹ petabytes</strong>.</p><p>Using <a href="https://crates.io/crates/ring"><strong>ring</strong></a> for encryption, will extend to <a href="https://crates.io/crates/rustcrypto"><strong>RustCrypto</strong></a> too, which is pure Rust. First time we <strong>generate a random encryption key</strong> and encrypt that with another <strong>key derived</strong> from user’s <strong>password</strong> using <a href="https://crates.io/crates/argon2"><strong>argon2</strong></a>. We use only use <strong>AEAD</strong> ciphers, becuase they offer authenticaiton and integrity check, <strong>ChaCha20Poly1305</strong> and <strong>Aes256Gcm</strong>. Credentials are kept in mem with <a href="https://crates.io/crates/secrecy"><strong>secrecy</strong></a>, <strong>mlock</strong>ed when used, <strong>mprotect</strong>ed when not read and <strong>zeroize</strong>d on drop.<br><strong>Hashing</strong> is made with <a href="https://crates.io/crates/blake3"><strong>blake3</strong></a> and <a href="https://crates.io/crates/rand_chacha"><strong>rand_chacha</strong></a> for <strong>random numbers</strong>.</p><h4>File integrity</h4><p><em>”There’s The Great Wall, and then there’s this: an okay WAL.”</em>.<br><strong>WAL</strong>(Write-ahead logging) is a very common technique used by DBs to<br>write transactions to ensure fie integrity. I’m using <a href="https://crates.io/crates/okaywal"><strong>okaywal</strong></a> for that.<br>Idea is simple, for every file we have a <strong>wal</strong> folder, when we need to write something to a file first we write into the wal and after some threashold size we checkpoint and flust the chnages to the actual file deleteing when we written, we do the same when we finished writing all changes. Meanwhile if the process dies or we experience a power-loss, next time we start we see we have changes in wal and we write those first. Meanwhile we can mark the file as recovering, we can use a Unicode icon like ✚ in prefix of file to mark the file as recovering. In this time we will not allow reading and writing to the file.</p><h4>Seek</h4><p>To support fast seeks we encrypt file in <strong>blocks</strong> of <strong>256KB</strong>. When we need to seek on read we translate from <strong>plaintext</strong> <strong>offset</strong> to <strong>ciphertext block index</strong>, and decrypt that block. We actually impl <strong>Seek</strong> on the same <strong>Read</strong> struct.</p><p>Read</p><pre>impl&lt;R: Read&gt; Read for RingCryptoRead&lt;R&gt; {<br>    #[instrument(name = &quot;RingCryptoReader:read&quot;, skip(self, buf))]<br>    fn read(&amp;mut self, buf: &amp;mut [u8]) -&gt; io::Result&lt;usize&gt; {<br>        // first try to read remaining decrypted data<br>        let len = self.buf.read(buf)?;<br>        if len != 0 {<br>            return Ok(len);<br>        }<br>        // we read all the data from the buffer, so we need to read a new block and decrypt it<br>        decrypt_block!(<br>            self.block_index,<br>            self.buf,<br>            self.input.as_mut().unwrap(),<br>            self.last_nonce,<br>            self.opening_key<br>        );<br>        let len = self.buf.read(buf)?;<br>        Ok(len)<br>    }<br>}</pre><pre>impl&lt;R: Read + Seek&gt; Seek for RingCryptoRead&lt;R&gt; {<br>    #[allow(clippy::cast_possible_wrap)]<br>    #[allow(clippy::cast_sign_loss)]<br>    fn seek(&amp;mut self, pos: SeekFrom) -&gt; io::Result&lt;u64&gt; {<br>        let plaintext_len = self.get_plaintext_len()?;<br>        let new_pos = match pos {<br>            SeekFrom::Start(pos) =&gt; pos as i64,<br>            SeekFrom::End(pos) =&gt; plaintext_len as i64 + pos,<br>            SeekFrom::Current(pos) =&gt; self.pos() as i64 + pos,<br>        };<br>        if new_pos &lt; 0 {<br>            return Err(io::Error::new(<br>                io::ErrorKind::InvalidInput,<br>                &quot;new position &lt; 0&quot;,<br>            ));<br>        }<br>        // keep in bounds<br>        let mut new_pos = new_pos as u64;<br>        new_pos = new_pos.min(plaintext_len);<br>        if self.pos() == new_pos {<br>            return Ok(new_pos);<br>        }<br>        let block_index = self.pos() / self.plaintext_block_size as u64;<br>        let new_block_index = new_pos / self.plaintext_block_size as u64;<br>        if block_index == new_block_index {<br>            let at_full_block_end = self.pos() % self.plaintext_block_size as u64 == 0<br>                &amp;&amp; self.buf.available_read() == 0;<br>            if self.buf.available() &gt; 0<br>                // this make sure we are not at the end of the current block, which is the start boundary of next block<br>                // in that case we need to seek inside the next block<br>                &amp;&amp; !at_full_block_end<br>            {<br>                // seek inside current block<br>                self.buf.seek_read(SeekFrom::Start(<br>                    NONCE_LEN as u64 + new_pos % self.plaintext_block_size as u64,<br>                ))?;<br>            } else {<br>                // we need to read a new block and seek inside that block<br>                let plaintext_block_size = self.plaintext_block_size;<br>                stream_util::seek_forward(self, new_pos % plaintext_block_size as u64, true)?;<br>            }<br>        } else {<br>            // change block<br>            self.input.as_mut().unwrap().seek(SeekFrom::Start(<br>                new_block_index * self.ciphertext_block_size as u64,<br>            ))?;<br>            self.buf.clear();<br>            self.block_index = new_block_index;<br>            if new_pos % self.plaintext_block_size as u64 == 0 {<br>                // in case we need to seek at the start of the new block, we need to decrypt here, because we altered<br>                // the block_index but the seek seek_forward from below will not decrypt anything<br>                // as the offset in new block is 0. In that case the po()<br>                // method is affected as it will use the wrong block_index value<br>                decrypt_block!(<br>                    self.block_index,<br>                    self.buf,<br>                    self.input.as_mut().unwrap(),<br>                    self.last_nonce,<br>                    self.opening_key<br>                );<br>            }<br>            // seek inside new block<br>            let plaintext_block_size = self.plaintext_block_size;<br>            stream_util::seek_forward(self, new_pos % plaintext_block_size as u64, true)?;<br>        }<br>        Ok(self.pos())<br>    }<br>}</pre><p>For <strong>seek on write</strong> it’s a bit more complicated, we need to act as reader too. First we need to decrypt the block then write to it and when at the end encrypt and write it to disk. Because Rust doesn’t have <em>method overwriting</em> the code is not as clean as for reader, where, we only extend.</p><h4>Write in parallel</h4><p>Using <strong>RwLock</strong>s we allow reading and writing in parallel and we resolve conflicts with <strong>WAL</strong>. Particularly useful for <strong>torrent apps</strong> which writes different <strong>chunks</strong> in parallel, but also for DBs.</p><h3>Usage</h3><p>You can use it as <strong>CLI</strong> or <a href="https://crates.io/crates/rencfs"><strong>library</strong></a> to build your own encrypted solutions.</p><p>CLI</p><pre>rencfs mount --mount-point MOUNT_POINT --data-dir DATA_DIR</pre><h3>Future</h3><ul><li>Plan is to implement it also on <strong>macOS</strong> and <strong>Windows</strong></li><li><strong>Systemd service</strong> is being worked on <a href="https://github.com/radumarias/rencfs-daemon"><strong>rencfs-daemon</strong></a></li><li><strong>GUI</strong> is being worked on <a href="https://github.com/radumarias/rencfs-desktop"><strong>rencfs-desktop</strong></a> and <a href="https://github.com/radumarias/rencfs-kotlin"><strong>rencfs-kotlin</strong></a> Mobile apps for Android and iOS are being worked on <a href="https://github.com/radumarias/rencfs-kotlin"><strong>rencfs-kotlin</strong></a></li></ul><h3>Performance</h3><p><strong>Aes256Gcm</strong> is slightly faster than <strong>ChaCha20Poly1305</strong> by a factor of <strong>1.28</strong> on average. This is because of the hardware acceleration of <strong>AES</strong> on most CPUs via <strong>AES-NI</strong>. But where hardware acceleration is not available <strong>ChaCha20Poly1305</strong> is <strong>faster</strong>. Also <strong>ChaChaPoly1305</strong> is better at <a href="https://en.wikipedia.org/wiki/Single_instruction,_multiple_data"><strong>SIMD</strong></a>.</p><h3>Cipher comparison</h3><h4>AES-GCM vs. ChaCha20-Poly1305</h4><ul><li>If you have <strong>hardware acceleration</strong> (e.g. <strong>AES-NI</strong>), then <strong>AES-GCM</strong> provides better performance. On my benchmarks, it was faster by a factor of <strong>1.28</strong> on average. If you do not have a hardware acceleration, <strong>AES-GCM</strong> is either slower than <strong>ChaCha20-Poly1305</strong>, or it <strong>leaks your encryption keys</strong> in <strong>cache timing</strong>.</li><li><strong>AES-GCM</strong> can target multiple security levels (<strong>128-bit</strong>, <strong>192-bit</strong>, <strong>256-bit</strong>), whereas <strong>ChaCha20-Poly1305</strong> is only defined at the <strong>256-bit</strong> security level.</li><li><strong>Nonce size</strong>:<br> — <strong>AES-GCM</strong>: Varies, but the standard is <strong>96 bits</strong> (<strong>12 bytes</strong>). If you supply a longer nonce, this gets hashed down to <strong>16 bytes.<br> — ChaCha20-Poly1305</strong>: The standardized version uses <strong>96-bit</strong> nonce (<strong>12 bytes</strong>), but the original used <strong>64-bit</strong> nonce (<strong>8 bytes</strong>).</li><li><strong>Wear-out of a single (key, nonce) pair</strong>:<br> — <strong>AES-GCM</strong>: Messages must be less than <strong>2³²— 2 blocks</strong> (a.k.a. <strong>2³⁶— 32 bytes</strong>, a.k.a. <strong>2³⁹— 256 bits</strong>), that’s roughly <strong>64GB</strong>. This also makes the security analysis of <strong>AES-GCM</strong> with long nonces complicated, since the hashed nonce doesn’t start with the <strong>lower 4 bytes</strong> set to <strong>00 00 00 02.<br> — ChaCha20-Poly1305</strong>: <strong>ChaCha</strong> has an internal counter (<strong>32 bits</strong> in the standardized IETF variant, <strong>64 bits</strong> in the original design). Max message length is <strong>2³⁹— 256 bits</strong>, about <strong>256GB</strong>.</li><li>Neither algorithm is <strong>nonce misuse-resistant</strong>.</li><li><strong>ChaChaPoly1305</strong> is better at <strong>SIMD</strong>.</li></ul><h4>Conclusion</h4><p>Both are good options. <strong>AES-GCM</strong> can be <strong>faster</strong> with <strong>hardware support</strong>, but <strong>pure-software</strong> implementations of <strong>ChaCha20-Poly1305</strong> are almost always <strong>fast</strong> and <strong>constant-time</strong>.</p><h3>Stack</h3><ul><li>it’s fully async built upon <a href="https://crates.io/crates/tokio"><strong>tokio</strong></a> and <a href="https://crates.io/crates/fuse3"><strong>fuse3</strong></a></li><li><a href="https://crates.io/crates/ring"><strong>ring</strong></a> for encryption and <a href="https://crates.io/crates/argon2"><strong>argon2</strong></a> for <strong>key derivation function</strong> (creating key used to <strong>encrypt master encryption key</strong> from <strong>password</strong>)</li><li><a href="https://crates.io/crates/rand_chacha"><strong>rand_chacha</strong></a> for <strong>cryptographically safe random number generator</strong></li><li><a href="https://crates.io/crates/secrets"><strong>secrets</strong></a> for keeping pass and encryption keys safe in memory <strong>mlock</strong>ed when used, <strong>mprotect</strong>ed when not read and <strong>zeroize</strong>d on drop. It keeps encryption keys in memory only while being used, and when not active it will release and zeroing them in memory</li><li><a href="https://crates.io/crates/blake3"><strong>blake3</strong></a> for <strong>hashing</strong></li><li><strong>password</strong> saved in OS keyring using <a href="https://crates.io/crates/keyring"><strong>keyring</strong></a></li><li><a href="https://crates.io/crates/tracing"><strong>tracing</strong></a> for <strong>tracing</strong> and <strong>logs</strong></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d678c57d65c" width="1" height="1" alt=""><hr><p><a href="https://systemweakness.com/the-hitchhikers-guide-to-building-an-encrypted-filesystem-in-rust-4d678c57d65c">The Hitchhiker’s Guide to Building an Encrypted Filesystem in Rust</a> was originally published in <a href="https://systemweakness.com/">System Weakness</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>