<?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 Akhilendre Singh Rawat on Medium]]></title>
        <description><![CDATA[Stories by Akhilendre Singh Rawat on Medium]]></description>
        <link>https://medium.com/@akhilendre.rawat?source=rss-86b5bc4f84e7------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*GhkZi_bwGhxmBFQ6rznq_A.jpeg</url>
            <title>Stories by Akhilendre Singh Rawat on Medium</title>
            <link>https://medium.com/@akhilendre.rawat?source=rss-86b5bc4f84e7------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 03:44:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@akhilendre.rawat/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[Understanding the Internet: A Deep Dive into How It Works]]></title>
            <link>https://medium.com/@akhilendre.rawat/understanding-the-internet-a-deep-dive-into-how-it-works-22f08ea81b55?source=rss-86b5bc4f84e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/22f08ea81b55</guid>
            <dc:creator><![CDATA[Akhilendre Singh Rawat]]></dc:creator>
            <pubDate>Sat, 01 Mar 2025 06:42:25 GMT</pubDate>
            <atom:updated>2025-03-01T06:42:25.327Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_tzNVcfkMgvo6zNJdEFl5A.jpeg" /></figure><h3>What is the Internet?</h3><p>The Internet is a vast global network of computers connected to each other, enabling communication through standardized protocols. It allows the exchange of information, enabling users to access websites, send emails, and communicate in real-time across the globe.</p><h3>How Does Information Travel on the Internet?</h3><p>Information on the internet moves from one computer to another in the form of <strong>bits</strong> over various mediums, including:</p><ul><li><strong>Ethernet</strong> (wired connections in local networks)</li><li><strong>Fiber optic cables</strong> (high-speed data transmission over long distances)</li><li><strong>Wireless signals</strong> (radio waves used for Wi-Fi and mobile networks)</li></ul><h3>Protocols: The Rules of Communication</h3><p>A <strong>protocol</strong> is a well-defined set of rules and standards used for communication between machines. These protocols ensure seamless data exchange and interoperability between different devices and networks.</p><h3>Internet Protocol (IP)</h3><p>Every device connected to the internet has a unique identifier called an <strong>IP Address (Internet Protocol Address)</strong>. This helps in routing data packets between devices efficiently.</p><h3>Domain Name System (DNS)</h3><p>The <strong>Domain Name System (DNS)</strong> associates human-readable domain names (like www.example.com) with their corresponding IP addresses, allowing users to access websites without remembering numerical IP addresses.</p><h3>DNS Hierarchy</h3><p>DNS servers are structured in a hierarchical manner to efficiently resolve domain names.</p><h3>DNS Spoofing</h3><p><strong>DNS spoofing</strong> is a cyberattack where hackers manipulate DNS records to redirect users to malicious websites, stealing sensitive information in the process.</p><h3>Data Transmission: Packets and Routing</h3><p>Data on the internet is transmitted in small units called <strong>packets</strong>. These packets travel across the network, often taking different routes to reach their destination.</p><h3>Role of Routers</h3><p>Special computers called <strong>routers</strong> act as traffic managers, ensuring that packets are efficiently directed to their destinations.</p><h3>Fault Tolerance</h3><p>Since packets have no fixed route, the <strong>Internet Protocol (IP)</strong> enables routers to maintain multiple paths for sending data, ensuring <strong>fault tolerance</strong> and continuous communication even if some routes fail.</p><h3>Key Communication Protocols</h3><h3>TCP (Transmission Control Protocol)</h3><p>TCP ensures reliable delivery of data packets by managing their sending and receiving. It verifies that all packets arrive correctly and in the proper order.</p><h3>HTTP (HyperText Transfer Protocol)</h3><p>HTTP is the protocol used for communication between web browsers and web servers, enabling the retrieval of web pages and online content.</p><h3>Securing Internet Communication</h3><h3>SSL/TLS (Secure Socket Layer/Transport Layer Security)</h3><p><strong>SSL/TLS</strong> provides a secure communication channel between web browsers and servers. It does this by encrypting data, preventing hackers from intercepting sensitive information.</p><h4>SSL/TLS Digital Certificates</h4><p>A <strong>digital certificate</strong> serves as an official ID for a website, proving its authenticity.</p><h3>Encryption and Decryption</h3><ul><li><strong>Encryption</strong>: The process of scrambling or altering a message to hide its original content.</li><li><strong>Decryption</strong>: The process of restoring an encrypted message to its original form.</li></ul><h3>Types of Encryption</h3><ul><li><strong>Symmetric Encryption</strong>: The sender and receiver use the same key to encrypt and decrypt data.</li><li><strong>Asymmetric Encryption</strong>: A <strong>public key</strong> is used to encrypt data, and only the corresponding <strong>private key</strong> can decrypt it. This is commonly used in SSL/TLS for secure communication.</li></ul><h3>Cybersecurity Threats on the Internet</h3><h3>DDoS (Distributed Denial of Service)</h3><p>A <strong>DDoS attack</strong> occurs when hackers overwhelm a website with excessive traffic, rendering it inaccessible to legitimate users.</p><h3>Phishing Attacks</h3><p>A <strong>phishing attack</strong> tricks users into providing sensitive personal information (such as passwords and credit card details) by disguising malicious websites or emails as legitimate sources.</p><h3>Conclusion</h3><p>The internet has transformed the way we communicate, work, and access information. However, understanding its underlying principles, protocols, and security measures is crucial for safe and efficient usage. By implementing strong security practices like encryption, SSL/TLS, and cybersecurity awareness, we can ensure a safer digital experience for everyone.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=22f08ea81b55" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Web Security: Understanding and Preventing Common Attacks]]></title>
            <link>https://medium.com/@akhilendre.rawat/web-security-understanding-and-preventing-common-attacks-f7de437ab0df?source=rss-86b5bc4f84e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7de437ab0df</guid>
            <dc:creator><![CDATA[Akhilendre Singh Rawat]]></dc:creator>
            <pubDate>Fri, 28 Feb 2025 08:35:13 GMT</pubDate>
            <atom:updated>2025-02-28T08:36:44.830Z</atom:updated>
            <content:encoded><![CDATA[<p>Web security is a crucial aspect of modern web development, ensuring applications are protected against various vulnerabilities. In this blog, we’ll discuss some of the most common security threats and how to mitigate them, along with real-world examples of attacks.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*10w1Rl085BACdXf0xvUDqA.jpeg" /></figure><h3>1. CORS (Cross-Origin Resource Sharing)</h3><h3>What is CORS?</h3><p>CORS is a browser security feature that enforces the Same-Origin Policy (SOP), restricting web pages from making requests to a different origin unless explicitly allowed by the server.</p><h3>Real-World Example:</h3><p>In 2019, a misconfigured CORS policy in an API allowed attackers to access sensitive user data by exploiting open CORS settings. The attacker’s malicious website made API requests on behalf of victims, leaking private data.</p><h3>Prevention Strategies:</h3><ul><li>Always set a specific and trusted origin (Access-Control-Allow-Origin: <a href="https://trusted-site.com)./">https://trusted-site.com).</a></li><li>Restrict methods and headers using Access-Control-Allow-Methods and Access-Control-Allow-Headers.</li><li>Use authentication tokens instead of relying on CORS for security.</li></ul><h3>2. CSRF (Cross-Site Request Forgery)</h3><h3>What is CSRF?</h3><p>CSRF tricks an authenticated user into performing unwanted actions on a trusted website by sending unauthorized requests.</p><h3>Real-World Example:</h3><p>A CSRF attack targeted a banking website, tricking users into transferring funds by embedding an invisible request inside an email. Users, while logged in, unknowingly executed the transaction just by opening the email.</p><h3>Prevention Strategies:</h3><ul><li>Implement CSRF tokens, a unique value sent with each request and verified by the server.</li><li>Use SameSite cookies (SameSite=Strict or SameSite=Lax to prevent automatic cookie submission in cross-site requests).</li><li>Validate the Origin and Referer headers to ensure requests come from the expected site.</li><li>Disable GET requests for sensitive actions like fund transfers or account changes.</li></ul><h3>3. XSS (Cross-Site Scripting)</h3><h3>What is XSS?</h3><p>XSS allows attackers to inject malicious scripts into web pages viewed by other users, potentially stealing data or manipulating site behavior.</p><h3>Real-World Example:</h3><p>In 2014, eBay suffered a Stored XSS attack where attackers injected malicious JavaScript into product listings. When users viewed these listings, the script executed, redirecting them to phishing pages.</p><h3>Prevention Strategies:</h3><ul><li>Escape and sanitize user input before rendering it.</li><li>Avoid using dangerouslySetInnerHTML in React.</li><li>Implement a strong <strong>Content Security Policy (CSP)</strong>.</li><li>Encode output using libraries like DOMPurify or encodeURIComponent() for URL parameters.</li></ul><h3>4. CSP (Content Security Policy)</h3><h3>What is CSP?</h3><p>CSP is a browser security feature that prevents the execution of unauthorized scripts, mitigating XSS and other injection attacks.</p><h3>Real-World Example:</h3><p>A social media platform suffered an XSS attack because it lacked a CSP. The attacker injected a malicious script that stole users’ session tokens, granting unauthorized access to their accounts.</p><h3>Prevention Strategies:</h3><ul><li>Use a strict CSP header: Content-Security-Policy: default-src &#39;self&#39;; script-src &#39;self&#39; &#39;nonce-randomValue&#39;.</li><li>Avoid inline JavaScript by using <strong>nonce</strong> values.</li><li>Restrict third-party content loading to trusted sources.</li></ul><h3>5. Clickjacking (UI Redress Attack)</h3><h3>What is Clickjacking?</h3><p>Clickjacking is an attack where a user is tricked into clicking something they didn’t intend by overlaying transparent elements over a legitimate page.</p><h3>Real-World Example:</h3><p>In a famous case, attackers tricked Facebook users into liking pages or sharing content by embedding Facebook’s like button inside an invisible iframe.</p><h3>Prevention Strategies:</h3><ul><li>Use the X-Frame-Options header: DENY or SAMEORIGIN.</li><li>Implement CSP frame restrictions: Content-Security-Policy: frame-ancestors &#39;none&#39;;.</li><li>Disable embedding by external sites unless explicitly required.</li></ul><h3>6. SQL Injection</h3><h3>What is SQL Injection?</h3><p>SQL Injection occurs when an attacker manipulates a web application’s database queries by injecting malicious SQL code into input fields.</p><h3>Real-World Example:</h3><p>In 2008, a major SQL Injection attack on Heartland Payment Systems exposed 134 million credit card records, costing the company millions in fines and lawsuits.</p><h3>Prevention Strategies:</h3><ul><li>Use <strong>prepared statements</strong> and <strong>parameterized queries</strong> instead of string concatenation.</li><li>Validate and sanitize all user inputs.</li><li>Implement <strong>least privilege access</strong> for database users.</li><li>Monitor and log SQL queries to detect anomalies.</li></ul><h3>7. JWT Security</h3><h3>What is JWT Security?</h3><p>JSON Web Tokens (JWTs) are used for authentication and authorization, but improper implementation can lead to vulnerabilities.</p><h3>Prevention Strategies:</h3><ul><li>Always use a strong signing algorithm (HS256 or RS256).</li><li>Store JWTs securely (avoid localStorage, prefer HttpOnly cookies).</li><li>Implement short expiration times and refresh tokens.</li><li>Validate JWTs properly on the server side.</li></ul><h3>Conclusion</h3><p>Web security is an ongoing challenge, requiring continuous vigilance and best practices. By understanding and mitigating threats like CORS misconfigurations, CSRF, XSS, CSP bypass, Clickjacking, SQL Injection, and JWT vulnerabilities, developers can build safer applications.</p><p>By following these preventive measures, you can ensure your application remains resilient against attacks and protects users’ sensitive data.</p><p><strong>Stay secure, stay vigilant! 🚀</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7de437ab0df" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Multiplayer Chess Game: Challenges, Logic, and Future Plans]]></title>
            <link>https://medium.com/@akhilendre.rawat/building-a-multiplayer-chess-game-challenges-logic-and-future-plans-6ac2e8152ea7?source=rss-86b5bc4f84e7------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ac2e8152ea7</guid>
            <dc:creator><![CDATA[Akhilendre Singh Rawat]]></dc:creator>
            <pubDate>Thu, 19 Sep 2024 18:32:11 GMT</pubDate>
            <atom:updated>2024-09-19T18:32:11.272Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Introduction:</strong> Building a multiplayer chess game has been an incredible learning experience. This project not only allowed me to hone my skills in Node.js, React, and API design, but also gave me the opportunity to solve complex chess mechanics. Here’s a breakdown of the development process, challenges faced, and future plans for scalability.</p><p><strong>1. Tech Stack &amp; Architecture:</strong></p><p><strong>Backend:</strong></p><ul><li>I used <strong>Node.js</strong> with <strong>Express</strong> to handle the core game logic. Each chess move is validated server-side, ensuring adherence to official chess rules. Instead of using WebSockets for real-time communication, I opted for API-based communication to focus on the game mechanics first. <a href="https://github.com/AkhilendreSinghRawat/Chess-BE"><strong>GitHub Repo (Backend)</strong></a></li></ul><p><strong>Frontend:</strong></p><ul><li>The frontend was built using <strong>React.js</strong> with <strong>Vite</strong>, offering fast and efficient development. React handles the chessboard UI and player interactions, while API calls update the game state on each move. <a href="https://github.com/AkhilendreSinghRawat/Chess-FE"><strong>GitHub Repo (Frontend)</strong></a></li></ul><p><strong>Deployment:</strong></p><ul><li>Both the backend and frontend were deployed on <strong>Vercel</strong>, a great platform for quick deployment and global accessibility. You can play the game here: <a href="https://chess-fe-delta.vercel.app/"><strong>Deployed Game Link</strong></a>.</li></ul><p><strong>2. Chess Mechanics &amp; Complex Moves:</strong></p><p>The real challenge was implementing the complex logic for various chess moves. Here’s how I handled the most difficult ones:</p><ul><li><strong>Castling:</strong><br>This move required validation to ensure that neither the king nor the rook had moved earlier in the game. Additionally, the king must not pass through or land in a square that is under attack. Implementing castling added depth to the game logic and was one of the more rewarding features to get right.</li><li><strong>En Passant:</strong><br>This special pawn capture required tracking when a pawn advanced two squares forward. The backend had to account for the specific conditions under which en passant could occur and validate the capture accordingly.</li><li><strong>Pawn Promotion:</strong><br>When a pawn reaches the opponent’s back rank, the player can promote it to any piece. I added options for queen, rook, knight, or bishop, each of which altered the game dynamics significantly.</li><li><strong>Check and Checkmate:</strong><br>Constantly checking whether a player is in check and only allowing legal moves was a major challenge. The logic had to ensure that the game state was valid after every move, and when the king was in check, only moves that resolved the check were permitted. This feature really brought the game to life.</li></ul><p><strong>3. Challenges &amp; Solutions:</strong></p><ul><li><strong>Move Validation:</strong><br>The biggest challenge was making sure that every move adhered to chess rules. Each piece has its unique movement patterns, and interactions between pieces added complexity. By building separate validation functions for each piece, I was able to manage the logic effectively.</li><li><strong>Handling Edge Cases:</strong><br>Chess has many unique situations, like stalemates and insufficient material. Implementing logic to detect these scenarios required a lot of testing and fine-tuning.</li><li><strong>API-based Communication:</strong><br>While API calls were not real-time, they offered simplicity in the initial version. One challenge was ensuring that the frontend and backend remained in sync after each move, especially when handling invalid moves or illegal states.</li></ul><p><strong>4. Future Scalability &amp; Enhancements:</strong></p><ul><li><strong>Online Multiplayer:</strong><br>My next goal is to implement online multiplayer functionality. This would involve adding user authentication, player matching, and game history tracking.</li><li><strong>Real-time Communication:</strong><br>Currently, the game uses API calls for move validation and updates. However, switching to WebSockets would enable real-time communication, improving the overall player experience.</li><li><strong>Leaderboards and Rankings:</strong><br>As the game evolves, introducing player rankings, leaderboards, and competitive elements could enhance engagement.</li></ul><p><strong>5. Conclusion:</strong> This project was a fulfilling deep dive into chess mechanics, game logic, and API design. It not only tested my coding skills but also challenged my ability to solve problems creatively. I’m looking forward to scaling the game and turning it into a full-fledged multiplayer experience.</p><p>Feel free to check out the live version of the game here: <a href="https://chess-fe-delta.vercel.app/"><strong>Deployed Game Link</strong></a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ac2e8152ea7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>