<?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 Anonymous_User on Medium]]></title>
        <description><![CDATA[Stories by Anonymous_User on Medium]]></description>
        <link>https://medium.com/@temporyemail123321?source=rss-07efb06986f9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*7yDLE13odZvgcwvOyjLAWw.png</url>
            <title>Stories by Anonymous_User on Medium</title>
            <link>https://medium.com/@temporyemail123321?source=rss-07efb06986f9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 16:23:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@temporyemail123321/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[Network Fundamentals for System Design: The Building Blocks of Scalable Distributed Systems]]></title>
            <link>https://medium.com/@temporyemail123321/network-fundamentals-for-system-design-the-building-blocks-of-scalable-distributed-systems-65bfdf6a55b6?source=rss-07efb06986f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/65bfdf6a55b6</guid>
            <category><![CDATA[computer-networking]]></category>
            <category><![CDATA[reverse-proxy]]></category>
            <category><![CDATA[osi-model]]></category>
            <category><![CDATA[system-design-concepts]]></category>
            <category><![CDATA[dns-servers]]></category>
            <dc:creator><![CDATA[Anonymous_User]]></dc:creator>
            <pubDate>Mon, 10 Aug 2026 06:16:19 GMT</pubDate>
            <atom:updated>2026-08-10T06:16:19.421Z</atom:updated>
            <content:encoded><![CDATA[<p>Computer networking is the foundation of modern digital communication. Whenever we send a WhatsApp message, open a website, watch a YouTube video, transfer a file, or access an application hosted on a remote server, multiple networking protocols work together behind the scenes to deliver data from the source device to the destination device. Although this communication appears simple to the user, the actual process involves addressing, routing, error detection, segmentation, transmission, and many other operations.</p><p>To understand how this communication takes place, networking engineers use <strong>layered models</strong>. The two most important networking models are the <strong>OSI (Open Systems Interconnection) model</strong> and the <strong>TCP/IP model</strong>. These models divide network communication into different layers, where each layer performs a specific responsibility and communicates with the layer directly</p><h3>Networking Model</h3><p>A networking model is a conceptual framework that explains how different components of a computer network communicate with each other. Instead of treating network communication as one complicated process, a networking model divides it into multiple layers. Each layer has a specific responsibility and provides services to the layer above it.</p><p>This layered architecture makes networking easier to design, implement, troubleshoot, and maintain. For example, if there is a problem with a network cable, engineers can investigate the Physical Layer without necessarily analyzing the application software. Similarly, if a website cannot be reached because of an IP routing problem, the Network Layer can be investigated independently from the web application’s logic.</p><p>One of the most important concepts in layered networking is <strong>encapsulation</strong>. When an application generates data, each lower layer adds its own control information, usually in the form of a header and sometimes a trailer. This produces different Protocol Data Units (PDUs) as the data moves down the stack.</p><p>The general process can be represented as:</p><p><strong>Data → Segment → Packet → Frame → Bits</strong></p><p>At the destination, the opposite process occurs. This is called <strong>decapsulation</strong>, where each layer removes and processes the information added by its corresponding layer.</p><h3><strong>OSI Model</strong></h3><p>The <strong>OSI model</strong>, or Open Systems Interconnection model, was developed by the International Organization for Standardization (ISO) as a reference framework for understanding network communication. It divides communication into seven distinct layers.</p><p>Application → Presentation → Session → Transport → Network → Data Link → Physical</p><p>Each layer performs a specific function, but the layers work together to provide end-to-end communication between devices.</p><h4><strong>1. Application Layer</strong></h4><p>The <strong>Application Layer</strong> is Layer 7 of the OSI model and is the layer closest to the end user. It provides network services that applications can use to communicate over a network. It is important to understand that this layer does not mean the actual user interface of an application; instead, it defines network-related services and protocols used by applications.</p><p>For example, when you open a website in a browser, protocols such as <strong>HTTP and HTTPS</strong> are involved in communication between your browser and the web server. Similarly, <strong>DNS</strong> is used to translate domain names such as google.com into IP addresses.</p><p>Other protocols associated with this layer include <strong>SMTP</strong> for email transmission, <strong>FTP</strong> for file transfer, and <strong>DHCP</strong> for automatically obtaining network configuration information.</p><p>In simple terms, the Application Layer provides the network services that applications need to exchange information.</p><h4>2. Presentation Layer</h4><p>The <strong>Presentation Layer</strong>, Layer 6, is responsible for how data is represented, encoded, encrypted, and compressed. Its purpose is to make sure that information generated by one system can be correctly interpreted by another system.</p><p>For example, computers may represent information using different data formats. The Presentation Layer can handle data translation between these representations. It can also perform <strong>encryption and decryption</strong>, helping protect data during communication.</p><p>Data compression can also occur at this conceptual layer. Compression reduces the amount of data that needs to be transmitted, which can improve network efficiency.</p><p>A practical example is encrypted communication. When you access a website using HTTPS, cryptographic mechanisms are used to protect the information exchanged between your browser and the server.</p><h4>3. Session Layer</h4><p>The <strong>Session Layer</strong>, Layer 5, manages communication sessions between applications. A session represents an established interaction between two communicating systems.</p><p>The Session Layer is responsible conceptually for establishing, maintaining, synchronizing, and terminating communication sessions. If a long communication contains multiple operations, synchronization points can help systems manage the communication more effectively.</p><p>For example, imagine transferring a large amount of information between two systems. If the communication is interrupted, synchronization mechanisms can allow the communication process to resume from an appropriate point rather than restarting the entire operation.</p><p>In modern networking, many of the responsibilities traditionally associated with the OSI Session Layer are implemented within application protocols and other layers of the TCP/IP stack.</p><h4>4. Transport Layer</h4><p>The <strong>Transport Layer</strong>, Layer 4, is one of the most important layers for end-to-end communication. It provides communication between processes running on different devices rather than simply between the devices themselves.</p><p>Two major transport protocols are <strong>TCP (Transmission Control Protocol)</strong> and <strong>UDP (User Datagram Protocol)</strong>.</p><p>TCP is connection-oriented and provides reliable, ordered delivery of data. Before exchanging application data, TCP establishes a connection using the <strong>three-way handshake</strong>, commonly represented as:</p><p><strong>SYN → SYN-ACK → ACK</strong></p><p>TCP also provides mechanisms such as sequencing, acknowledgments, retransmission, flow control, and congestion control.</p><p>UDP, on the other hand, is connectionless and has much lower protocol overhead. It does not provide TCP-style reliability and ordering. This makes UDP useful for applications where low latency is more important than guaranteed delivery, such as real-time communication, streaming, DNS, and many modern interactive applications.</p><p>The Transport Layer also uses <strong>port numbers</strong> to identify application processes. For example, HTTP commonly uses port 80, while HTTPS commonly uses port 443.</p><p>The PDU at this layer is generally called a <strong>segment</strong> for TCP and a <strong>datagram</strong> for UDP.</p><h4>5. Network Layer</h4><p>The <strong>Network Layer</strong>, Layer 3, is responsible for logical addressing and routing packets between different networks. This is where <strong>IP addressing</strong> becomes fundamental.</p><p>An IP address identifies a network interface logically within an IP network. IPv4 addresses are 32 bits long and are commonly represented in dotted-decimal notation, such as:</p><p><strong>192.168.1.10</strong></p><p>The Network Layer uses routing information to determine how packets should travel from a source network to a destination network.</p><p>Routers primarily operate at this layer because their fundamental job is to examine Layer 3 information, particularly destination IP addresses, and determine the next hop for a packet.</p><p>For example, when your laptop communicates with a server located on another network, your router examines the destination IP address and forwards the packet toward the appropriate next-hop network.</p><p>The PDU at the Network Layer is commonly called a <strong>packet</strong>.</p><h4>6. Data Link Layer</h4><p>The <strong>Data Link Layer</strong>, Layer 2, provides node-to-node delivery over a local network segment. It is responsible for functions such as framing, MAC addressing, and error detection at the link level.</p><p>Unlike an IP address, which provides logical addressing, a <strong>MAC address</strong> is associated with a network interface and is used for communication within a local Layer 2 network.</p><p>For example, when your computer sends data to another device on the same Ethernet or Wi-Fi network, Layer 2 information is used to deliver the frame across the local network.</p><p>Ethernet and Wi-Fi technologies operate primarily at this layer, although real-world technologies can span multiple conceptual layers.</p><p>The PDU at this layer is called a <strong>frame</strong>.</p><p>A Layer 2 switch examines MAC addresses to decide which interface should receive an Ethernet frame. This is why switches are commonly associated with the Data Link Layer.</p><h4>7. Physical Layer</h4><p>The <strong>Physical Layer</strong>, Layer 1, is responsible for transmitting raw bits over a physical medium or radio interface. It deals with the actual electrical, optical, or radio signals used to represent binary information.</p><p>Examples include copper Ethernet cables, fiber-optic cables, radio signals used by Wi-Fi, connectors, voltage levels, modulation, and transmission characteristics.</p><p>At this layer, the network does not understand concepts such as HTTP requests or IP packets. It simply transports a stream of bits represented through physical signals.</p><p>For example, when your computer sends binary information through an Ethernet cable, the Physical Layer converts that information into appropriate electrical signals.</p><p>The basic unit at this level is a <strong>bit</strong>.</p><h3>How Data Travels Through the OSI Model</h3><p>Suppose you open a browser and request:</p><p><a href="https://www.example.com/"><strong>https://www.example.com</strong></a></p><p>The application generates an HTTP request. As this information moves down through the networking stack, each layer performs its own function.</p><p>At the Application Layer, the HTTP request is created. The Transport Layer then uses TCP or another appropriate transport mechanism and adds transport information such as source and destination ports. The Network Layer adds IP addressing information. The Data Link Layer creates a frame containing MAC addressing information and error-detection information. Finally, the Physical Layer transmits the resulting information as bits over the network medium.</p><p>This process is called <strong>encapsulation</strong>.</p><p>At the receiving server, the process happens in reverse. The Physical Layer receives the transmitted signals, the Data Link Layer processes the frame, the Network Layer processes the IP packet, the Transport Layer processes the TCP segment or UDP datagram, and eventually the application receives the original data.</p><p>This reverse process is called <strong>decapsulation</strong>.</p><h3>TCP/IP Model</h3><p>The <strong>TCP/IP model</strong> is the protocol architecture associated with the Internet. Unlike the seven-layer OSI reference model, TCP/IP is commonly represented using four layers:</p><p><strong>Application → Transport → Internet → Network Access</strong></p><p>Some textbooks use a five-layer Internet model by separating the Data Link and Physical functions. However, the classic TCP/IP model generally combines those functions into the Network Access or Link layer.</p><p>The TCP/IP architecture is important because it describes the actual protocol suite used for communication across the Internet.</p><h4>1. Application Layer of TCP/IP</h4><p>The TCP/IP Application Layer combines many of the responsibilities represented by the OSI Application, Presentation, and Session layers.</p><p>Protocols such as <strong>HTTP, HTTPS, DNS, SMTP, FTP, and DHCP</strong> operate within this broader application layer.</p><p>For example, when a browser requests a web page, HTTP or HTTPS defines how the browser communicates with the web server. DNS can resolve the server’s domain name into an IP address before the connection is established.</p><p>Unlike the OSI model, TCP/IP does not require separate Presentation and Session layers. Their responsibilities can be implemented by application protocols or libraries when necessary.</p><h4>2. Transport Layer of TCP/IP</h4><p>The TCP/IP Transport Layer provides process-to-process communication using protocols such as TCP and UDP.</p><p>TCP provides reliable byte-stream delivery, sequencing, acknowledgments, retransmissions, flow control, and congestion control. UDP provides a lightweight datagram service with minimal overhead.</p><p>Port numbers allow multiple applications to use the same network interface simultaneously.</p><p>For example, a computer can simultaneously communicate with a web server using HTTPS, a DNS server using DNS, and another service using a different port. The transport layer uses port numbers to help deliver received data to the appropriate process.</p><h4>3. Internet Layer of TCP/IP</h4><p>The Internet Layer is responsible for logical addressing and packet delivery between networks.</p><p>The primary protocol is <strong>IP (Internet Protocol)</strong>. IPv4 and IPv6 provide addressing and packet delivery mechanisms.</p><p>The Internet Layer is responsible for getting packets from one network to another through interconnected routers.</p><p>For example, if your laptop is connected to a home network and the destination server is located in another country, the packet may pass through many routers before reaching the destination network.</p><p>Each router examines the packet’s destination IP address and determines the next hop according to its routing table.</p><h4>4. Network Access Layer</h4><p>The Network Access Layer handles communication over the local network technology. It combines responsibilities that the OSI model separates into the Data Link and Physical layers.</p><p>Technologies such as Ethernet and Wi-Fi provide mechanisms for transmitting data over local network links.</p><p>At this level, frames are transmitted using mechanisms defined by the particular link technology. The actual physical medium may be copper, fiber, or radio.</p><p>The TCP/IP architecture is important because it describes the actual protocol suite used for communication across the Internet.</p><h3>Domain Name System (DNS)</h3><p>The Domain Name System (DNS) is a distributed, hierarchical naming system that translates human-readable domain names such as example.com into information that networked systems can use, most commonly IP addresses. People prefer names because they are easier to remember than numerical IPv4 or IPv6 addresses, while network communication ultimately needs an address to identify the destination. DNS therefore acts as a naming layer between applications and the addressing infrastructure of IP networks. DNS is not a single database or a single server, it is a globally distributed system made up of caches, recursive resolvers, root servers, Top-Level Domain (TLD) infrastructure, and authoritative name servers.</p><h4>1. The DNS Resolver: The Client’s Middleman</h4><p>A DNS resolver is the component that receives a DNS question and obtains an answer. The client device normally uses a stub resolver in the operating system or a local DNS service. The stub resolver is intentionally lightweight: it sends the query to a configured recursive resolver rather than performing the complete DNS hierarchy lookup itself. The recursive resolver may be operated by an Internet Service Provider (ISP), an enterprise, a university, a cloud provider, or a public DNS service.</p><p>The recursive resolver is called recursive because the client expects it to obtain the final answer on the client’s behalf. If the resolver already has a valid cached record, it can answer immediately. If it does not have the answer, it performs the necessary iterative queries to the DNS hierarchy, follows referrals, obtains the authoritative record, stores it in cache according to its Time To Live (TTL), and returns the response to the client.</p><p>This distinction is important: the client usually sends one query to the recursive resolver, while the recursive resolver may communicate with several DNS servers to obtain the final answer.</p><h4>2. DNS Hierarchy: Root, TLD and Authoritative Servers</h4><p>DNS is organized hierarchically. At the top is the root zone, represented by a dot (.). Root DNS infrastructure does not normally contain the final IP address for every domain on the Internet. Instead, root servers provide referrals that tell a recursive resolver which name servers are responsible for a particular Top-Level Domain, such as .com, .org, .net, or a country-code TLD such as .pk.</p><p>Below the root are TLD servers or TLD DNS infrastructure. A TLD server is responsible for information about domains registered under that TLD. For example, when resolving example.com, the .com infrastructure can direct the recursive resolver toward the authoritative name servers for example.com. The TLD server generally does not provide the final A or AAAA record for example.com; it provides a delegation to the domain’s authoritative name servers.</p><p>The authoritative DNS server is the server that holds the DNS records for a particular zone. For example, the authoritative servers for example.com contain records such as A, AAAA, MX, TXT, CNAME, and NS records according to the domain’s configuration. When the recursive resolver reaches the authoritative server, it can obtain the actual answer for the requested name.</p><h4>3. Country Servers: What a ccTLD Really Means</h4><p>A common beginner misunderstanding is to call .pk, .uk, or .de a ‘country server’. More accurately, these are country-code Top-Level Domains (ccTLDs). A ccTLD is part of the DNS namespace and is operated through distributed DNS infrastructure and registry systems; it is not a single physical server located in that country.</p><p>For a domain such as example.pk, a recursive resolver can query the root infrastructure, receive a referral to the .pk TLD infrastructure, query the .pk TLD infrastructure, and then receive a delegation to the authoritative name servers for example.pk. The authoritative servers then provide the actual DNS records for the domain.</p><h4>4. ISP Role in DNS</h4><p>An <strong>ISP</strong> usually provides a <strong>recursive DNS resolver</strong> to its customers.<br>DNS settings can be automatically assigned through <strong>DHCP</strong> when a device connects.<br>The resolver first checks its <strong>cache</strong> for the requested domain.<br>If no cached answer exists, it queries the <strong>DNS hierarchy</strong> to find the authoritative record.<br>Users can also configure an <strong>alternative DNS resolver</strong> instead of using the ISP’s resolver.</p><h4>5. Alternative DNS Resolvers</h4><p>An <strong>alternative DNS resolver</strong> is a recursive resolver used instead of the ISP’s DNS service.<br>Examples include <strong>Cloudflare (1.1.1.1)</strong>, <strong>Google DNS (8.8.8.8)</strong>, and <strong>Quad9 (9.9.9.9)</strong>.<br>It checks its cache and, if necessary, follows the <strong>Root → TLD → Authoritative</strong> process.<br>It does not bypass DNS; it performs the lookup on behalf of the client.<br>Different resolvers can provide different <strong>latency, privacy, filtering, reliability, and security</strong> features.</p><h4>6. DNS Caching: Why the Second Lookup Is Faster</h4><p><strong>DNS caching</strong> stores DNS records temporarily to avoid repeating the complete lookup process.<br>Each DNS record has a <strong>TTL (Time To Live)</strong> that determines how long it can remain cached.<br>Caching can occur in the <strong>browser, operating system, router, and recursive resolver</strong>.<br>If a valid cached record exists, the resolver can return the IP address without contacting Root, TLD, or Authoritative servers.<br>This reduces <strong>DNS latency, network traffic, and load on DNS infrastructure</strong>.</p><h4>7. First-Time DNS Lookup: Cache Miss</h4><p>When a domain is requested for the first time, the required DNS record may not exist in the local or resolver cache.<br>The <strong>stub resolver</strong> sends the query to the <strong>recursive resolver</strong>.<br>The recursive resolver queries <strong>Root → TLD → Authoritative DNS server</strong> to find the required record.<br>The authoritative server returns an <strong>A or AAAA record</strong>, containing the destination IP address.<br>The recursive resolver caches the result according to its <strong>TTL</strong> and sends the IP address back to the client.<br>The browser can then use this IP address to connect to the web server.</p><h4>8. DNS Request and Response</h4><p>A DNS query contains the <strong>domain name, record type, and query information</strong>.<br>Traditional DNS commonly uses <strong>UDP port 53</strong>, while TCP port 53 is also used when required.<br><strong>DNS over TLS (DoT)</strong> commonly uses TCP port <strong>853</strong>, while <strong>DNS over HTTPS (DoH)</strong> commonly uses HTTPS port <strong>443</strong>.<br>The DNS response contains the requested DNS record and related protocol information.<br>DNS only resolves the domain name; it does <strong>not download the webpage</strong>.</p><h4>9. From DNS Resolution to Web Request</h4><p>After DNS returns the destination IP address, the browser establishes a connection with the server.<br>For HTTPS over TCP, the client performs a <strong>TCP connection followed by a TLS handshake</strong>.<br>For HTTP/3, <strong>QUIC over UDP</strong> is used with TLS 1.3.<br>The browser then sends an <strong>HTTP request</strong>, and the server returns data such as HTML, CSS, JavaScript, images, or API responses.<br>Therefore, <strong>DNS resolution happens before the actual web request</strong>.</p><h4>10. Important DNS Records</h4><p><strong>A</strong> maps a domain to an IPv4 address, while <strong>AAAA</strong> maps it to an IPv6 address.<br><strong>CNAME</strong> creates an alias for another domain name.<br><strong>MX</strong> identifies mail servers, while <strong>NS</strong> identifies authoritative name servers.<br><strong>TXT</strong> stores text information commonly used for verification and email security policies.<br><strong>SOA</strong> contains important information about a DNS zone and its authoritative configuration.</p><h4>11. DNS Security and Reliability</h4><p><strong>DNSSEC</strong> uses cryptographic signatures to provide DNS data integrity and authentication.<br>However, DNSSEC does <strong>not encrypt DNS queries</strong>.<br>For DNS privacy, technologies such as <strong>DoT and DoH</strong> encrypt communication between the client and resolver.<br>DNS also uses distributed infrastructure and <strong>Anycast</strong> to improve availability, performance, and resilience.</p><h4>12. Complete First-Time DNS Flow</h4><p>The complete process is: <strong>User enters URL → Local cache check → Stub Resolver → Recursive Resolver → Root → TLD → Authoritative Server → IP Address</strong>.<br>The recursive resolver then caches the response according to its <strong>TTL</strong>.<br>The IP address is returned to the client, allowing the browser to establish the required connection.<br>On future requests, a <strong>cache hit</strong> may provide the IP address directly without contacting the Root, TLD, or Authoritative servers.</p><h4>13. Key Takeaway</h4><p>DNS is a <strong>distributed and hierarchical naming system</strong>, not a single server.<br>The <strong>recursive resolver</strong> performs the lookup, while <strong>Root and TLD servers provide referrals</strong> to the authoritative infrastructure.<br>The <strong>authoritative server</strong> provides the actual DNS records for a domain.<br>Caching improves performance, while <strong>DNSSEC, DoT, and DoH</strong> provide different security and privacy capabilities.<br>In simple terms: <strong>Resolver finds the answer → DNS hierarchy provides direction → Authoritative server provides the record → Browser uses the IP to connect to the server.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qz75woRq9YHKnVHx.png" /></figure><h3><strong>Proxy Server</strong></h3><p>A <strong>proxy server</strong>, also called a <strong>forward proxy</strong>, sits between the client and the Internet. Instead of the client communicating directly with the destination server, the proxy sends the request on the client’s behalf.</p><p><strong>Client → Proxy → Internet Server → Proxy → Client</strong></p><p>For example, when a user opens a website:</p><ol><li>The client sends the request to the proxy.</li><li>The proxy checks and forwards the request.</li><li>The destination server sees the <strong>proxy’s IP address</strong>.</li><li>The server sends the response to the proxy.</li><li>The proxy forwards the response to the client.</li></ol><h4><strong>Benefits of a Proxy</strong></h4><ul><li><strong>Privacy:</strong> Hides the client’s IP address from the destination.</li><li><strong>Access Control:</strong> Organizations can block or allow websites.</li><li><strong>Security:</strong> Can filter malicious or unwanted traffic.</li><li><strong>Caching:</strong> Stores frequently requested content to improve performance.</li><li><strong>Bandwidth Saving:</strong> Cached content reduces repeated downloads.</li></ul><p>A company may use a proxy for its employees. If many employees request the same website or resource, the proxy can <strong>cache the content</strong> and serve it directly instead of downloading it repeatedly.</p><h3><strong>Reverse Proxy</strong></h3><p>A <strong>reverse proxy</strong> sits in front of backend servers and handles incoming client requests.</p><p><strong>Client → Reverse Proxy → Backend Server</strong></p><p>Unlike a forward proxy, which protects or represents clients, a reverse proxy <strong>protects and represents servers</strong>.</p><h4>How a Reverse Proxy Works</h4><ol><li>The client sends a request to the website.</li><li>The <strong>reverse proxy receives the request first</strong>.</li><li>It decides which backend server should handle the request.</li><li>The backend server processes the request.</li><li>The reverse proxy sends the response back to the client.</li></ol><p>The client normally communicates only with the reverse proxy, not directly with the backend servers.</p><p><strong>Example:</strong></p><p><strong>Cloudflare</strong> commonly operates as a reverse proxy in front of websites.</p><p>A simplified flow is:</p><p><strong>User → Cloudflare → Origin Server</strong></p><p>Cloudflare can provide:</p><ul><li><strong>DDoS protection</strong></li><li><strong>WAF</strong></li><li><strong>Caching</strong></li><li><strong>TLS termination</strong></li><li><strong>Load balancing</strong></li><li><strong>Performance optimization</strong></li></ul><p>Instead of every request directly reaching the origin server, Cloudflare can filter, cache, or route the request before forwarding it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/0*na6DIDa9OkPkviEt.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=65bfdf6a55b6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Without hashing, the digital world would be an open door for cybercriminals.]]></title>
            <link>https://medium.com/@temporyemail123321/without-hashing-the-digital-world-would-be-an-open-door-for-cybercriminals-3c5e606d982a?source=rss-07efb06986f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c5e606d982a</guid>
            <category><![CDATA[ethical-hacking]]></category>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[hashing]]></category>
            <category><![CDATA[sha-256]]></category>
            <dc:creator><![CDATA[Anonymous_User]]></dc:creator>
            <pubDate>Tue, 21 Jul 2026 05:42:46 GMT</pubDate>
            <atom:updated>2026-07-21T05:42:46.407Z</atom:updated>
            <content:encoded><![CDATA[<p>Every time you log into a website, your password is never actually stored anywhere on the server, at least, not in the form you typed it. Every time you download a large file, there’s a way to confirm that not a single byte was altered or corrupted in transit. Every time your data moves through a blockchain, its history is provably tamper evident.</p><h3><strong>Hashing</strong></h3><p>Hashing is the process of taking an input of any size, a single word, a password, an image, or an entire multi-gigabyte file and running it through a mathematical function called a hash function. This function converts the input into a fixed-length string of characters known as a hash value, hash code, or digest. The key idea is that no matter how large or small the original input is, the resulting hash is always the same length.</p><p>For example, hashing the word “hello” and hashing an entire novel with the SHA-256 algorithm will both produce a 256-bit (64 hexadecimal character)output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*UuhbQHgFLnfS7jdRpZR_sw.png" /></figure><p>Unlike encryption, hashing is a one-way process. Encrypted data can be decrypted back to its original form using a key. Hashed data cannot be reversed back into its original input, there is no “unhash” operation. This one-directional nature is precisely what makes hashing so valuable for security. Hash is therefore irreversible.</p><h3><strong>Core Concepts and Properties of a Hash Function</strong></h3><p>Not every function that shrinks or transforms data qualifies as a good hash function. Cryptographically secure hash functions are built around six defining properties:</p><p><strong>l. Deterministic: </strong>The same input will always, every single time, produce the exact same hash output. “password123” hashed today produces the identical digest as it will next year.</p><p><strong>2. Fixed Output Size:</strong> Regardless of input length, one character or one terabyte, the digest length stays constant (e.g. always 256 bits for SHA-256). <strong>3. Fast to Compute:</strong> Generating a hash from an input should be computationally quick and efficient, even for large files.</p><p><strong>4. Pre-image Resistance (One-Way): </strong>Given only a hash output, it should be computationally infeasible to figure out what input produced it. This is the property that makes hashing irreversible.</p><p><strong>5. Avalanche Effect:</strong> A tiny change to the input even flipping a single character’s case should produce a drastically different, completely unrecognizable output.</p><p><strong>6. Collision Resistance:</strong> It should be extremely improbable for two different inputs to ever produce the same hash output. When this does happen, it’s called a hash collision, and it undermines trust in the function</p><h3><strong>Hashing for Fast Lookups</strong></h3><p>Beyond security, hashing is also a foundational tool in everyday programming. Hash tables use a hash function to convert a key (like a name or word) directly into the exact memory location where its value is stored. This means looking up data doesn’t require scanning through a list item by item, the hash function points straight to the right location, giving average-case constant time lookups, written as O(1).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N_ymlPLYhSTqsshdWhUyMg.png" /></figure><h3><strong>Common Hashing Algorithms</strong></h3><p>Over the years, several hashing algorithms have been developed to solve different security and data integrity challenges. Some algorithms were designed for speed, while others focus on providing stronger cryptographic security. Today, algorithms like <strong>SHA-256</strong>, <strong>bcrypt</strong>, and <strong>Argon2</strong> are widely trusted, whereas older algorithms such as <strong>MD5</strong> and <strong>SHA-1</strong> are considered outdated for security-sensitive applications.</p><h4>MD5 (Message Digest 5)</h4><p>MD5 generates a <strong>128-bit hash value</strong> and was once one of the most widely used hashing algorithms. Due to its speed, it is still useful for <strong>file integrity checks</strong>, <strong>checksum verification</strong>, and <strong>duplicate file detection</strong>. However, researchers have demonstrated collision attacks against MD5, making it unsuitable for storing passwords or protecting sensitive information.</p><h4>SHA-1 (Secure Hash Algorithm 1)</h4><p>SHA-1 produces a <strong>160-bit hash</strong> and was introduced as a more secure replacement for MD5. It was widely used in <strong>digital certificates</strong>, <strong>digital signatures</strong>, and is still used internally by <strong>Git</strong> to identify objects and commits. Despite these historical uses, practical collision attacks have made SHA-1 insecure for modern cryptographic applications.</p><h4>SHA-256 (Secure Hash Algorithm 256)</h4><p>SHA-256 is part of the <strong>SHA-2 family</strong> and produces a <strong>256-bit hash value</strong>. It is currently one of the most trusted and widely adopted hashing algorithms because it provides strong security while remaining efficient. SHA-256 is used in <strong>blockchain technology</strong>, <strong>SSL/TLS certificates</strong>, <strong>digital signatures</strong>, <strong>API authentication</strong>, and <strong>data integrity verification</strong>. It is the preferred choice whenever secure, general-purpose hashing is required.</p><h4>SHA-3</h4><p>SHA-3 is the newest member of the Secure Hash Algorithm family. Unlike SHA-2, it is built on a completely different cryptographic design called <strong>Keccak</strong>, making it resistant to different classes of attacks. SHA-3 is increasingly being adopted in <strong>government systems</strong>, <strong>modern cryptographic applications</strong>, and security-critical software.</p><h4>bcrypt</h4><p>Unlike MD5 and SHA algorithms, <strong>bcrypt</strong> is specifically designed for <strong>password hashing</strong> rather than general-purpose hashing. It automatically generates a unique <strong>salt</strong> for every password and intentionally performs hashing slowly, making brute-force and dictionary attacks significantly more difficult. As a result, bcrypt has become one of the most popular algorithms for storing user passwords securely.</p><h4>scrypt</h4><p>scrypt is another password hashing algorithm that improves security by requiring a large amount of memory during computation. This memory-hard design makes attacks using GPUs and specialized hardware much more expensive. It is commonly used in <strong>authentication systems</strong>, <strong>password databases</strong>, and <strong>cryptocurrency applications</strong>.</p><h4>Argon2</h4><p>Argon2 is considered the modern standard for password hashing and was the winner of the <strong>Password Hashing Competition (PHC)</strong>. It offers configurable memory usage, processing time, and parallelism, making it highly resistant to modern cracking techniques. Because of its excellent balance of security and flexibility, <strong>OWASP recommends Argon2 as the best choice for securely storing passwords in new applications</strong>.</p><h3>What Happens Without Hashing</h3><p>In today’s technology-driven world, cyberattacks and data breaches have become increasingly common, making data security a top priority for every organization. If sensitive information, especially user passwords is stored in plain text instead of being hashed, a single database breach can expose every user’s credentials instantly. Hackers do not need to crack or decrypt anything, they can simply read the passwords and use them to access accounts. Since many people reuse the same password across multiple platforms, attackers often launch <strong>credential stuffing attacks</strong>, allowing them to gain unauthorized access to email accounts, social media profiles, online banking, and other services using the same stolen credentials.</p><p>The risks are not limited to external hackers. Storing plaintext passwords also means that anyone with database access, such as employees, contractors, or administrators, can view users’ actual passwords, increasing the chances of insider misuse or accidental data exposure. Additionally, without hashing, systems cannot easily verify whether files or transmitted data have been altered, making it easier for attackers to tamper with information without being detected. This weak security approach can also lead to violations of data protection regulations such as <strong>GDPR</strong> and <strong>PCI-DSS</strong>, resulting in legal penalties, financial losses, and a significant loss of customer trust.</p><p>Hashing addresses these challenges by transforming sensitive data into a fixed-length, irreversible value before it is stored. Even if attackers manage to steal a hashed database, they cannot directly read the original passwords, making unauthorized access significantly more difficult. This is why secure hashing algorithms, combined with techniques like salting, have become a fundamental requirement in modern cybersecurity and are essential for protecting user data against today’s evolving cyber threats.</p><p>Hashing is one of the quiet, foundational tools that modern computing depends on. It doesn’t encrypt data so it can be unlocked later it fingerprints data so its authenticity and integrity can be verified without ever exposing the original content. From protecting your password the moment you sign up for a new account, to keeping blockchain transactions tamper-evident, to helping software look up massive datasets in an instant, hashing quietly secures and organizes far more of daily digital life than most people realize</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c5e606d982a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding JWT Authentication: From Session-Based Authentication to Secure Token-Based Systems]]></title>
            <link>https://medium.com/@temporyemail123321/understanding-jwt-authentication-from-session-based-authentication-to-secure-token-based-systems-89f86c781826?source=rss-07efb06986f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/89f86c781826</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[information-security]]></category>
            <dc:creator><![CDATA[Anonymous_User]]></dc:creator>
            <pubDate>Tue, 14 Jul 2026 05:57:14 GMT</pubDate>
            <atom:updated>2026-07-14T05:57:14.318Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Problem with Session-Based Authentication</h3><p>Before token-based authentication became popular, almost every web application relied on session-based authentication. In this model, a user logs in with a username and password, and the server responds by creating a session record, typically stored in memory, a database, or a cache like Redis and assigning it a unique session ID. That session ID is sent back to the browser as a cookie, and on every subsequent request the browser automatically attaches the cookie so the server can look up the session and figure out who’s making the request.</p><p>This approach works perfectly well for a single server, but it starts to break down as an application grows. The server has to “remember” every logged-in user, which makes it stateful, every request requires a lookup in the session store, adding a network round trip just to answer a simple “is this user logged in?” question. Scaling becomes painful too, if you run multiple server instances behind a load balancer, that session data has to be shared across all of them, usually through sticky sessions or a centralized store, which adds real infrastructure complexity. On top of that, cookies are tied to a specific domain, which makes them awkward for mobile apps, third-party integrations, and cross-domain APIs. These pain points are exactly what token-based authentication was designed to solve.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NkAy2g69uFC6Qc7G8ynYKg.png" /><figcaption>image1: session vs jwt based authentication</figcaption></figure><h3>The Problem JWT Solves</h3><p>Instead of the server storing session data and handing the client a reference to it (the session ID), the server packages the user’s identity and permissions directly inside a signed token and gives that entire package to the client. The client then sends this token back with every request, and the server doesn’t need to remember anything about it, only needs to verify the token’s signature. If the signature checks out, the server trusts the data inside without ever touching a database.</p><p>This single change removes the biggest pain points of sessions. There’s no server-side storage required just to authenticate a request, tokens travel naturally across domains and into mobile apps and microservices, and the system scales horizontally without needing a shared session store anywhere. Verification becomes a fast-cryptographic check instead of a database round trip, which matters a lot once you’re handling real traffic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NEN82smcoQryKP_aD-wcuQ.png" /><figcaption>image2: Client get jwt from server</figcaption></figure><h3>Stateless Authentication</h3><p>“Stateless” is the word you’ll hear most often around JWT, and it’s worth understanding precisely what it implies. In a stateless system, the server keeps no record at all of the user’s login session, everything needed to authenticate and authorize a request travels along with the request itself, packed inside the token. Because of this, any server instance can validate any token as long as it has access to the same secret or public key used for verification. That’s a huge advantage in horizontally scaled systems, since you can add or remove servers freely without worrying about replicating session data between them.</p><p>There is a tradeoff, though. Because the server isn’t tracking sessions, it can’t simply delete a row to force a user out the way it could with session-based auth, once a JWT is issued, it remains valid until it expires, unless you build extra infrastructure around it, like a token blocklist. In short, statelessness trades storage for trust, the server trusts what’s inside the token because it can cryptographically verify that nothing in it has been tampered with.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*41xVnrtN-8wm0e_G4fOtxw.png" /><figcaption>image3: Stateless authentication working</figcaption></figure><h3>How JWT Works</h3><p>At a high level, the entire flow starts when a user logs in with their credentials. The server verifies them, and if everything checks out, it builds a JWT containing information about the user, their ID, role, and similar details, and signs it using a secret key. That token is sent back to the client, which stores it and attaches it to every subsequent request, typically inside the Authorization header in the form Bearer &lt;token&gt;. From that point on, the server simply verifies the token’s signature on every incoming request. If it’s valid and hasn’t expired, the request is treated as authenticated, with no database lookup required for the token itself.</p><p>The key idea to hold onto here is that the token is self-contained and tamper-evident. Anyone can technically read what’s inside it, since it’s only encoded and not encrypted by default, but nobody can modify its contents without invalidating the signature, which is exactly what makes the whole system trustworthy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TpHPE8FrJLQfykdaKXGqkA.png" /><figcaption>image4: Jwt signing and Verification</figcaption></figure><h3>JWT Structure Explained</h3><p>A JWT is really just a string made up of three parts separated by dots.</p><p>1. Header</p><p>2. Payload</p><p>3. Signature</p><p>with each part Base64Url-encoded.</p><p>A real token looks like (eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiIxMjM0In0.SflKxwRJSMeKKF2QT4fw) and each of those three sections has a very specific job.</p><h3>Header</h3><p>The header describes the token itself. It’s a small JSON object stating which algorithm was used to sign the token and what type of token it is something like { “alg”: “HS256”, “typ”: “JWT” }. This is the first thing a server reads, since it tells it exactly how to go about verifying the signature later.</p><h3>Payload</h3><p>The payload is where the actual claims live the pieces of data about the user or the session, such as { “sub”: “1234567890”, “name”: “John Doe”, “role”: “admin”, “exp”: 1710003600 }. This is the part developers customize the most, and it’s important to remember that the payload is only encoded, not encrypted. Anyone holding the token can decode and read it, so sensitive information like passwords or personal data should never end up here.</p><h3>Signature</h3><p>The signature is what makes the whole token trustworthy. It’s produced by taking the encoded header and payload, joining them together, and running them through a signing algorithm along with a secret or private key. If even a single character in the header or payload changes after the fact, the resulting signature won’t match anymore, and the server will reject the token outright which is exactly the tamper-evidence that makes JWT useful for authentication in the first place.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qc1ovG9Q8cM-rTfaTkVrog.png" /><figcaption>image5: JWT creation Process</figcaption></figure><h3>JWT Signing Algorithms</h3><p>The alg field in the header tells the server exactly how to verify a token’s signature, and algorithms generally fall into two families.</p><p>Symmetric algorithms, like HS256, use a single shared secret for both signing and verifying tokens. They’re simple to set up and work well when one backend service both issues and validates its own tokens, but there’s a catch, anything capable of verifying a token with that secret is also capable of forging one, since it holds the exact same key. That makes symmetric signing a poor fit once multiple independent services need to verify tokens without also being trusted to issue them.</p><p>Asymmetric algorithms, like RS256 or ES256, solve that problem by splitting signing and verifying into two different keys, a private key that only the authentication server holds, and a public key that any number of other services can use to verify tokens without ever being able to create new ones. This makes asymmetric signing the natural choice for microservice architectures or any system where verification needs to happen in more than one place. As a rule of thumb, HS256 is fine for a simple, single-service setup, while RS256 or ES256 becomes the better choice the moment more than one service needs to independently trust the tokens flying around.</p><h3>Access Token vs Refresh Token</h3><p>In production, applications almost never rely on a single long-lived JWT. Instead, they issue two tokens with very different lifespans. The access token is short-lived usually somewhere between a few minutes and an hour, and it’s what gets sent with every single API request to prove who the user is. The refresh token, by contrast, is long-lived, often valid for days or weeks, but it’s only ever sent to a dedicated token-refresh endpoint, never to a regular API route.</p><p>This split exists because a short-lived access token limits the damage if it’s ever intercepted or leaked, since it simply expires soon regardless of what happens to it. The refresh token lets the user stay logged in without re-entering their credentials every few minutes, and because it’s transmitted far less often, and can usually be revoked server-side, unlike a pure stateless access token it gives the system a real way to kill a session when it needs to, something plain JWTs otherwise struggle to do cleanly.</p><h3>JWT Authentication Flow in a Web Application</h3><p>Bringing all of this together, a typical production flow starts with the user submitting their login credentials, which the server checks against its database. If they’re valid, the server issues both an access token and a refresh token and sends them back to the client, which stores both. From then on, the client attaches the access token to the Authorization header on every API call, and the server verifies its signature and expiry directly — without needing a database call for that check.</p><p>Eventually the access token expires, and at that point the client silently calls a refresh endpoint using the refresh token instead of forcing the user to log in again. If that refresh token is still valid and hasn’t been revoked, the server issues a brand-new access token, and the whole cycle quietly continues in the background — which is why well-built apps rarely make users sign in more than once a day, even though their access tokens might expire every fifteen minutes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-W2syiWGsxpndaMRheHuSQ.png" /></figure><h3>Where Should You Store JWT</h3><p>This is one of the most debated decisions in JWT-based authentication, and it has a direct impact on your app’s security. Storing the token in localStorage or sessionStorage is the easiest option from a developer’s point of view, since it’s trivial to read and write from JavaScript, but that convenience comes at a cost, anything that can execute JavaScript on your page, including an XSS attack, can also read the token straight out of storage and steal it.</p><p>HttpOnly cookies solve that particular problem, since JavaScript simply cannot read a cookie marked HttpOnly, which protects the token from XSS-based theft. The tradeoff is that cookies are sent automatically by the browser, which opens the door to CSRF attacks unless you pair them with proper protections like the SameSite attribute. A third option is keeping the token purely in memory, in a React state variable which is extremely resistant to XSS since there’s nothing sitting in persistent storage to read, though it does mean the user gets logged out on every page refresh unless it’s paired with a silent-refresh mechanism.</p><p>In practice, the safest common pattern is a hybrid, keep the refresh token in an HttpOnly, Secure, SameSite cookie, and hold the access token only in memory. That combination gives you the convenience of a persistent login without ever exposing a long-lived credential directly to JavaScript.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89f86c781826" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>