<?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>Forem: M B Parvez Ron</title>
    <description>The latest articles on Forem by M B Parvez Ron (@mbparvezme).</description>
    <link>https://forem.com/mbparvezme</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F736530%2F65b872c6-d659-4885-9e68-8010be70ad60.jpeg</url>
      <title>Forem: M B Parvez Ron</title>
      <link>https://forem.com/mbparvezme</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mbparvezme"/>
    <language>en</language>
    <item>
      <title>Stop Storing Plain Text in LocalStorage: End-to-End Encryption - Finally Simple</title>
      <dc:creator>M B Parvez Ron</dc:creator>
      <pubDate>Tue, 25 Nov 2025 18:57:34 +0000</pubDate>
      <link>https://forem.com/mbparvezme/stop-storing-plain-text-in-localstorage-end-to-end-encryption-finally-simple-h6i</link>
      <guid>https://forem.com/mbparvezme/stop-storing-plain-text-in-localstorage-end-to-end-encryption-finally-simple-h6i</guid>
      <description>&lt;p&gt;Hey friends! 👋&lt;/p&gt;

&lt;p&gt;Have you ever stored something in your browser's Local Storage - maybe an API key or some user settings - and felt a little bit... guilty? You know, that feeling of "&lt;em&gt;I hope nobody looks in the Application tab and sees this.&lt;/em&gt;"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Let me know if you try the &lt;em&gt;Encryption in HTML&lt;/em&gt; feature.&lt;br&gt;
It’s my favorite!&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Or imagine, you want to send a private PDF to a client. You don't want to just attach it to an email where anyone could intercept it. You want to feel like a secret agent passing a locked briefcase.&lt;/p&gt;

&lt;p&gt;We all have data we want to keep private. But usually, we skip it because we think, "Eh, adding encryption is too much work."&lt;/p&gt;

&lt;p&gt;Well, not anymore. Meet &lt;strong&gt;DataCrypt&lt;/strong&gt;. It’s a tiny tool I built to make you feel like a privacy pro, without writing complex code.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Did I Build This?
&lt;/h2&gt;

&lt;p&gt;As a Full Stack Developer, two specific things constantly bugged me, which eventually led to &lt;strong&gt;DataCrypt&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;The Local Storage Problem&lt;/strong&gt;: I use Local Storage a lot because it is fast and easy. But saving sensitive data there in plain text always felt unsafe. I needed a quick way to "lock" that data before saving it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The "End-to-End" Curiosity&lt;/strong&gt;: I saw apps like WhatsApp saying "End-to-End Encrypted" and I really wanted to know - how can I build that for my own apps?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I looked for existing libraries, but they were either too complicated or too heavy. So, I decided to build &lt;strong&gt;DataCrypt&lt;/strong&gt; to solve these issues simply and efficiently.&lt;/p&gt;

&lt;h2&gt;
  
  
  Feature Discovery: What’s Inside?
&lt;/h2&gt;

&lt;p&gt;DataCrypt isn't just another library; it's a lightweight toolkit for developers.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Zero Dependencies&lt;/strong&gt;: This is huge. It uses the browser's own engine (Web Crypto API). No heavy node_modules.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Write Once, Run Everywhere&lt;/strong&gt;: Use the same code on your Node.js server and your React/Vue frontend.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Smart Compression&lt;/strong&gt;: Encrypting a big file? DataCrypt automatically zips it (using GZIP) so it takes less space.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The "Magic" HTML&lt;/strong&gt;: This is the coolest feature. You can turn any file into a standalone HTML page. You send the HTML file, and it asks for a password to open!&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How Does It Help You?
&lt;/h2&gt;

&lt;p&gt;Let’s look at 3 scenarios where DataCrypt saves the day.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;The "Guilt-Free" Local Storage: Stop saving plain text in the browser. Encrypt it first!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scenario&lt;/strong&gt;: You want to save a user's configuration or a temporary auth token.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;: Pass it through DataCrypt with a user-specific password. Now, even if a malicious browser extension tries to steal the data, they just get a bunch of random gibberish.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Implementing Zero-Knowledge Architecture (The "Trustless" Model)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scenario&lt;/strong&gt;: In traditional apps, the server holds the keys to the data. If your database is hacked, or if a rogue employee accesses the admin panel, your users' sensitive data (like medical records, financial details, or intellectual property) is exposed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;: Adopt a &lt;strong&gt;Zero-Knowledge Architecture&lt;/strong&gt; using DataCrypt.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User types note.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Browser&lt;/strong&gt; encrypts it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Server&lt;/strong&gt; saves the encrypted text. Because the server never sees the password, the data is 100% private to the user.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Sending Files Like A Pro&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Scenario&lt;/strong&gt;: You need to send a sensitive document to a client via Slack or Email.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution&lt;/strong&gt;: Don't send the PDF directly. Use DataCrypt to wrap it in a password-protected HTML file. The client downloads the HTML, enters the password, and boom - the PDF unlocks. No software needed on their side!&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Let’s Code
&lt;/h2&gt;

&lt;p&gt;Installing is just one line, zero dependency, no configuration required:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;data-crypt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The Code Demo&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here is how easy it is to lock and unlock data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;DataCrypt&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;data-crypt&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;mySecret&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;I ate the last slice of pizza 🍕&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;password&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;super-strong-password&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// 🔒 Lock it&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;lockedData&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;DataCrypt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encrypt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mySecret&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;password&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;lockedData&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Output: U2FsdGVkX1... (Encrypted string)&lt;/span&gt;

&lt;span class="c1"&gt;// 🔓 Unlock it&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;original&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;DataCrypt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;decrypt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;lockedData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;password&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;original&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// "I ate the last slice of pizza 🍕"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The CLI Magic (No Code Needed)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can even use it directly in your terminal!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Encrypt text&lt;/span&gt;
dc encrypt &lt;span class="s2"&gt;"A simple secret text"&lt;/span&gt; &lt;span class="s2"&gt;"my-password"&lt;/span&gt;

&lt;span class="c"&gt;# Decrypt text&lt;/span&gt;
dc decrypt &lt;span class="s2"&gt;"H/9kQK......"&lt;/span&gt; &lt;span class="s2"&gt;"my-password"&lt;/span&gt;

&lt;span class="c"&gt;# Encrypt a file and compress (-z) it&lt;/span&gt;
dc encrypt &lt;span class="nt"&gt;-f&lt;/span&gt; server.log &lt;span class="nt"&gt;-o&lt;/span&gt; server.enc &lt;span class="nt"&gt;-z&lt;/span&gt; &lt;span class="s2"&gt;"my-password"&lt;/span&gt;

&lt;span class="c"&gt;# Decrypt file (auto decompression)&lt;/span&gt;
dc deencrypt &lt;span class="nt"&gt;-f&lt;/span&gt; server.enc &lt;span class="s2"&gt;"my-password"&lt;/span&gt;

&lt;span class="c"&gt;# Create that magic HTML file for your friend&lt;/span&gt;
dc encrypt &lt;span class="nt"&gt;-f&lt;/span&gt; secret.pdf &lt;span class="nt"&gt;-o&lt;/span&gt; open_me.html &lt;span class="nt"&gt;--html&lt;/span&gt; &lt;span class="s2"&gt;"securePass123"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Please visit the &lt;a href="https://github.com/mbparvezme/data-crypt/blob/main/README.md" rel="noopener noreferrer"&gt;README.me&lt;/a&gt; file for more example and API references&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Wrapping Up&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I built DataCrypt because I wanted to make data privacy fun and easy, not a chore. Whether you are building the next big secure chat app or just want to hide some settings in local storage, I hope this tool helps you out.&lt;/p&gt;

&lt;p&gt;Give it a spin!&lt;/p&gt;




&lt;p&gt;🔗 Visit the &lt;a href="https://github.com/mbparvezme/data-crypt" rel="noopener noreferrer"&gt;Github&lt;/a&gt; repo to submit an issue or contribute&lt;br&gt;
📦 NPM: &lt;a href="https://www.npmjs.com/package/data-crypt" rel="noopener noreferrer"&gt;npm install data-crypt&lt;/a&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>tooling</category>
    </item>
  </channel>
</rss>
