<?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: Jui Barmukh</title>
    <description>The latest articles on DEV Community by Jui Barmukh (@jui_antigravity_1707).</description>
    <link>https://dev.to/jui_antigravity_1707</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%2F4144572%2F442055b9-2671-4eed-9dc2-50742c2fd8e4.jpg</url>
      <title>DEV Community: Jui Barmukh</title>
      <link>https://dev.to/jui_antigravity_1707</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jui_antigravity_1707"/>
    <language>en</language>
    <item>
      <title>Building a C++ File Encryptor: Practical Cryptography &amp; File I/O for Beginners</title>
      <dc:creator>Jui Barmukh</dc:creator>
      <pubDate>Sat, 26 Sep 2026 16:39:45 +0000</pubDate>
      <link>https://dev.to/jui_antigravity_1707/building-a-c-file-encryptor-practical-cryptography-file-io-for-beginners-40e3</link>
      <guid>https://dev.to/jui_antigravity_1707/building-a-c-file-encryptor-practical-cryptography-file-io-for-beginners-40e3</guid>
      <description>&lt;p&gt;&lt;strong&gt;&lt;em&gt;Before my Computer Science engineering journey officially kicked off&lt;/em&gt;&lt;/strong&gt;, I decided to bridge the gap between basic C++ theory and real-world application. &lt;strong&gt;My goal was simple: Take C++ standard file streams and build a utility that demonstrates fundamental data protection&lt;/strong&gt;. This led to my first project—a C++ File Encryptor and Decryptor, and also my first blog. &lt;br&gt;
At its core, file encryption relies on transforming readable plaintext into unreadable ciphertext. To achieve this in C++, I leveraged the &lt;strong&gt;&lt;/strong&gt; header file to handle file operations through &lt;strong&gt;&lt;em&gt;ifstream&lt;/em&gt;&lt;/strong&gt; (for reading) and &lt;strong&gt;&lt;em&gt;ofstream&lt;/em&gt;&lt;/strong&gt; (for writing). The &lt;strong&gt;&lt;em&gt;encryption&lt;/em&gt;&lt;/strong&gt; algorithm uses byte-level substitution via ASCII shifting. By iterating through input characters with .get(), each character’s ASCII value is shifted forward by 1: &lt;br&gt;
cpp&lt;br&gt;
while (inFile1.get(ch1)) {&lt;br&gt;
    outFile1 &amp;lt;&amp;lt; (char)(ch1 + 1);&lt;br&gt;
}&lt;br&gt;
This converts standard text into encrypted output, ensuring simple yet effective stream-level transformation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Decryption&lt;/em&gt;&lt;/strong&gt; follows the exact inverse logic. The program opens the encrypted file as an input stream, reads each character, and shifts its ASCII value backward by 1 (ch2 - 1) to restore the original plaintext file:&lt;br&gt;
cpp&lt;br&gt;
while (inFile2.get(ch2)) {&lt;br&gt;
    outFile2 &amp;lt;&amp;lt; (char)(ch2 - 1);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Building this simple tool gave me a genuine boost in confidence right before starting my CSE classes. &lt;em&gt;It forced me to pay attention to resource management, such as explicitly closing file streams (.close()) so data doesn't get corrupted or memory leaks occur&lt;/em&gt;. Working directly with ASCII character shifting opened my eyes to low-level byte manipulation, proving to me that even though basic substitution (like the classic Caesar Cipher) is simple, it lays the exact foundation needed to understand how complex, modern cryptographic systems protect data.&lt;/p&gt;

&lt;p&gt;If you remember your very first C++ project or have tips on how you mastered file handling when you started, I'd love to hear about it! Drop your thoughts or suggestions in the comments—let's chat and connect!&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>programming</category>
      <category>beginners</category>
      <category>cybersecurity</category>
    </item>
  </channel>
</rss>
