<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hassan Magdy</title>
    <description>The latest articles on DEV Community by Hassan Magdy (@euromoscow).</description>
    <link>https://dev.to/euromoscow</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3637951%2F8f99013d-5e2e-4810-aa63-258082ed3cc3.jpg</url>
      <title>DEV Community: Hassan Magdy</title>
      <link>https://dev.to/euromoscow</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/euromoscow"/>
    <language>en</language>
    <item>
      <title>How I Built a Zero-Knowledge 2FA Authenticator Using Rust, Tauri, and React</title>
      <dc:creator>Hassan Magdy</dc:creator>
      <pubDate>Sun, 23 Aug 2026 20:24:04 +0000</pubDate>
      <link>https://dev.to/euromoscow/how-i-built-a-zero-knowledge-2fa-authenticator-using-rust-tauri-and-react-1co6</link>
      <guid>https://dev.to/euromoscow/how-i-built-a-zero-knowledge-2fa-authenticator-using-rust-tauri-and-react-1co6</guid>
      <description>&lt;p&gt;Are you tired of being locked out of your accounts when you reset your phone? I was. I wanted a 2FA authenticator that would sync my codes seamlessly across devices, but I didn't want to hand over my plaintext secrets to a closed-source cloud provider.&lt;/p&gt;

&lt;p&gt;So, I built OtpVault — an open-source, truly zero-knowledge 2FA application.&lt;/p&gt;

&lt;p&gt;In this post, I want to share the architecture, the tech stack, and how I approached the security model.&lt;/p&gt;

&lt;p&gt;🛠️ The Tech Stack&lt;br&gt;
To make this work across Desktop (Windows), Android, and the Web (PWA), I needed a flexible yet highly secure stack:&lt;/p&gt;

&lt;p&gt;Backend / Core Logic: Rust (Using aes-gcm, argon2, and totp-rs). Rust ensures memory safety and handles the heavy cryptographic lifting.&lt;/p&gt;

&lt;p&gt;Desktop &amp;amp; Android Framework: Tauri v2. It allows wrapping the Rust backend with a web frontend natively and beautifully.&lt;/p&gt;

&lt;p&gt;Frontend: React 19 + Vite + Tailwind CSS.&lt;/p&gt;

&lt;p&gt;Cloud API: Neon PostgreSQL via Vercel Serverless.&lt;/p&gt;

&lt;p&gt;🔒 The Zero-Knowledge Architecture&lt;br&gt;
The core philosophy of OtpVault is simple: The server must never see the plaintext data.&lt;/p&gt;

&lt;p&gt;Here is how the email-based authentication flow works:&lt;/p&gt;

&lt;p&gt;Local Key Derivation: When you sign up or log in, your password and a randomly generated 32-byte salt are fed into Argon2id strictly on the client side (in Rust). This generates a strong 256-bit AES key.&lt;/p&gt;

&lt;p&gt;Vault Encryption: Your entire vault of 2FA secrets is encrypted locally using AES-256-GCM.&lt;/p&gt;

&lt;p&gt;Cloud Sync: The application sends a POST request to the Supabase/Neon REST API. The payload only contains your email, the salt, a test payload (to verify passwords later), and the opaque encrypted vault blob.&lt;/p&gt;

&lt;p&gt;If the database is ever breached, the attacker gets nothing but meaningless, encrypted strings.&lt;/p&gt;

&lt;p&gt;🔄 Solving the Cross-Platform Sync Problem&lt;br&gt;
One of the coolest challenges was keeping the Desktop, Android, and PWA versions in sync without compromising the encryption.&lt;/p&gt;

&lt;p&gt;I implemented a real-time polling mechanism (every 10 seconds). The Rust HTTP client fetches the encrypted vault from the Vercel API, decrypts it locally using the master key in memory, parses the JSON, merges any new accounts, re-encrypts, and pushes it back.&lt;/p&gt;

&lt;p&gt;I even had to build a format converter on the fly, because the Android version stores secrets as secret_encrypted (base64 salt+nonce+ciphertext), while the PWA handles plaintext secrets in memory before encrypting the entire vault layer.&lt;/p&gt;

&lt;p&gt;🛡️ Ironclad Features&lt;br&gt;
Delete Confirmation: To prevent accidental deletion, users must re-enter their master password before removing any 2FA account.&lt;/p&gt;

&lt;p&gt;Optimized Mobile QR Scanner: Using jsQR and requestAnimationFrame, the scanner pulls frames at a low JPEG quality (saving battery and processing at ~30KB/frame) while remaining blazing fast.&lt;/p&gt;

&lt;p&gt;🤝 Check it Out!&lt;br&gt;
Building OtpVault was an incredible journey into Rust cryptography and Tauri’s cross-platform capabilities. I’d love for the community to check it out, audit the code, or use it to secure your accounts.&lt;/p&gt;

&lt;p&gt;GitHub Repository: [&lt;a href="https://github.com/Shadow132245/OtpVault" rel="noopener noreferrer"&gt;https://github.com/Shadow132245/OtpVault&lt;/a&gt;]&lt;/p&gt;

&lt;p&gt;Website / Try it out: [&lt;a href="https://otpvault1.vercel.app" rel="noopener noreferrer"&gt;https://otpvault1.vercel.app&lt;/a&gt;]&lt;/p&gt;

&lt;p&gt;I'm open to any feedback, feature requests, or contributions. Let me know what you think of the architecture!&lt;/p&gt;

</description>
      <category>rust</category>
      <category>react</category>
      <category>opensource</category>
      <category>security</category>
    </item>
    <item>
      <title>I built an Advanced Python &amp; JS Obfuscator with AI Auto-Decryption 🛡️</title>
      <dc:creator>Hassan Magdy</dc:creator>
      <pubDate>Sun, 30 Nov 2025 21:35:12 +0000</pubDate>
      <link>https://dev.to/euromoscow/i-built-an-advanced-python-js-obfuscator-with-ai-auto-decryption-haa</link>
      <guid>https://dev.to/euromoscow/i-built-an-advanced-python-js-obfuscator-with-ai-auto-decryption-haa</guid>
      <description>&lt;p&gt;Hey Developers! 👋&lt;/p&gt;

&lt;p&gt;I'm &lt;strong&gt;EuroMoscow&lt;/strong&gt;, a Full Stack Developer. Recently, I noticed that many online code obfuscators are either paid, outdated, or break the code after encryption (especially with Python versions mismatch).&lt;/p&gt;

&lt;p&gt;So, I decided to build my own solution: &lt;strong&gt;EuroMoscow Shield&lt;/strong&gt; 🛡️.&lt;/p&gt;

&lt;p&gt;It is a free, mobile-responsive, and powerful tool to protect your Intellectual Property (IP) for both &lt;strong&gt;Python&lt;/strong&gt; and &lt;strong&gt;JavaScript&lt;/strong&gt; projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔗 Try it Live: &lt;a href="https://euro-moscow-shield.vercel.app/" rel="noopener noreferrer"&gt;EuroMoscow Shield&lt;/a&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  💻 Source Code: &lt;a href="https://github.com/Shadow132245/EuroMoscow-Shield" rel="noopener noreferrer"&gt;GitHub Repository&lt;/a&gt;
&lt;/h2&gt;




&lt;h2&gt;
  
  
  🔥 Key Features
&lt;/h2&gt;

&lt;p&gt;I wanted to create something robust, so I implemented multiple layers of protection:&lt;/p&gt;

&lt;h3&gt;
  
  
  🐍 For Python Developers
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Safe Renaming:&lt;/strong&gt; Smart AST parsing that renames variables/functions without breaking your logic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Portable Blob:&lt;/strong&gt; A custom technique I developed to compress code into a zlib integer array (Runs on any Python 3.x version, solving the &lt;code&gt;Marshal&lt;/code&gt; version error).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;EuroMoscow XOR:&lt;/strong&gt; Custom encryption with dynamic keys.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Import Guard:&lt;/strong&gt; Automatically detects libraries (&lt;code&gt;sys&lt;/code&gt;, &lt;code&gt;os&lt;/code&gt;, etc.) and protects them from being renamed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  📜 For JavaScript Developers
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Hex Encoding:&lt;/strong&gt; Converts logic to hexadecimal strings (&lt;code&gt;\x68\x65...&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Char Code Array:&lt;/strong&gt; Transforms code into number arrays.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;URL &amp;amp; Base64 Encoding:&lt;/strong&gt; Standard web obfuscation layers.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  🤖 The "AI" Auto-Decryptor
&lt;/h3&gt;

&lt;p&gt;This is my favorite feature. In the &lt;strong&gt;Decryptor&lt;/strong&gt; section, you don't need to select which algorithm was used.&lt;br&gt;
The engine automatically scans the code using RegEx patterns and heuristically detects the layers (Base64 -&amp;gt; Zlib -&amp;gt; XOR -&amp;gt; Blob) to recover the source code instantly!&lt;/p&gt;




&lt;h2&gt;
  
  
  📱 Mobile Responsive &amp;amp; Cyberpunk UI
&lt;/h2&gt;

&lt;p&gt;I spent a lot of time polishing the UI. It features a dark "Cyberpunk" theme with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CodeMirror&lt;/strong&gt; integration for syntax highlighting.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Client-Side Processing:&lt;/strong&gt; Files are downloaded directly from the browser (No server size limits!).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fully Responsive:&lt;/strong&gt; Works perfectly on mobile devices with a custom sidebar layout.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛠️ Tech Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Backend:&lt;/strong&gt; Python (Flask)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Frontend:&lt;/strong&gt; HTML5, CSS3, JavaScript&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deployment:&lt;/strong&gt; Vercel&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Libraries:&lt;/strong&gt; &lt;code&gt;ast&lt;/code&gt;, &lt;code&gt;zlib&lt;/code&gt;, &lt;code&gt;base64&lt;/code&gt;, &lt;code&gt;codemirror&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚀 API Access
&lt;/h2&gt;

&lt;p&gt;I also built a public API for developers who want to integrate this protection into their CI/CD pipelines.&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;
python
import requests

url = "[https://euro-moscow-shield.vercel.app/process](https://euro-moscow-shield.vercel.app/process)"

payload = {
    "code": "print('Hello Dev.to')",
    "action": "encrypt",
    "lang": "python",
    "options": ["rename", "marshal", "xor"]
}

response = requests.post(url, json=payload)
print(response.json()['result'])

🙌 Feedback
I built this project to help the community protect their open-source tools and bots. I would love to hear your feedback, suggestions, or bug reports!

If you find it useful, please give it a Star ⭐ on GitHub!

Happy Coding! 💻
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>showdev</category>
      <category>python</category>
      <category>javascript</category>
      <category>security</category>
    </item>
  </channel>
</rss>
