<?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 MD SABBIR AHMED on Medium]]></title>
        <description><![CDATA[Stories by MD SABBIR AHMED on Medium]]></description>
        <link>https://medium.com/@sabbir0x7?source=rss-57df9590f1e8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*yDfclNh5HtRarS9thCFXLQ.jpeg</url>
            <title>Stories by MD SABBIR AHMED on Medium</title>
            <link>https://medium.com/@sabbir0x7?source=rss-57df9590f1e8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 23:55:25 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sabbir0x7/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[FuLL Process of Server and Clinet Secure Connection(SSL/TLS)]]></title>
            <link>https://medium.com/@sabbir0x7/full-process-of-server-and-clinet-secure-connection-ssl-tls-9daa01e817c0?source=rss-57df9590f1e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/9daa01e817c0</guid>
            <category><![CDATA[https]]></category>
            <category><![CDATA[tls-certificate]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[ssl-certificate]]></category>
            <dc:creator><![CDATA[MD SABBIR AHMED]]></dc:creator>
            <pubDate>Wed, 18 Feb 2026 18:36:24 GMT</pubDate>
            <atom:updated>2026-02-18T18:38:41.979Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w-L3oDMPI1tqlELfCDIZHA.png" /></figure><h3>SSL/TLS Certificate and CA-Related Process</h3><p>When a website is first created and hosted, the server usually does not have an <strong>SSL Certificate</strong>. This certificate is mainly issued by a <strong>CA (Certificate Authority)</strong> — such as <strong>Let’s Encrypt</strong> or <strong>Cloudflare</strong>.</p><h3>Certificate Issuance Process:</h3><ol><li>First, the server uses the <strong>RSA</strong> and <strong>ECDSA</strong> methods to generate a <strong>Public Key + Private Key pair</strong> for its own identity.</li><li>Then the server creates a <strong>CSR (Certificate Signing Request)</strong> file.</li><li>Inside this CSR file are:</li></ol><ul><li>The server’s <strong>Public Key</strong></li><li>Domain name</li><li>Organization information (if any)</li><li>Digital signature (created using the server’s private key)</li></ul><p>4. This CSR file is sent to <strong>Let’s Encrypt</strong> or another <strong>CA</strong>.</p><p>5. The <strong>CA (Certificate Authority)</strong> has its own <strong>Public Key</strong> and <strong>Private Key</strong> pair.</p><h3>CA Key Pair Structure</h3><p>A CA has:</p><ul><li><strong>CA Private Key</strong> → Extremely secret (Highly Confidential)</li><li><strong>CA Public Key</strong> → Publicly available (Distributed as a Trusted Root)</li></ul><h4>Role of the CA Private Key</h4><p>The CA uses its <strong>Private Key</strong> to:</p><ul><li>Verify the server’s CSR</li><li>Digitally sign the server’s <strong>Public Key</strong></li><li>Create an <strong>X.509 Digital Certificate</strong></li></ul><p>In other words, the digital signature inside the certificate is created using the <strong>CA’s private key</strong>.</p><p>If a CA’s private key is compromised, the entire trust model collapses.</p><h4>Role of the CA Public Key</h4><p>The Root CA’s public key is pre-installed in the browser or operating system.</p><p>The CA’s <strong>Public Key</strong> is used by:</p><ul><li>The client (Browser / OS)</li><li>To verify the certificate signature</li></ul><p>When the client receives the server’s certificate:</p><ol><li>It takes the signature from the certificate</li><li>Verifies the signature using the CA’s public key</li><li>If verification is successful → the server is trusted</li></ol><p><strong>Summary:</strong></p><p>✔️ A CA has its own Public + Private key pair<br>✔️ Private key → Used to sign certificates<br>✔️ Public key → Used to verify signatures<br>✔️ This works based on asymmetric cryptography<br>✔️ This is the foundation of the entire HTTPS trust model</p><p>6. The CA uses its own <strong>Private Key</strong> to verify the <strong>CSR</strong>, digitally signs the server’s <strong>public key</strong>, creates a <strong>Digital Certificate</strong>, and sends it back to the server.</p><h3>Important Points:</h3><ul><li>The <strong>public key</strong> seen inside the certificate is the server’s public key.</li><li>The CA signs the certificate using its private key.</li><li>The client already trusts the CA’s public key as a root (pre-installed in the Operating System or Browser).</li></ul><p>After receiving the certificate, it is installed on the server so that it can be presented to visitors.</p><h3>Connection Flow Between Server and Client</h3><p>When establishing an HTTPS connection, there are three main phases:</p><p>A. TCP Handshake<br>B. TLS Handshake<br>C. HTTP GET / POST</p><h3>A. TCP Handshake</h3><p>When the client sends a request to the server, a <strong>TCP Three-Way Handshake</strong> is completed first.</p><h4>TCP Three-Way Handshake Steps:</h4><ol><li><strong>Client → SYN (Seq = x)</strong><br>The client sends a packet with the SYN flag to initiate the connection.</li><li><strong>Server → SYN-ACK (Seq = y, Ack = x+1)</strong><br>The server receives the SYN and sends an acknowledgement.</li><li><strong>Client → ACK (Ack = y+1)</strong><br>The client sends an acknowledgement and establishes the TCP connection.</li></ol><p>At this stage, only a reliable transport-layer connection is established. No encryption has started yet.</p><h3>B. TLS Handshake (Encryption Establishment Phase)</h3><p>After the TCP connection is established, the <strong>TLS Handshake</strong> begins.</p><h4>TLS Handshake Steps</h4><h4>🔹 Step 1: Client Hello</h4><p>The browser informs the server about:</p><ul><li>Which TLS versions it supports</li><li>Which cipher suites it can use</li><li>A random number</li></ul><p>This is not a “hello”; it is a <strong>cryptographic capability announcement</strong>.</p><h4>🔹 Step 2: Server Hello</h4><p>The server informs:</p><ul><li>Which cipher suite has been selected</li><li>Sends its <strong>SSL Certificate</strong><br>(which contains the <strong>Public Key</strong>)</li></ul><h4>🔹 Step 3: Authentication (Server Verification)</h4><p>The browser verifies:</p><ul><li>Whether the certificate is issued by a trusted CA (the browser already has the <strong>CA’s public key</strong>, which it uses to <strong>verify</strong> the certificate)</li><li>Whether the domain name matches</li><li>Whether the certificate has expired</li></ul><p>❌ If verification fails → <strong>“Your connection is not private”</strong></p><h4>🔹Step 4: Key Exchange</h4><p>This is the most important step.</p><ul><li>The browser generates a <strong>Symmetric Session Key</strong></li><li>Encrypts it using the server’s <strong>Public Key</strong> and sends it</li></ul><p>📌 Only the server can decrypt it<br>Because only the server has the <strong>Private Key</strong>.</p><h4>🔹 Step 5: Secure Channel Established</h4><ul><li>The server decrypts the Session Key using its Private Key</li><li>Now <strong>both the browser and server have the same Symmetric Key</strong></li></ul><p>✅ <strong>Encrypted Communication</strong> starts from here</p><h3>C. Now HTTP GET / POST Begins</h3><p>Only now can HTTP actually start.</p><ul><li>Browser → <strong>Encrypted GET / POST</strong></li><li>Server → <strong>Encrypted Response (HTML, CSS, JS)</strong></li></ul><p>👀 Even if someone intercepts the traffic, they will see:</p><pre>7f 9a c3 4b 2e ...</pre><p>Which is completely meaningless data.</p><h3>Main Components Inside a Client Hello Request:</h3><h4>1. TLS Version</h4><p>The client specifies the highest TLS version it supports (e.g., TLS 1.2 or TLS 1.3). It tells the server, “I can communicate up to this version.”</p><h4>2. Client Random (A Random Number)</h4><p>A 32-byte randomly generated number. This is very important because it is later used to generate the <strong>Session Key</strong> used for encryption.</p><h4>3. Cipher Suites (List of Algorithms)</h4><p>A list of encryption algorithms supported by the client. The client offers options such as:</p><ul><li><strong>Key Exchange:</strong> e.g., ECDHE or RSA</li><li><strong>Authentication:</strong> e.g., ECDSA or RSA</li><li><strong>Encryption:</strong> e.g., AES-128 or AES-256</li><li><strong>Hashing:</strong> e.g., SHA-256 or SHA-384</li></ul><h4>4. Session ID</h4><p>If the client has previously connected to the server, it may send an old <strong>Session ID</strong>. This allows the connection to be resumed quickly without a full handshake (called Resume).</p><h4>5. Compression Methods</h4><p>Whether data should be compressed before transmission. Due to security vulnerabilities, this is usually set to ‘Null’ or disabled.</p><h4>6. Extensions (Additional Information)</h4><p>This is the most important part in modern TLS. Important extensions include:</p><ul><li><strong>Server Name Indication (SNI):</strong> Specifies which domain or hostname (e.g., example.com) the client wants to connect to. If multiple websites are hosted on one server, this helps select the correct certificate.</li><li><strong>Signature Algorithms:</strong> Specifies which digital signatures (e.g., SHA256-ECDSA) the client can verify.</li><li><strong>Supported Groups:</strong> Since ECDSA or ECDHE is used, the client specifies which <strong>Elliptic Curves</strong> (e.g., x25519 or P-256) it supports.</li></ul><h3>Simple Example:</h3><p>Imagine the client says:</p><blockquote><em>“Hello Server! I understand TLS 1.3. I have some random numbers (XYZ). I prefer </em><strong><em>ECDHE-ECDSA-AES128-SHA256</em></strong><em>, but I also have 5 more options. And yes, I want to talk to </em><em>google.com.”</em></blockquote><p>The server checks this list and responds with the next step — <strong>Server Hello</strong> — based on its own preferences.</p><p>No matter how many options the client provides in Client Hello, the server selects only one best option according to its own capability and security policy and sends the <strong>Server Hello</strong> message.</p><p>If the server sees that the client supports modern encryption, it usually chooses <strong>ECDHE-ECDSA</strong>.</p><h3>Main Components Inside a Server Hello Message:</h3><h4>1. Selected TLS Version</h4><p>The server confirms which TLS version it will use from the client’s list (e.g., TLS 1.3).</p><h4>2. Server Random</h4><p>Another 32-byte random number generated by the server. This, together with the Client Random, is used to generate the <strong>Master Secret</strong> or encryption keys.</p><h4>3. Selected Cipher Suite</h4><p>The most important part. Even if the client offers many options, the server selects only one. For example: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256. This means:</p><ul><li><strong>Key Exchange:</strong> ECDHE</li><li><strong>Authentication:</strong> ECDSA</li><li><strong>Encryption:</strong> AES-128</li></ul><h4>4. Selected Compression Method</h4><p>Indicates whether any proposed compression method is accepted (usually ‘None’).</p><h4>5. Extensions</h4><p>The server responds to the client’s extensions:</p><ul><li><strong>Supported Groups:</strong> Specifies which Elliptic Curve (e.g., P-256) the server will use.</li><li><strong>ALPN:</strong> Confirms which application protocol (e.g., h2 or http/1.1) will be used.</li></ul><h4>Immediately after this, the server sends 3 more important messages (often together with Server Hello):</h4><ol><li><strong>Server Certificate:</strong> The server sends its CA-signed certificate containing its <strong>ECDSA Public Key</strong>.</li><li><strong>Server Key Exchange:</strong> Since ECDHE is used, the server sends an ephemeral public key and parameters, digitally signed using the server’s <strong>Private Key</strong>.</li><li><strong>Server Hello Done:</strong> Indicates that the server has finished sending its initial information.</li></ol><p><strong>In simple words:</strong></p><p>The server basically says —</p><blockquote><em>“I chose TLS 1.3 and ECDHE-ECDSA from your list. Here is my random number and my certificate. Now you start your work.”</em></blockquote><h3>What Happens After the Server Sends the Certificate to the Client</h3><h4>1. Certificate Verification (Client Side)</h4><p>The client checks the certificate and verifies:</p><ul><li>Whether it is signed by a trusted <strong>CA (Certificate Authority)</strong></li><li>Whether the certificate is valid</li><li>Whether the domain name matches</li><li><strong>ECDSA Verification:</strong> The client uses the server’s public key to verify that the digital signature is correct</li></ul><h4>2. Client Key Exchange</h4><p>Just like the server sent an ephemeral public key for ECDHE, the client now generates its own <strong>ephemeral public key</strong> and sends it to the server.</p><h4>3. Pre-Master Secret Generation</h4><p>This step is magical! Both client and server now have each other’s ephemeral public keys and their own private keys. Using the <strong>Diffie-Hellman</strong> algorithm, both independently compute the same number, called the <strong>Pre-Master Secret</strong>.</p><blockquote>Remember: this secret is never sent directly over the internet; both sides calculate it independently.</blockquote><h4>4. Master Secret and Session Key Generation</h4><p>Now both client and server have:</p><ol><li><strong>Client Random</strong></li><li><strong>Server Random</strong></li><li><strong>Pre-Master Secret</strong></li></ol><p>Combining these, they generate the <strong>Master Secret</strong>, from which <strong>Symmetric Session Keys</strong> (e.g., AES keys) are derived. All future communication is encrypted using these keys.</p><h4>5. Change Cipher Spec (From Client)</h4><p>The client tells the server: “From now on, all my messages will be encrypted. I am starting to use the Session Key.”</p><h4>6. Client Finished</h4><p>The client sends an encrypted message to confirm that the handshake worked correctly and encryption is functioning.</p><h4>7. Server Finished</h4><p>The server responds with its own encrypted message: “I’m ready too. My encryption is working.”</p><h4>Result: Secure Connection Established!</h4><p>The handshake is complete. An <strong>Encrypted Tunnel</strong> is now created over the TCP connection. Even if you send credit card details or passwords, no one can see them.</p><p><strong>At a glance:</strong></p><ul><li><strong>Server:</strong> “I support ECDSA and ECDHE. Here is my certificate.”</li><li><strong>Client:</strong> “The certificate is valid. Here is my DH public key.”</li><li><strong>Both:</strong> (Independently compute a shared secret using their private keys.)</li><li><strong>Both:</strong> “Okay, everything is encrypted now!”</li></ul><p>After a successful TLS handshake, the real work begins — <strong>data transfer</strong>, also known as the <strong>Data Transfer Phase</strong>.</p><h3>What Happens After the Handshake (In Detail):</h3><h4>1. Encrypted Tunnel Creation (Symmetric Encryption)</h4><p>From now on, all data is encrypted using the <strong>Session Key</strong> generated during the handshake. Heavy algorithms like ECDSA or RSA are no longer used; instead, fast algorithms like <strong>AES (Advanced Encryption Standard)</strong> or <strong>ChaCha20</strong> are used.</p><h4>2. Application Data Exchange (HTTP over TLS)</h4><p>The browser sends the actual request (e.g., GET /index.html).</p><ul><li><strong>Encryption:</strong> The request is encrypted using the Session Key.</li><li><strong>Decryption:</strong> The server decrypts it using the same Session Key.</li><li><strong>Response:</strong> The server encrypts the response and sends it back.</li></ul><h4>3. Data Integrity Protection (MAC/HMAC)</h4><p>Each packet includes a <strong>MAC (Message Authentication Code)</strong> or tag.</p><ul><li>If a hacker tries to modify even one bit of data, it will be detected during decryption and the connection will be dropped, ensuring data integrity.</li></ul><h4>4. Record Protocol</h4><p>TLS’s Record Protocol splits data into small blocks or packets, each with its own header and encryption, ensuring security even during large transfers.</p><h4>5. Session Management (Session Resumption)</h4><p>If you click another link on the same website, the browser does not need to perform the full handshake again. Using the previous <strong>Session ID</strong> or <strong>Session Ticket</strong>, a new connection is established quickly, improving browsing speed.</p><h4>6. Connection Closure (Alert Protocol)</h4><p>When work is finished, the client sends a <strong>“close_notify”</strong> alert so the server knows data transfer is complete. This prevents <strong>Truncation Attacks</strong>.</p><h3>The Big Picture (In Short):</h3><ol><li><strong>TCP Handshake:</strong> Connection established</li><li><strong>TLS Handshake:</strong> Keys exchanged</li><li><strong>Data Exchange:</strong> Secure encrypted communication</li><li><strong>Connection Close:</strong> Secure termination</li></ol><p><strong>Cybersecurity Learning Point:</strong><br>When you inspect traffic using <strong>Wireshark</strong>, after the handshake you will only see <strong>“Application Data”</strong>. You will never see what is inside unless you have the <strong>Session Key</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9daa01e817c0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SSH connection Between Server and Client]]></title>
            <link>https://medium.com/@sabbir0x7/ssh-connection-between-server-and-client-df7fe37e4813?source=rss-57df9590f1e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/df7fe37e4813</guid>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[remote-connection]]></category>
            <dc:creator><![CDATA[MD SABBIR AHMED]]></dc:creator>
            <pubDate>Wed, 18 Feb 2026 17:03:04 GMT</pubDate>
            <atom:updated>2026-02-18T17:15:59.714Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S6tiKffQw27stJbhJE05hg.png" /></figure><h3>1. Server Authentication (Authenticating the Server)</h3><p>If you have ever used SSH before, then you have surely seen a confirmation prompt like the one below:</p><blockquote><strong><em>The authenticity of host ‘10.10.244.173’ can’t be established… Are you sure you want to continue connecting (yes/no)?</em></strong></blockquote><p>Here, your SSH client is asking whether you recognize the server’s <strong>Public Key Fingerprint</strong>.</p><p>What does this mean?</p><ul><li>The SSH server sends its <strong>public key</strong> to you</li><li>Your SSH client has never seen this server’s key before</li><li>So it asks you:</li><li><em>“Do you trust this server?”</em> <strong>Are you sure you want to continue connecting (yes/no)?</strong></li></ul><p>The reason for this warning is the possibility of a <strong>Man-in-the-Middle Attack</strong>.</p><p>That is, an attacker in the middle could intercept the communication between you and the server and pretend to be the real server.</p><h3>What happens when you type yes?</h3><ul><li>The SSH client saves the server’s <strong>public key fingerprint</strong> on your machine in the (~/.ssh/known_hosts) directory.</li><li>The next time you connect to the same server, it will not ask again.</li><li>If the server ever sends a different key → SSH will warn you (this is a dangerous sign).</li></ul><h3>2. Client Authentication (Authenticating the Client)</h3><p>After verifying the server, it is now time to prove yourself (the client). Usually we use a username and password, but for security reasons this is not a very good method. Instead, <strong>Key Authentication</strong> or “key-based authentication” is used.</p><p>Then the server asks — <em>who are you?</em></p><h3>Generally, authentication happens in 2 ways:</h3><ol><li><strong>Username + Password</strong></li><li><strong>SSH Key (Public/Private Key)</strong> (most secure)</li></ol><p>If you use passwords:</p><ul><li>Brute-force attacks are possible</li><li>There is a risk of password leakage</li></ul><p>That is why <strong>SSH Key Authentication</strong> is more secure.</p><p>Here, the client generates two keys — <strong>public key</strong> and <strong>private key</strong>. The <strong>private key</strong> is kept by the client, and the <strong>public key</strong> is sent to the server.</p><p>How does SSH Key Authentication work?</p><p>In SSH, there are two keys:</p><ul><li><strong>Private Key</strong> → stays with you (secret)</li><li><strong>Public Key</strong> → stays on the server (in the authorized_keys file)</li></ul><p>During login:</p><ul><li>The server sends a challenge</li><li>You <strong>sign it with your private key</strong></li><li>The server <strong>verifies it with your public key</strong></li><li>If it matches → login successful</li></ul><p>The private key is <strong>never sent to the server</strong></p><h3>ssh-keygen and types of keys</h3><p>To generate public and private keys, the ssh-keygen command is usually used. Some popular algorithms are:</p><ul><li><strong>DSA:</strong> An old algorithm created for digital signatures.</li><li><strong>ECDSA:</strong> An improved version of DSA that provides good security with smaller key sizes.</li><li><strong>Ed25519:</strong> Currently very popular and considered highly secure.</li><li><strong>RSA:</strong> The default and most widely used algorithm.</li></ul><h3>3. Importance of the Private Key (SSH Private Keys)</h3><p>Remember, your <strong>Private Key</strong> is like your password. Never share it with anyone.</p><ul><li><strong>Passphrase:</strong> To protect the private key, a passphrase (password) can be used. It is not sent to the server; it only locks the key on your own computer.</li><li><strong>Permissions:</strong> The private key file must have correct permissions (e.g., chmod 600). If the permissions are incorrect, the SSH client will refuse to use it.</li><li><strong>Usage:</strong> To connect to another server, use the command ssh -i [private_key_file] user@host.</li></ul><h3>4. Keys Trusted by the Remote Host</h3><p>Inside the server’s ~/.ssh/ folder, there is a file named <strong>authorized_keys</strong>. If you put your <strong>public key</strong> in this file, the server will allow you to log in without a password. For security reasons, in many cases only key-based login is allowed for the root user.</p><h3>5. Why is this useful in Pentesting or CTF?</h3><p>When you hack into a machine (via a Reverse Shell), it is often unstable (for example, the connection drops if you press Ctrl+C). But if you can place your public key into that machine’s authorized_keys file, you can log in directly via SSH. This works as a persistent <strong>backdoor</strong> and gives you a full and stable terminal.</p><h3>Generating an SSH Key</h3><p>To generate an SSH key, use:</p><pre>ssh-keygen -t ed25519</pre><p>Here:</p><ul><li>ed25519 → modern, small, and secure algorithm</li><li>You can add a passphrase (strongly recommended)</li></ul><p>Result:</p><ul><li>id_ed25519 → <strong>Private Key</strong></li><li>id_ed25519.pub → <strong>Public Key</strong></li></ul><h3>1. Creating an SSH Key (Ed25519)</h3><p>First, type the following command in your local computer’s terminal:</p><p>Bash</p><p>ssh-keygen -t ed25519 -C &quot;your_email@example.com&quot;</p><ul><li><strong>Process:</strong> After running this, when asked for the file save location, press <strong>Enter</strong>. Then it will ask for a <strong>passphrase</strong>.</li></ul><h3>2. Why and how to use a Passphrase?</h3><p><strong>Why use it?</strong></p><p>If somehow your laptop or computer gets stolen and someone obtains your id_ed25519 (Private Key) file, they still won’t be able to access your server without the passphrase. This adds an extra lock or security layer to your key.</p><p><strong>How to use it?</strong></p><p>When creating the key, at the Enter passphrase prompt, enter a strong password. Remember, nothing will appear on the screen while typing.</p><h3>3. Sending the Public Key to the Server</h3><p>The easiest way to send your generated public key to the server is by using the ssh-copy-id command:</p><p>Bash</p><p>ssh-copy-id -i ~/.ssh/id_ed25519.pub user@server_ip</p><ul><li><strong>Alternative method:</strong> If ssh-copy-id does not work, manually copy the contents of your public key and paste them into the server’s ~/.ssh/authorized_keys file.</li></ul><h3>4. Logging in Using the Private Key</h3><p>After sending the public key to the server, you can log in without a password using the following command:</p><p>Bash</p><p>ssh -i ~/.ssh/id_ed25519 user@server_ip</p><ul><li>Here, i means <strong>Identity File</strong>. If you saved your key with the default name, simply typing ssh user@server_ip will also work.</li></ul><h3>5. Setting Correct Permissions for the Private Key (Very Important)</h3><p>If others can read your private key, SSH will block it. So always keep permissions secure by running this command:</p><p>Bash</p><p>chmod 600 ~/.ssh/id_ed25519</p><ul><li><strong>600</strong> means only you can read or write this file, no one else.</li></ul><h3>In short, the whole process:</h3><ol><li><strong>Create:</strong> ssh-keygen -t ed25519</li><li><strong>Send:</strong> ssh-copy-id user@ip</li><li><strong>Login:</strong> ssh user@ip</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df7fe37e4813" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Diffie-Hellman Key Exchange]]></title>
            <link>https://medium.com/@sabbir0x7/diffie-hellman-key-exchange-1ba77a569869?source=rss-57df9590f1e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ba77a569869</guid>
            <category><![CDATA[ssl-certificate]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[encryption-decryption]]></category>
            <dc:creator><![CDATA[MD SABBIR AHMED]]></dc:creator>
            <pubDate>Tue, 17 Feb 2026 17:22:11 GMT</pubDate>
            <atom:updated>2026-02-17T17:22:11.329Z</atom:updated>
            <content:encoded><![CDATA[<p>Symmetric encryption has one major challenge: sharing the secret key. Suppose you want to send a password-protected document to your business partner so that you can discuss confidential business strategies. Then how will you share the password with them? Ideally, you need a secure channel where adversaries/hackers cannot read or modify the password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ISxFg_BuLkWMvnSIwsP7QA.png" /></figure><h3>Diffie-Hellman Key Exchange</h3><p>The purpose of key exchange is to establish a shared secret between two parties. It is a method through which two parties can create a shared secret even while using an insecure communication channel — without any pre-existing shared secret and without allowing any observer to learn that key.</p><p>As a result, this shared secret key can be used for symmetric encryption in subsequent communication.</p><p>Suppose Alice and Bob want to communicate securely. They want to create a shared key for symmetric cryptography, but they do not want to use asymmetric cryptography for key exchange. This is where Diffie-Hellman Key Exchange is used.</p><p>Alice and Bob separately create their own secrets; let us assume these secrets are A and B.</p><p>They also have a public common material; let us call it C.</p><p>We have to assume two things:</p><ol><li>When the secrets are combined, it is almost impossible to separate them.</li><li>The order in which they are combined does not affect the result.</li></ol><p>Alice and Bob will combine their secrets with the common material to create AC and BC respectively. Then they send these to each other, and by combining the received part with their own secret, both of them generate the same key (ABC). Now they can communicate using this key.</p><p>AC == Public Key</p><p>BC == Public Key</p><p>They share these public keys with each other.</p><p>And with these public keys, they merge (using a mathematical formula) their own private keys (A or B) and both obtain the same secret key ABC.</p><h3>Math example</h3><h3>Step-by-step process</h3><p>1️⃣ Alice and Bob agree on a public variable C.<br>C means two variables… g and p</p><p>A large prime number p and a generator g,</p><p>where [0 &lt; g &lt; p]</p><p>These values will be published publicly on the communication channel. To make the example easy, we are using small numbers:</p><p>p = 29</p><p>g = 3</p><p>2️⃣ Each party selects a private integer. For example:</p><p>Alice: a = 13</p><p>Bob: b = 15</p><p>These are their private keys and they are kept secret. [not shareable.]</p><p>3️⃣ Now each party uses their private key and the public variables to calculate a public value, which they will share with each other.</p><p>Alice calculates:</p><p>A = g^a (mod p) = 3¹³ (mod 29) = 19</p><p>Bob calculates:</p><p>B = g^b (mod p) = 3¹⁵ (mod 29) = 26</p><p>These A and B are the public keys. [shareable]</p><p>4️⃣ They send the public keys to each other (this is the key exchange step).</p><p>Bob receives A = 19</p><p>Alice receives B = 26</p><p>5️⃣ Now both of them calculate the shared secret:</p><p>Alice calculates:</p><p>B^a (mod p) = 26¹³ mod 29 = 10</p><p>Bob calculates:</p><p>A^b (mod p) = 19¹⁵ mod 29 = 10</p><p>Both results are the same:</p><p>g^(a or b) (mod p) = 10</p><p>This is the shared secret key.</p><p>Here, since ‘g’, ‘p’ and ‘A’ or ‘B’ are public, it is possible to brute-force and find their private keys ‘a’ and ‘b’,</p><p>but how easy or difficult that will be depends on the size of the numbers.</p><p>If I now, as a hacker, want to find the value of ‘b’… let’s try…</p><p>Here your equation is:</p><pre>3^b  ≡  26  (mod 29)</pre><h3>1. In the case of small numbers (Brute Force)</h3><p>Since the numbers here are small (p = 29), you can very easily test values one by one using the <strong>Brute Force</strong> method:</p><ul><li>3¹ (mod 29) = 3</li><li>3² (mod 29) = 9</li><li>3³ (mod 29) = 27</li><li>… continuing like this, you will find that 3¹⁵ (mod 29) = 26.</li><li>That is, here b = 15.</li></ul><h3>2. The problem with large numbers (The Challenge)</h3><p>In real life, when this method is used in cybersecurity or Diffie-Hellman key exchange, the value of p is chosen to be very large (for example, a 2048-bit prime number).</p><p>When p is very large, why does finding b become difficult?</p><ul><li><strong>No inverse function:</strong> Unlike ordinary logarithms, there is no direct calculator or formula here that can find b in one click.</li><li><strong>Exponential Complexity:</strong> For large numbers, brute force can take billions of years.</li><li><strong>One-way function:</strong> Computing [g^b (mod p)] is very easy, but deriving b from the result is extremely difficult.</li></ul><h3>3. Some algorithms to solve this</h3><p>Mathematicians have developed some specific algorithms to solve this, but even they are not effective for very large numbers:</p><ol><li><strong>Baby-step Giant-step:</strong> Faster than brute force, but uses a lot of memory.</li><li><strong>Pollard’s rho algorithm:</strong> Uses less memory, but takes a lot of time.</li><li><strong>Index Calculus Algorithm:</strong> Currently one of the most powerful methods.</li></ol><h3>Conclusion</h3><p>Here, finding b is very easy because the numbers are small. But if p were a very large number, then even knowing g, p, and B, it would be almost impossible to find b even for today’s supercomputers. Most of the internet’s security (such as SSL/TLS, SSH) is based on this “impossibility.”</p><h3>Relationship between Diffie-Hellman and RSA</h3><p>Diffie-Hellman Key Exchange is often used together with RSA public key cryptography.</p><h3>What does Diffie-Hellman do?</h3><p><strong>Diffie-Hellman has only one job:</strong></p><p><strong>To create a shared secret key between two parties</strong></p><p>(which will later be used in symmetric encryption)</p><p>Important points:</p><ul><li>Diffie-Hellman <strong>does not verify identity</strong></li><li>It only says:</li><li>“We both obtained the same secret key”</li></ul><p>But if only Diffie-Hellman is used, the problem is that if someone in the middle (MITM) comes and pretends to be Bob while talking to Alice, Diffie-Hellman cannot detect it.</p><p>That is why Diffie-Hellman + RSA is used.</p><h3>What does RSA do?</h3><p>RSA is mainly used to ensure <strong>identity and trust</strong>.</p><p>Using RSA, you can do:</p><ul><li><strong>Digital Signature</strong></li><li>→ Proves that the message was really sent by Bob</li><li><strong>Authentication</strong></li><li>→ “This person really is Bob”</li><li><strong>Key transport</strong></li><li>→ In some cases, directly sending the key</li></ul><p>That is, with RSA, MITM between client and server is not possible.</p><p>For example, by using RSA digital signing, you can be sure that the person you are talking to really is Bob — this prevents man-in-the-middle attacks.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ba77a569869" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Asymmetric Encryption and RSA]]></title>
            <link>https://medium.com/@sabbir0x7/asymmetric-encryption-and-rsa-23ffb66f8ac5?source=rss-57df9590f1e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/23ffb66f8ac5</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[rsa-algorithm]]></category>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[cryptography]]></category>
            <dc:creator><![CDATA[MD SABBIR AHMED]]></dc:creator>
            <pubDate>Tue, 17 Feb 2026 14:03:49 GMT</pubDate>
            <atom:updated>2026-02-17T14:03:49.472Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/676/1*We2_vtbgfciOaAIOorhW2g.jpeg" /></figure><p>Key exchange for <strong>symmetric encryption</strong> is a widely used application of <strong>asymmetric cryptography</strong>. Asymmetric encryption is relatively slower than symmetric encryption; therefore, we use asymmetric encryption to <strong>negotiate and agree on symmetric encryption ciphers and keys</strong>.</p><p>But the question is, how do you agree on a key with the server if transmitting the key directly allows someone snooping to see it?</p><h3>Analogy</h3><p>Suppose you have a secret code that you will use to communicate, along with instructions on how to use that secret code. The question is, how will you send these instructions to your friend so that no one else can read them?</p><p>The solution is not as difficult as it may seem. You can ask your friend for a lock. The key to this lock is only with your friend, and we assume that you have an indestructible box that can be locked with this lock.</p><p>If you place the instructions inside the locked box and send it to your friend, then after receiving it, your friend can unlock it and read the instructions. After that, you can communicate securely using the secret code, and there will be no risk of snooping.</p><h3>Metaphor vs Cryptographic System</h3><p>In this process, asymmetric cryptography is used only once, so the overall communication speed is not affected. After that, fast and private communication can be done using symmetric encryption.</p><h3>The Real World</h3><p>In the real world, key exchange alone is not sufficient. You must ensure that the person you are communicating with is actually who they claim to be. To ensure this verification, <strong>digital signatures</strong> and <strong>certificates</strong> are used, which will be discussed later.</p><p><strong>Asymmetric encryption is used to securely exchange symmetric keys.</strong></p><p>RSA is a <strong>public-key encryption algorithm</strong> that ensures secure data transmission even over an insecure channel. An insecure channel refers to a communication medium where an adversary can easily <strong>eavesdrop (secretly listen or intercept)</strong>.</p><h3>The Mathematics That Makes RSA Secure</h3><p>RSA is based on a mathematically hard problem — the <strong>large number factorization problem</strong>.</p><p>Multiplying two large <strong>prime numbers</strong> is relatively easy; however, finding the prime factors of a huge number is extremely difficult and computationally intensive.</p><p>The prime numbers that are obtained when a number is broken down, whose product equals the original number, are called <strong>Prime Factors</strong>.<br><strong>Understand this simply:</strong><br>Suppose a number is <strong>12</strong>.<br>• Breaking 12 down gives us: $2 \times 2 \times 3$.<br>• Here, <strong>2</strong> and <strong>3</strong> are prime numbers.<br>• Therefore, the Prime Factors of 12 are <strong>2 and 3</strong>.</p><p>Example:</p><p>113 × 127 = 14351</p><p>This is easy to do even by hand.</p><p>A larger example:</p><p>Prime number 1: 982451653031</p><p>Prime number 2: 169743212279</p><p>Their product:</p><p>982451653031 × 169743212279 = 166764499494295486767649</p><p>Now, finding the prime factors of 14351 is comparatively difficult, but factoring a huge number like 166764499494295486767649 is far more difficult.</p><p>In real-world RSA implementations, the prime numbers are much larger than the examples (around 300 digits or more).</p><p>A computer can factor the number 166764499494295486767649, but factoring numbers larger than 600 digits is practically infeasible.</p><p>That is, multiplying two 300-digit prime numbers is very easy, but extracting the prime factors from their product is extremely difficult — this is the security foundation of RSA.</p><h3>Numerical Example (Asymmetric Encryption Context)</h3><p>In asymmetric encryption:</p><ul><li><strong>Public Key</strong> is publicly available and used for encryption</li><li><strong>Private Key</strong> is kept secret and used for decryption</li></ul><p>Alice encrypts a message using Bob’s public key, and Bob decrypts it using his private key.</p><h3>Simplified Example of the RSA Algorithm</h3><p>Bob selects two prime numbers:</p><p>p = 157</p><p>q = 199</p><p>n = p × q = 31243</p><p>Euler’s Totient Function:</p><p>ϕ(n) = n − p − q + 1</p><p>= 31243 − 157 − 199 + 1</p><p>= 30888</p><p>Bob selects:</p><p>e = 163 (where e and ϕ(n) are relatively prime)</p><p>d = 379</p><p>Condition:</p><p>e × d ≡ 1 mod ϕ(n)</p><p>163 × 379 = 61777</p><p>61777 mod 30888 = 1</p><h3>Keys</h3><p>Public Key = (n, e) = (31243, 163)</p><p>Private Key = (n, d) = (31243, 379)</p><h3>Encryption</h3><p>Suppose plaintext x = 13</p><p>Alice calculates:</p><p>y = x^e mod n</p><p>= 13¹⁶³ mod 31243</p><p>= 16341</p><p>She sends 16341.</p><h3>Decryption</h3><p>Bob calculates:</p><p>x = y^d mod n</p><p>= 16341³⁷⁹ mod 31243</p><p>= 13</p><p>In this way, Bob recovers the original plaintext.</p><p>The proof of why this algorithm works is based on <strong>modular arithmetic</strong> and number theory.</p><p>The important point is that in this example we used 3-digit primes, but in real RSA implementations, p and q are usually at least 300-digit primes.</p><p>e = 163 — could any other number have been chosen? And how was d selected?</p><p>Yes, of course, e = 163 is not the only possible value. The RSA algorithm has specific mathematical conditions for choosing e.</p><p>First, let’s clearly understand the entire process mathematically.</p><p>In our example:</p><p>p = 157</p><p>q = 199</p><p>n = p × q = 31243</p><p>ϕ(n) = 30888</p><h3>How is e chosen?</h3><p>When choosing the public exponent e in RSA, two conditions must be satisfied:</p><ol><li>1 &lt; e &lt; ϕ(n)</li><li>gcd(e, ϕ(n)) = 1</li></ol><p>That is, e and ϕ(n) must be relatively prime.</p><p>Here, ϕ(n) = 30888</p><p>So e can be any number that:</p><ul><li>is less than 30888</li><li>and has no common factors with 30888</li></ul><p>For example, the following numbers could have been possible values of e (if the gcd condition is satisfied):</p><ul><li>e = 5</li><li>e = 7</li><li>e = 11</li><li>e = 17</li><li>e = 65537 (very popular in the real world)</li></ul><p>That is, e = 163 is not mandatory; it is just one valid choice.</p><p>In real RSA implementations, e = 65537 is commonly used because it is secure and computationally efficient.</p><h3>Then how is d chosen?</h3><p>d is the private exponent.</p><p>It is chosen such that:</p><p>e × d ≡ 1 mod ϕ(n)</p><p>That is,</p><p>e × d mod ϕ(n) = 1</p><p>Mathematically speaking, d is the <strong>modular multiplicative inverse</strong> of e modulo ϕ(n).</p><p>In our example:</p><p>e = 163</p><p>ϕ(n) = 30888</p><p>We need to find d such that:</p><p>163 × d ≡ 1 mod 30888</p><p>To find this inverse, we use the:</p><p>Extended Euclidean Algorithm</p><p>After calculation, we get:</p><p>d = 379</p><p>Because:</p><p>163 × 379 = 61777</p><p>61777 mod 30888 = 1</p><p>So d has been correctly selected.</p><h3>In Summary</h3><p>✔ e can be any number, as long as:</p><ul><li>1 &lt; e &lt; ϕ(n)</li><li>gcd(e, ϕ(n)) = 1</li></ul><p>✔ d is determined as the modular inverse of e modulo ϕ(n)</p><p>✔ If e changes, d will also change</p><h3>Cybersecurity Insight</h3><p>The security of RSA depends on:</p><ul><li>selecting large prime numbers</li><li>keeping ϕ(n) secret</li><li>protecting the private key (d)</li><li>the computational hardness of the factoring problem</li></ul><p>If an attacker can factor n (that is, find p and q), then they can compute ϕ(n) and calculate d — at that point, the entire RSA system is broken.</p><p>Therefore, in practice:</p><ul><li>p and q are usually 2048-bit or larger</li><li>secure random number generators are used</li><li>additional measures are taken to prevent side-channel attacks</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23ffb66f8ac5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Plain Text ,Cipher Text and Type of Encryption]]></title>
            <link>https://medium.com/@sabbir0x7/plain-text-cipher-text-and-type-of-encryption-799cfa361368?source=rss-57df9590f1e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/799cfa361368</guid>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[data-protection]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[information-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[MD SABBIR AHMED]]></dc:creator>
            <pubDate>Mon, 16 Feb 2026 09:26:28 GMT</pubDate>
            <atom:updated>2026-02-16T09:44:39.432Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Plaintext</strong> is readable data; it can be a simple “hello”, a cat photo, credit card information, or medical health records — anything. From a cryptography perspective, all of these are “plaintext” messages that are waiting to be encrypted.</p><p>Plaintext is passed through an <strong>encryption function</strong> along with a proper <strong>key</strong>; the encryption function returns a <strong>ciphertext</strong>. The encryption function is a part of the <strong>cipher</strong>; and a <strong>cipher</strong> is an algorithm that is used to convert plaintext into ciphertext and ciphertext back into plaintext.</p><ul><li><strong>Plaintext:</strong> HELLO</li><li><strong>Key:</strong> 3</li><li><strong>Encryption Function:</strong></li><li><strong>Move each letter 3 steps forward in the alphabet</strong></li></ul><h3>Step-by-step Encryption</h3><p>Plaintext Letter+3Ciphertext LetterH→KE→HL→OL→OO→R</p><p>Result</p><ul><li><strong>Plaintext:</strong> HELLO</li><li><strong>Key:</strong> 3</li><li><strong>Ciphertext:</strong> KHOOR</li></ul><p><strong>HELLO + Key(3) → Encryption Function → KHOOR</strong></p><h3>Decryption (reverse process)</h3><p>Now, if someone gets the ciphertext KHOOR and knows the key (3):</p><pre>Decrypted Letter = Ciphertext Letter - Key</pre><ul><li>K → H</li><li>H → E</li><li>O → L</li><li>O → L</li><li>R → O</li></ul><p>We get back again: <strong>HELLO</strong></p><p>The encryption function takes plaintext and key as input and provides ciphertext as output.</p><p>To recover plaintext, we must pass the ciphertext through the <strong>decryption function</strong> with the correct key, which will give us the original plaintext.</p><p>The decryption function takes ciphertext and key as input and provides plaintext as output.</p><p>We have now introduced a few new terms, and knowing these terms is extremely important for understanding any writing related to cryptography. Explanations of the terms are given below:</p><p><strong>Plaintext:</strong></p><p>The original, readable message or data before encryption. It can be a document, image, multimedia file, or any other binary data.</p><p><strong>Ciphertext:</strong></p><p>The scrambled, unreadable form of the message after encryption. Ideally, it should not be possible to obtain any meaningful information about the original plaintext from the ciphertext, except for an approximate size.</p><p><strong>Cipher:</strong></p><p>An algorithm or method that converts plaintext into ciphertext and ciphertext back into plaintext. A cipher is usually designed by a mathematician.</p><p><strong>Key:</strong></p><p>A string of bits that a cipher uses to encrypt or decrypt data. Although commonly used ciphers are public knowledge, the key must remain secret — unless it is a public key in the case of asymmetric encryption. Asymmetric encryption will be discussed in the next task.</p><p><strong>Encryption:</strong></p><p>A process in which plaintext is converted into ciphertext using a cipher and a key. The key remains secret, while the cipher is usually public.</p><p><strong>Decryption:</strong></p><p>The reverse process of encryption, in which ciphertext is converted back into plaintext using a cipher and a key. Although the cipher may be public knowledge, without the key, recovering the plaintext should be computationally infeasible.</p><h3>Two Main Types of Encryption</h3><p>Encryption is generally divided into <strong>two categories</strong>:</p><ol><li><strong>Symmetric Encryption</strong></li><li><strong>Asymmetric Encryption</strong></li></ol><h3>Symmetric Encryption</h3><p>In <strong>Symmetric Encryption</strong>, the <strong>same key</strong> is used to <strong>encrypt</strong> and <strong>decrypt</strong> data.</p><p>For this reason, it is also called <strong>Private Key Cryptography</strong>.</p><h3>🔹 How it works</h3><ul><li>Both the sender and the receiver have the <strong>same secret key</strong></li><li>Sender → uses the key to turn plaintext into ciphertext</li><li>Receiver → uses the same key to turn ciphertext back into plaintext</li></ul><p><strong>If the key is leaked, the entire security is broken</strong></p><h3>🔹 Key Sharing Problem</h3><p>Securely sharing the key is the biggest challenge of symmetric encryption.</p><h3>Real-world example</h3><p>Suppose —</p><ul><li>You create a <strong>password-protected document</strong></li><li>Sending the document by email is easy</li><li>But <strong>sending the password by email is risky</strong></li></ul><p><strong>Because:</strong></p><ul><li>If someone gains access to the email, they will get <strong>both the document and the password</strong></li></ul><p>So, sending the password requires a separate <strong>secure channel</strong></p><p>Often, the solution is <strong>telling the password in person</strong></p><h3>🔹 Problem with Powerful Adversaries</h3><p>When —</p><ul><li>There are many recipients</li><li>Or there is a powerful adversary like industrial espionage</li></ul><p>Then keeping the key secret becomes even more difficult.</p><h3>🔹 Examples of Symmetric Encryption</h3><p><strong>DES (Data Encryption Standard)</strong></p><ul><li>Became a standard in 1977</li><li>Key size: <strong>56-bit</strong></li><li>Broken in less than 24 hours in 1999</li></ul><p><strong>3DES (Triple DES)</strong></p><ul><li>DES applied three times</li><li>Key size: <strong>168-bit</strong></li><li>Effective security: <strong>112-bit</strong></li><li>Deprecated in 2019 (not recommended for use)</li></ul><p><strong>AES (Advanced Encryption Standard)</strong></p><ul><li>Became a standard in 2001</li><li>Key size: <strong>128 / 192 / 256-bit</strong></li><li>Currently the most widely used and secure</li></ul><h3>Asymmetric Encryption</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8RHcCROWM24mphYptHFPnA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/996/1*PgomgjuSb7SAAj4fAjm8zw.png" /></figure><p>In <strong>Asymmetric Encryption</strong>, <strong>two different keys</strong> are used:</p><ul><li><strong>Public Key</strong> → For encryption</li><li><strong>Private Key</strong> → For decryption</li></ul><p>This is called <strong>Public Key Cryptography</strong>.</p><h3>🔹 How it works</h3><ul><li>The receiver <strong>shares their public key with everyone</strong></li><li>Sender → encrypts the message using the public key</li><li>Receiver → decrypts it using their <strong>private key</strong></li></ul><p>There is no problem if the public key is known to everyone</p><p><strong>The private key must be kept secret</strong></p><h3>🔹 Why is Asymmetric Encryption slow?</h3><ul><li>It is mathematically very complex</li><li>Key sizes are very large</li><li>Therefore, it is <strong>slow</strong> compared to symmetric encryption</li></ul><h3>🔹 Examples of Asymmetric Encryption</h3><p><strong>RSA</strong></p><ul><li>Key size: <strong>2048 / 3072 / 4096-bit</strong></li><li>Minimum recommended: <strong>2048-bit</strong></li></ul><p><strong>Diffie-Hellman</strong></p><ul><li>Minimum: <strong>2048-bit</strong></li><li>Stronger security: <strong>3072 / 4096-bit</strong></li></ul><p><strong>ECC (Elliptic Curve Cryptography)</strong></p><ul><li>Higher security with smaller keys</li><li><strong>256-bit ECC ≈ 3072-bit RSA</strong></li></ul><h3>Mathematical Foundation</h3><p>Asymmetric encryption is based on mathematical problems that are:</p><ul><li>Easy to do in one direction</li><li><strong>Almost impossible</strong> to do in the reverse direction</li></ul><p>With today’s technology, solving these problems could take <strong>millions of years</strong></p><h3>How Asymmetric Encryption Works</h3><p><strong>Asymmetric Encryption</strong> is a method where <strong>two different keys</strong> are used — one <strong>Public Key</strong> and the other <strong>Private Key</strong>.</p><h3>Roles of the Two Keys</h3><ul><li>🔓 <strong>Public Key</strong></li><li>Can be shared with everyone</li><li>Used to <strong>encrypt</strong> data</li><li>🔐 <strong>Private Key</strong></li><li>Kept only by the owner</li><li>Used to <strong>decrypt</strong> data</li></ul><p>Data encrypted with a public key can be decrypted <strong>only with the matching private key</strong>.</p><h3>Step-by-Step Process</h3><h3>Step 1: Key Pair Generation</h3><p>The receiver (let’s say <strong>Bob</strong>) generates two keys:</p><ul><li>One <strong>Public Key</strong></li><li>One <strong>Private Key</strong></li></ul><h3>Step 2: Public Key Sharing</h3><p>Bob shares his <strong>Public Key</strong> with everyone</p><p>(It can be via the internet, website, email — any medium)</p><h3>Step 3: Message Encryption</h3><p>The sender (let’s say <strong>Alice</strong>) —</p><ul><li>Takes Bob’s <strong>Public Key</strong></li><li>Message (plaintext) → <strong>Encrypts</strong> → becomes Ciphertext</li></ul><h3>Step 4: Sending the Encrypted Message</h3><p>Alice sends the encrypted message to Bob</p><p>Even if someone intercepts it in between, they won’t understand anything</p><h3>Step 5: Message Decryption</h3><p>Bob —</p><ul><li>Uses his <strong>Private Key</strong></li><li>Ciphertext → <strong>Decrypts</strong> → gets the original message</li></ul><h3>Simple Real-World Example (Box Analogy)</h3><p>Imagine —</p><ul><li>Bob creates a <strong>locked box</strong></li><li>He gives the <strong>open lock to everyone</strong> (Public Key)</li><li>Alice locks the box using that lock and sends it</li><li>There is <strong>only one key to open the box</strong>, and it is with Bob alone (Private Key)</li></ul><p>Anyone can lock the box</p><p>But <strong>only Bob</strong> can open it</p><h3>Why Is It Secure?</h3><p>Asymmetric encryption relies on mathematical problems that are:</p><ul><li>Easy to do in one direction</li><li><strong>Almost impossible</strong> to do in the reverse direction</li></ul><p>Example:</p><ul><li>Multiplying large numbers is easy</li><li>But breaking them down to find their factors is extremely difficult</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=799cfa361368" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Importance of Cryptography]]></title>
            <link>https://medium.com/@sabbir0x7/cryptography-0017bfda86bf?source=rss-57df9590f1e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/0017bfda86bf</guid>
            <category><![CDATA[data-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[encryption]]></category>
            <category><![CDATA[decryption]]></category>
            <dc:creator><![CDATA[MD SABBIR AHMED]]></dc:creator>
            <pubDate>Mon, 16 Feb 2026 08:32:59 GMT</pubDate>
            <atom:updated>2026-02-16T08:36:39.116Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/713/1*rRylsycoO17D6nwLy7NuZw.png" /></figure><h3>Cryptography</h3><p><strong>Cryptography (cryptography)</strong> is the <strong>science/technique of hiding information</strong> in such a way that only specific people or systems can read or understand that information.</p><p>In simple terms,</p><p><strong>Technique for securing data</strong> = Cryptography</p><h3>Why is Cryptography needed?</h3><ul><li>To protect confidential information (passwords, card numbers)</li><li>To prevent data theft</li><li>To ensure secure communication online</li></ul><h3>Main objectives of Cryptography</h3><ol><li><strong>Confidentiality</strong> — Keeping information secret</li><li><strong>Integrity</strong> — Detecting whether information has been altered</li><li><strong>Authentication</strong> — Verifying who sent the information</li><li><strong>Non-repudiation</strong> — Preventing denial later</li></ol><h3>How does Cryptography work?</h3><ul><li>Plain Text → Encryption → Cipher Text</li><li>Cipher Text → Decryption → Plain Text</li></ul><p>Here, <strong>Key</strong> and <strong>Algorithm</strong> are the most important.</p><h3>Types of Cryptography</h3><ol><li><strong>Symmetric Encryption</strong> — Same key</li><li><strong>Asymmetric Encryption</strong> — Public + Private key</li><li><strong>Hashing</strong> — One-way (e.g., password)</li></ol><p>The ultimate goal of cryptography is to ensure secure communication even in the presence of an adversary/opponent/hacker. Here, secure means the confidentiality and integrity of the communicated data.</p><ol><li><strong>Confidentiality</strong> — Keeping information secret</li><li><strong>Integrity</strong> — Detecting whether information has been altered</li><li><strong>Authentication</strong> — Verifying who sent the information</li><li><strong>Non-repudiation</strong> — Preventing denial later</li></ol><p>Cryptography can be defined as the practice and study of techniques used for secure communication and data protection, where we expect the presence of adversaries and third parties. In other words, these adversaries should not be able to disclose or alter the content of the message.</p><p>Cryptography is used to protect confidentiality, integrity, and authenticity.</p><p><strong>[Connection snoop: secretly listening to / monitoring a network connection. Connection snooping</strong> is an activity where an attacker secretly listens to or reads the data exchange between two parties, without the user’s knowledge.]**</p><p><strong>[Session eavesdropping</strong> is an attack where the attacker secretly observes the data of an <strong>ongoing session</strong> between the user and the server**]**</p><p>In the modern era, you use cryptography every day, and most likely you are reading this through an encrypted connection. Consider the following situations where you use cryptography:</p><ul><li>When you log in to TryHackMe, your credentials are encrypted and sent to the server, so that no one can snoop your connection and retrieve them.</li><li>When you connect via SSH, your SSH client and server establish an encrypted tunnel, so that no one can eavesdrop on your session.</li><li>When you use online banking, your browser verifies the remote server’s certificate to ensure that you are communicating with your bank’s server, not an attacker.</li><li>When you download a file, how do you ensure that the file was downloaded correctly? Cryptography provides a solution through hash functions, which ensure that your file is identical to the original file.</li></ul><p>You may notice that there is very little direct interaction with cryptography, but its solutions and impact are present throughout the digital world. For example, if a company wants to handle credit card information and process related transactions, it must follow and implement the Payment Card Industry Data Security Standard (PCI DSS). In this case, PCI DSS ensures a minimum level of security for storing, processing, and transmitting credit card–related data. For large organizations, checking PCI DSS shows that data must be encrypted in both cases: at rest and in transit.</p><p><strong>PCI DSS</strong> = International rules for protecting card data</p><p>The full form of <strong>PCI DSS</strong> is</p><p><strong>Payment Card Industry Data Security Standard</strong></p><p>It is a <strong>security standard</strong> that ensures</p><p>💳 <strong>Credit / Debit card–related data is stored and processed securely</strong></p><h3>Who created PCI DSS?</h3><p><strong>PCI Security Standards Council</strong></p><p>This council was formed by major card companies:</p><ul><li>Visa</li><li>MasterCard</li><li>American Express</li><li>Discover</li><li>JCB</li></ul><h3>Relationship between Cryptography + PCI DSS</h3><p>PCI DSS clearly states:</p><ul><li>Card numbers <strong>must be encrypted</strong></li><li>Strong encryption such as AES, RSA must be used</li><li>Weak encryption is prohibited</li></ul><p>Here, <strong>the requirements of PCI DSS are fulfilled by using cryptography</strong></p><h3>What happens if PCI DSS is not followed?</h3><ul><li>Heavy fines</li><li>Card payments stopped</li><li>Brand reputation damaged</li><li>Legal action</li></ul><p>Just as PCI DSS compliance is required when handling payment card details, relevant standards must also be followed when handling medical records. While the standard for credit cards is relatively uniform, standards for handling medical records vary by country. For example, laws and regulations to consider when handling medical records include:</p><ul><li>HIPAA (Health Insurance Portability and Accountability Act) and HITECH (Health Information Technology for Economic and Clinical Health) — USA</li><li>GDPR (General Data Protection Regulation) — EU</li><li>DPA (Data Protection Act) — UK</li></ul><p>Although this list is not complete, it gives an idea that healthcare providers must comply with different legal requirements depending on their country. These laws and regulations prove that cryptography is an essential component which, although usually outside the direct attention of users, remains at the core of system security.</p><h3>Why is Cryptography so important for Medical Records?</h3><h3>Confidentiality</h3><p>Medical records contain:</p><ul><li>Medical history</li><li>Mental and physical condition</li><li>Medication and treatment information</li></ul><h4>If this information leaks <strong>without encryption</strong>:</h4><ul><li>Personal harm</li><li>Social and professional problems</li><li>Legal complications</li></ul><p>Cryptography ensures:</p><ul><li>Data <strong>at rest</strong> (database, disk)</li><li>Data <strong>in transit</strong> (network, API)</li></ul><p>In all cases, the information <strong>remains unreadable</strong>.</p><h3>Integrity (Data Integrity)</h3><p>If medical data is altered:</p><ul><li>Wrong diagnosis may occur</li><li>Wrong medication may be prescribed</li><li>Risk of loss of life may arise</li></ul><p>Using cryptography:</p><ul><li><strong>Hash</strong></li><li><strong>Digital signature</strong></li></ul><p>Through which it can be determined:</p><ul><li>Whether data has been changed</li><li>Who changed it</li></ul><h3>Authentication &amp; Access Control</h3><p>According to law:</p><ul><li>Only <strong>authorized doctors / staff</strong> can access data</li></ul><p>Cryptography helps with:</p><ul><li>Secure login</li><li>Certificate-based authentication</li><li>Digital identity verification</li></ul><p>As a result:</p><ul><li>Who accessed the data</li><li>Who modified it</li></ul><p>An <strong>audit trail</strong> of everything can be maintained.</p><h3>Legal &amp; Regulatory Compliance</h3><p>HIPAA, GDPR, DPA — all laws state:</p><ul><li>Sensitive data must be protected with <strong>strong cryptographic protection</strong></li></ul><p>If cryptography is not used:</p><ul><li>Heavy fines</li><li>Legal action</li><li>Destruction of the organization’s reputation</li></ul><p>Therefore, cryptography is not just a technical matter,</p><p>It is a mandatory part of <strong>legal compliance</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0017bfda86bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is Module in Python:]]></title>
            <link>https://medium.com/@sabbir0x7/what-is-module-in-python-1071e595607d?source=rss-57df9590f1e8------2</link>
            <guid isPermaLink="false">https://medium.com/p/1071e595607d</guid>
            <category><![CDATA[app-development]]></category>
            <category><![CDATA[coding-for-beginners]]></category>
            <category><![CDATA[python-programming]]></category>
            <dc:creator><![CDATA[MD SABBIR AHMED]]></dc:creator>
            <pubDate>Fri, 13 Feb 2026 15:59:25 GMT</pubDate>
            <atom:updated>2026-02-13T15:59:25.446Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZrTTMcVW3_D3zqVj6KEpfw.png" /></figure><h3>Understanding Modules in Python: A Beginner’s Guide</h3><p>If you are diving into Python, you will frequently come across the term <strong>“Module.”</strong> But what exactly is it? Let’s break it down simply.</p><h3>1. What exactly is a Module?</h3><p>In Python, a <strong>Module</strong> is essentially a file containing Python code. Any file that ends with a .py extension and contains variables, functions, or classes can be considered a module.</p><ul><li><strong>Standard Modules:</strong> These come pre-installed with Python (e.g., socket.py, math.py, random.py).</li><li><strong>User-defined Modules:</strong> These are the custom files you create yourself to organize your code.</li></ul><h3>2. How does it work?</h3><p>Imagine you have a file named calculator.py with the following code:</p><p>Python</p><pre># Inside calculator.py<br>def add(a, b):<br>    return a + b</pre><p>If you want to use this add function in another file, you can simply &quot;import&quot; it like this:</p><pre>import calculator<br># Using the function from the module<br>print(calculator.add(5, 10))</pre><p>In this scenario, calculator.py is acting as a <strong>Module</strong>.</p><h3>3. The Visual Structure of a Module</h3><p>A typical module acts as a container for:</p><ul><li><strong>Functions:</strong> Small blocks of code designed to perform specific tasks.</li><li><strong>Variables:</strong> Used to store and share data across different parts of a program.</li><li><strong>Classes:</strong> Blueprints used for Object-Oriented Programming (OOP).</li></ul><h3>4. Module vs. Package vs. Library</h3><p>It is easy to get confused by these terms. Here is a simple way to distinguish them:</p><ul><li><strong>Module:</strong> A single .py file.</li><li><strong>Package:</strong> A folder containing multiple modules.</li><li><strong>Library:</strong> A collection of various packages and modules designed for a specific purpose (e.g., Pandas for data analysis or TensorFlow for machine learning).</li></ul><h3>Pro Tip: How to find a Module’s location?</h3><p>If you are curious about where a specific module (like socket) is located on your computer, you can check its file path using this simple Python script:</p><pre>import socket<br>print(socket.__file__)</pre><p>Running this will show you the exact directory where the .py (or compiled .pyc) file resides.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1071e595607d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>