<?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 Yasaswini Gaddam on Medium]]></title>
        <description><![CDATA[Stories by Yasaswini Gaddam on Medium]]></description>
        <link>https://medium.com/@yasaswini.gaddam21?source=rss-4977adc3534e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*7T2d0b5jqnKHasIS</url>
            <title>Stories by Yasaswini Gaddam on Medium</title>
            <link>https://medium.com/@yasaswini.gaddam21?source=rss-4977adc3534e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 00:18:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@yasaswini.gaddam21/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Understanding HTTP Cookies: Login, Session Management, and Cookie Validation]]></title>
            <link>https://medium.com/@yasaswini.gaddam21/inspecting-the-cookie-protocol-login-cookie-installation-correct-cookie-installation-incorrect-56224cf17da2?source=rss-4977adc3534e------2</link>
            <guid isPermaLink="false">https://medium.com/p/56224cf17da2</guid>
            <category><![CDATA[web-security]]></category>
            <category><![CDATA[cookies]]></category>
            <category><![CDATA[burpsuite]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Yasaswini Gaddam]]></dc:creator>
            <pubDate>Thu, 23 Jul 2026 11:24:47 GMT</pubDate>
            <atom:updated>2026-07-23T11:26:02.338Z</atom:updated>
            <content:encoded><![CDATA[<h4>Objective:</h4><p>To understand how cookies work in web applications, how they’re installed during login, and how browsers manage correct and incorrect cookie installations.</p><h4><strong>Protocol: HTTP — The Communication Protocol</strong></h4><ul><li>HTTP (Hypertext Transfer Protocol) is a stateless protocol.</li><li>When you open a website, your browser is actually making an HTTP request to the server that hosts the website. The server responds by sending back the HTML, CSS, JS and images which your browser displays.</li><li>HTTP is stateless (HTTP can’t remember previous interactions). This means every time you request something like opening a new page or refreshing, the server doesn’t remember who you are or what you were doing before. Each request is treated as if it’s coming from a completely new user — even if it’s the same browser/person.</li></ul><h4>Protocol: Cookie — The Memory for HTTP</h4><ul><li>Cookie are small text files(key-value pairs) created by the server and stored in your browser. They allow server to identify and track user across multiple requests.</li></ul><h4><strong>Cookie Attributes</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/547/1*eTjxeEIwnkGnxmSYWF2QtQ.png" /></figure><pre>sessionId=session123; Expires=Wed, 10 Apr 2025 10:00:00 GMT; Path=/; Secure; HttpOnly</pre><ul><li>sessionId=session123: This is a unique ID for your session.</li><li>Expires: When this cookie will expire.</li><li>Path: Where this cookie is valid on the website.</li><li>Secure: Cookie only sent over HTTPS.</li><li>HttpOnly: Can’t be accessed by JavaScript (protects from XSS).</li></ul><h4>How It Works — Step-by-Step</h4><ul><li>You open a website: example.com</li><li>Browser sends this request:</li></ul><pre>GET / HTTP/1.1<br>Host: example.com</pre><p>Server responds:</p><ul><li>Shows login page.</li><li>No cookies yet because you’re not logged in.</li></ul><h4><strong><em>Login Flow with Cookies</em></strong></h4><p>Browser Server</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dBwCRFFwR28Kk4vbmOgBRw.png" /></figure><h4><strong>Difference Between Cookie and set-cookie</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*aX99A-ePG9kQRmJe6udcWw.png" /></figure><h4>Inspecting the Cookie:</h4><ol><li>Using Browser Developer Tools (DevTools)</li></ol><ul><li>Open the website.</li><li>Right-click &gt; Inspect &gt; Go to the Application tab.</li><li>Under Storage &gt; Cookies, select the domain.</li><li>You’ll see cookie details</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sC5TLJ_VKyl6su7vLBPsGg.png" /></figure><p>Best for:</p><ul><li>Frontend developers</li><li>Debugging login/session</li><li>Analyzing cookie settings</li></ul><p>2. Using Browser Network Tab (DevTools)</p><p>Cookies are also part of HTTP headers. We can inspect them in real-time requests:</p><ul><li>Open Network tab in DevTools.</li><li>Refresh the page.</li><li>Click any HTTP request.</li><li>Look under Headers:</li><li>Request Headers → sent cookies (Cookie)</li><li>Response Headers → received cookies (Set-Cookie)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*80Ah8zyr4n4NqDg4yNGCEw.png" /></figure><p>Best for:</p><ul><li>Seeing cookie transmission in requests</li><li>Analyzing how servers send cookies</li></ul><p>3. Using Web Security Tools (e.g., Burp Suite, OWASP ZAP)</p><p>These tools help to inspect and manipulate cookies to test for:</p><ul><li>Insecure cookie settings (e.g., no HttpOnly or Secure flags)</li><li>Session hijacking</li><li>Cross-site scripting (XSS)</li><li>Session fixation</li></ul><p>In Burp, go to the Proxy tab → Intercept sub-tab → Ensure intercept is on. In your browser, visit the target website (e.g., Medium.com or a test site). You will see the request intercepted, Look for this cookies in the raw HTTP request.</p><p>Best for:</p><ul><li>Ethical hacking / Pen testing</li><li>Analysing secure cookie practices</li></ul><p>4. Using Intercepting Proxies / Packet Sniffers (e.g., Wireshark)</p><ul><li>Filter for HTTP packets in Wireshark.</li><li>Look at headers containing Cookie or Set-Cookie.</li></ul><p>Best for:</p><ul><li>Network-level analysis</li><li>Forensics or traffic inspection</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*Yge3fN7h5RaGVG6IHPWd2Q.png" /></figure><h4>Cookie Before login and after login</h4><p>To understand how cookies are set and validated during login, and analyse the behaviour of:</p><ul><li>Correct cookie installation (valid login)</li><li>Incorrect cookie installation (manipulated or invalid cookies)</li></ul><h4>Tools Required:</h4><ul><li>Web Browser (e.g., Chrome or Firefox)</li><li>Burp Suite</li><li>A test web application with login (e.g., DVWA, bWAPP, WebGoat, or local Node.js app) for now, we are using DVWA.</li><li>Browser configured to route traffic through Burp’s proxy</li></ul><h4>Start Burp and Set Proxy in Browser</h4><p>Launch Burp: JAVA_CMD=”/usr/lib/jvm/java-21-openjdk-amd64/bin/java” burpsuite</p><p>In Burp Suite → Proxy &gt; Intercept → Intercept is ON → Open Browser &gt; <a href="http://localhost/DVWA/login.php"><strong>http://localhost/DVWA/login.php</strong></a></p><p>Look at the Request:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e2LwdCaj-bPiWb-kK0GXmw.png" /><figcaption>PHPSESSID — this is a <strong>session cookie set before login</strong>.</figcaption></figure><h4>Perform a Valid Login</h4><p>Submit the form using these details:</p><ul><li>Username: admin</li><li>Password: password</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*66Lj48_q1DC2DKNPZB244Q.jpeg" /></figure><p>Burp will capture the POST request: <em>POST /DVWA/login.php HTTP/1.1</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FbIo52z4QcNrUZvdBzerfQ.png" /></figure><p>In <strong>Response</strong>, observe:</p><ul><li>Redirect to the home page or security page.</li><li>No new Set-Cookie → Server <strong>associates login with the existing session</strong>.</li></ul><h4>Test Correct Cookie Installation (Replay in Repeater)</h4><ol><li>In HTTP History, right-click the login POST → Send to Repeater</li><li>Resend the same request (same PHPSESSID)</li><li>Response → Still shows you’re logged in</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PyRG7neFfnvkqzD22Dukbg.jpeg" /></figure><h4>Test Incorrect Cookie (Session Hijack Test)</h4><p>In Repeater:</p><pre>Change this header:<br>Cookie: PHPSESSID=abc123456fakecookie</pre><ul><li>Send the request again</li></ul><p>Response:</p><ul><li>You’ll likely be <strong>redirected to login.php</strong></li><li>You are <strong>not logged in</strong> → invalid session rejected</li></ul><p>The server responded with: HTTP/1.1 200 OK</p><p>And showed the login page: &lt;title&gt;Login :: Damn Vulnerable Web Application (DVWA)&lt;/title&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dncrarVmlZlkaIXTOWXoHA.png" /></figure><h4>Common Cookie Security Attacks</h4><p><strong>Session Hijacking :</strong> Stealing another user’s session cookie.</p><p><strong>Session Fixation : </strong>Attacker forces victim to use a known session ID.</p><p><strong>Cross-Site Scripting (XSS) : </strong>Malicious JavaScript steals cookies (unless HttpOnly is enabled).</p><p><strong>Cross-Site Request Forgery (CSRF) :</strong> Browser automatically sends cookies to another site.</p><p><strong>Mitigation</strong>:</p><ul><li>HttpOnly</li><li>Secure</li><li>SameSite</li><li>Session regeneration after login</li><li>HTTPS</li></ul><h3>Conclusion</h3><p>Although HTTP is a stateless protocol, cookies enable web applications to maintain user sessions by storing a unique session identifier in the browser. Throughout this exercise, we explored how cookies are created during the login process, how browsers store and automatically send them with subsequent requests, and how servers use them to authenticate users. By inspecting cookies using browser Developer Tools, Burp Suite, and packet analysis tools, we gained a practical understanding of cookie transmission and session management. We also observed the difference between a valid session cookie and a manipulated one, demonstrating how servers reject invalid session identifiers to prevent unauthorized access. Finally, understanding common cookie-related attacks such as session hijacking, session fixation, XSS, and CSRF highlights the importance of implementing security measures like HttpOnly, Secure, SameSite, HTTPS, and session regeneration. Together, these concepts form the foundation of secure authentication and session management in modern web applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=56224cf17da2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DATABASE SECURITY]]></title>
            <link>https://medium.com/@yasaswini.gaddam21/database-security-8f65fb65606b?source=rss-4977adc3534e------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f65fb65606b</guid>
            <dc:creator><![CDATA[Yasaswini Gaddam]]></dc:creator>
            <pubDate>Wed, 17 Jun 2026 02:11:55 GMT</pubDate>
            <atom:updated>2026-06-17T02:11:55.201Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>UNDERSTANDING DATA VULNERABILITIES</strong></p><p>database are susceptible to various threats which comprises CIA traid. Vulnerabilties may include:</p><p>SQL Injection, Privilage escalation, Unpatched software and misconfigurations.</p><ul><li><strong>SQL Injection</strong>: Malicious SQL statements inserted into an entry field for execution.</li><li><strong>Privilege Escalation</strong>: Gaining unauthorized access to higher-level permissions.</li><li><strong>Unpatched Software</strong>: Outdated database systems with known security flaws.</li><li><strong>Misconfigurations</strong>: Incorrect settings that expose the database to risks</li></ul><p><strong>What is database security?</strong></p><p>Database security is a set of strategies, practices, tools, and technologies required to protect the database management system from a unauthorised and malicious attacks. Used to preserve CIA traid.</p><blockquote>Database security concerned with the data protection and database integrity is concerned with data integrity.</blockquote><p>Database security deals with data, database management system, server, and computing infrastructure to access the database.</p><p>If the database is not implemnted securely, it produces a catastrophic results such as data breach or damage to the data server. The consequences that lead to lack of database security are:</p><ul><li>Unauthorized access to the database which leads to data breach, data corruption</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i_HcSPykMZujK7xgLOeimw.jpeg" /></figure><ul><li>Financial loss</li><li>Experience discontinues in some operations due to system failure, downtime, and data damage which leads to loss of revenue.</li><li>Loss of trust towards business</li></ul><p>Top 10 best practices to enhance database security:</p><ol><li>Physical Security</li></ol><p>whether the server is virtual or physical you need to take care and protect it from outsiders and insiders. If someone breaks your physical server they can steal the sensitive information and exploit them. It’s hard to catch these kinds of attacks because they can get around digital security.</p><ul><li>If you have your own servers, make sure that you secure physically secure using cameras, strong locks, and having security guards around. Also certain people should be allowed to touch the servers. Follow certain standards like ISO27001 inorder to protect the physical servers from scratch.</li><li>If your server is virtual, you don’t need to control the hardware and responsibility of the physical security shifts to the provider. Your main focus becomes on logical &amp; configuration level security not on hardware protection.</li></ul><p>2. Limited Access</p><p>Access control deals with authorization and authentication.</p><ul><li>authentication — who has access to the database</li><li>authorization — which actions can be performed by whom</li></ul><p>Role based access control is highly secure method. Database access should be restricted according to their job. This practice is very crucial for organizations like that need to make their database available to the other applications via API endpoints.</p><p>3. Strong User Authentication</p><p>Choosing a strong authentication methods can lead to prevent the unauthorized access to the database. Different types of authentication are</p><ul><li>Single Factor authentication — doesn’t have additional security layer, basic authentication</li><li>Two-factor authentication — has a additional security layer</li><li>Mutli-factor authentication — two or more authentication methods to confirm the user identity</li></ul><p>permitting only confirmed IP address can reduce the chances of data breach, although IP addresses can be faked or hidden, it takes extra work for someone trying to break in.</p><p>4. Data Encryption Protocols</p><p>Encryption is essential to defend some ransomeware attacks as well as helping to stay complaint with GDPR guidelines General Data Protection Regulation Considerations. When the data is encrypted, even if the cyber attackers hold the data, the data is safe. All database connections should safely encrypted via TLS(transport layer security) which protects data in transit.</p><p>5. Regular backups</p><p>Regular backups could mitigate the risk of losing sensitive information due to any circumstances, such as data corruption or a system failure. Best practice is 3–2–1 backup rule:</p><ul><li>Store three copies of the data</li><li>Use two types of storage</li><li>Store one in an offsite location</li></ul><p>The backups should also be tested periodically to ensure they perform as expected. The data should be able to be restored from the backup without any issues. This way, the developers would be able to confirm that the backup works.</p><p>6. Regular database audits</p><p>Regularly monitor and log all database activities — like logins, data changes, and queries. Store logs securely. Track access to sensitive data and alert admins immediately on any unauthorized or suspicious actions. Maintain proper documentation for audits.</p><p>7. Updates Applications</p><p>Use verified and regularly updated DBMS software. Install the latest patches and avoid outdated plugins or third-party tools. Old software is vulnerable — studies show 89% of codebases in 2024 lacked updates for over 4 years, making them easy targets for attackers.</p><p>8. Use Firewalls</p><p>Firewalls add an extra layer of protection by blocking unwanted traffic and preventing unnecessary outbound connections from the database. Use both database firewalls and web application firewalls (WAF) to defend against threats like SQL injection. Keep all firewalls updated regularly.</p><p>9. separate database servers</p><p>Don’t store the database on the same server as the website. If the web server is hacked, the database stays safe. Limit the database operations to only what’s needed and use access control. Implement SIEM tools for real-time monitoring and quick response to threats.</p><p>10. Separate Test env from production env</p><p>Keep test and production environments separate. Test setups should never contain real data and must have limited access. Developers shouldn’t access the production database unless necessary. Follow strict procedures when moving databases from test to production, and fix all bugs and security issues before deployment.</p><p><strong>Privilages:</strong></p><ul><li>System privilege — System adminstrative powers</li><li>Object privilege — allow for the use of certain operations on database objects as authorized by another user.</li><li>Principle of least privilege — giving users, applications, or processes only the minimum access or permissions needed to perform their tasks and nothing more.</li></ul><p><strong>Authentication and Authorization in DBMS</strong></p><p><strong>Authentication</strong></p><p>authentication is the process of verifying the identity of a user who is making an API request (verifying who a user is), and authorization is the process of determining whether that user has permission to access a particular API (verifying what a user is allowed to do).</p><p>methods of authentication:</p><ol><li>HTTP basic auth — base64 encoded this is insecure method unless this uses HTTPS; this is used for local development, debugging, testing.</li><li>API keys —unique identifiers used to authenticate the requests issued by API providers, Similar to basic auth, it’s not secure unless it’s transmitted over HTTPS. Always transmit API keys over HTTPS to prevent exposure via networking sniffing. Donot pass in URLs instead include them in authorization headers. Eg, Authorization: Bearer YOUR_API_KEY. Avoid long term API keys. API key must be included in every API call to verify the client</li><li>JSON web tokens — secure, compact, stateless way to transmit user identity and claim as a JSON object. It is signed to ensure integrity and optionally encrypted for confidentiality. user logs in -&gt; server verifies the credential; server sends signed JWT -&gt; client -&gt; client stores token -&gt; in subsequent requests client includes JWT in authorization header. Server validates the token, without needing a DB call. JWT eliminates latency, database lookups. JWT are commonly used with OAuth2.0 and OIDC.</li><li>OIDC — OpenID connect : : Authentication protocol<strong> </strong>built on top of OAuth 2.0. For example, You visit a news site. Instead of signing up, you click “Sign in with Google”. Google (OIDC provider) confirms your identity and sends your info to the news site. You’re now logged in without creating a new account on that site.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RAC_d3JHDB_j5bz1WXB_IA.jpeg" /></figure><p>5. Multi-Factor Authentication(MFA) — requiring multiple factors for authentication. It can be used to secure the authentication at the IdP level in OIDC.</p><p><strong>Authorization</strong></p><p>Authorization verifies what a user is allowed to do.</p><ol><li>OAuth 2.0 is a secure, token-based authorization(access via tokens, not credentials) method that allows apps to access your data without sharing your password; Delegated access (limited and revocable). The authorisation code can’t be used to access user data.</li><li>Scope-Based Authorization — In OAuth 2.0, scopes are like permission labels that define what parts of a user’s data a client app can access. When an app asks for access, it requests specific scopes (e.g., read-only, write access). The user (or the system) can approve or deny those permissions. Limits damage if a token is stolen, Gives users control over what an app can do, Keeps access minimal (principle of least privilege)</li><li>Role-based access control — way to control who can do what in a system based on their role. Define roles (like <em>admin</em>, <em>editor</em>, <em>viewer</em>). Assign permissions to those roles. Assign users to roles.</li><li>Attribute-based access control — Attribute-Based Access Control (ABAC) is a method of granting access based on attributes, not just roles. User attributes — like department, job title, age. Resource attributes — like classification level, owner. Environment attributes — like time of access, location, device type.</li><li>Policy-Based Access Control (PBAC) is a model where access decisions are made based on defined policies — rules that consider user roles, attributes, and conditions. It’s more dynamic and flexible than just using roles (RBAC) or attributes (ABAC) alone. Policies define <em>who</em> can do <em>what</em>, <em>when</em>, and <em>under what conditions</em>.</li></ol><p>The above mentioned all methods comes under methods to secure database.</p><p><strong>Database activity monitoring</strong></p><p><strong>DAM</strong> is a <strong>security system</strong> that tracks all activity happening inside your <strong>database</strong> — especially <strong>who is doing what</strong>, in <strong>real time</strong>.</p><p>It watches for:</p><ul><li>Suspicious or unauthorized queries</li><li>Changes made by database administrators</li><li>Unusual behavior (like someone accessing sensitive data at odd hours)</li></ul><ol><li><strong>Network-based monitoring </strong>— analysing protocol traffic over network</li><li><strong>Agent-based monitoring</strong> — observing the local database activity on each server using software agents, or both — typically include the activity of database administrator. Agents allow this information to be captured in a fashion that can not be disabled by database administrators(who has ability to disable or enable or modify the native audit logs.</li></ol><p>Why DAM?</p><ul><li><strong>Stops insider threats</strong>: Tracks even trusted users like DB admins.</li><li><strong>Detects intrusions</strong>: Finds unusual or suspicious activity patterns.</li><li><strong>Enforces policies</strong>: Stops actions that break security rules.</li><li><strong>Supports audits</strong>: Keeps a tamper-proof history of all activity.</li><li><strong>Ensures compliance</strong>: Helps meet security standards (e.g., GDPR, HIPAA).</li></ul><p><strong>Native Audits</strong></p><p>Native audit refers to the built-in auditing features that most databases (like Oracle, MySQL, SQL Server) already have. It allows you to track who did what in the database by logging user actions and SQL statements.</p><p>The database records actions like:</p><ul><li>Logins/logouts</li><li>Data access or changes</li><li>Permission changes</li></ul><p>These logs are saved in audit trails, which can then be moved to a secure system for analysis.</p><h3>What Are Database Security Processes and Procedures?</h3><p>These are <strong>routine actions and policies</strong> put in place to <strong>protect the database</strong> from unauthorized access, misuse, and failures.</p><h3>🔐 Key Components</h3><p>Component Purpose <strong>Privilege Review </strong>Regularly check and remove unnecessary user permissions <strong>Two-Factor Authentication (2FA). </strong>Adds an extra layer of security to login, especially for human users <strong>Automated Process Account Security. </strong>Use <strong>encrypted passwords</strong> and <strong>access controls</strong> for non-human accounts</p><h3>🌩️ Disaster Recovery</h3><ul><li>Set up <strong>replication</strong> of the database in another <strong>geographic location</strong>.</li><li>Ensures <strong>services continue</strong> even during security incidents or system failures.</li></ul><h3>🕵️ Database Forensics</h3><p>After a breach, use forensic tools to:</p><ul><li><strong>Analyze what happened</strong></li><li><strong>Understand the impact</strong></li><li><strong>Update systems and procedures</strong> to prevent future issues</li></ul><p><strong>Cyber Graffitie</strong></p><p>While “Cyber Graffiti” isn’t a standardized term in cybersecurity, it metaphorically represents unauthorized or malicious alterations to digital platforms, akin to how graffiti defaces physical structures. In the context of databases, this can manifest as SQL Injection attacks, where malicious actors “deface” or manipulate databases through unauthorized queries.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f65fb65606b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenSSL to Create a Self-Signed Certificate and Configure It in Apache]]></title>
            <link>https://medium.com/@yasaswini.gaddam21/openssl-to-create-a-self-signed-certificate-and-configure-it-in-apache-34d0ae89b55c?source=rss-4977adc3534e------2</link>
            <guid isPermaLink="false">https://medium.com/p/34d0ae89b55c</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[ssl]]></category>
            <category><![CDATA[apache]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[openssl]]></category>
            <dc:creator><![CDATA[Yasaswini Gaddam]]></dc:creator>
            <pubDate>Tue, 19 Aug 2025 14:50:34 GMT</pubDate>
            <atom:updated>2025-08-19T14:50:34.343Z</atom:updated>
            <content:encoded><![CDATA[<p>Securing your website with HTTPS is crucial for protecting user data and improving SEO rankings. If you’re setting up a local development server or testing SSL/TLS configurations, a self-signed certificate can be a great solution. In this guide, we’ll use <strong>OpenSSL</strong> to generate a self-signed certificate and configure it in <strong>Apache</strong>.</p><h3>Step 1: Install OpenSSL and Apache</h3><p>Before we begin, ensure that OpenSSL and Apache are installed on your system.</p><p>On Ubuntu or Debian-based distributions, use the following command:</p><pre>sudo apt update &amp;&amp; sudo apt install apache2 openssl</pre><p>For CentOS/RHEL:</p><pre>sudo yum install httpd mod_ssl openssl</pre><h3>Step 2: Generate a Private Key</h3><p>First, we will generate a private key. This key must be kept secret and is used by the server to encrypt and sign data.</p><pre>openssl genpkey -algorithm RSA -out privatekey.pem</pre><ul><li>genpkey: The OpenSSL command to generate a private key.</li><li>-algorithm RSA: Specifies the RSA algorithm for the key.</li><li>-out privatekey.pem: The name of the output file for your new private key.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*ob118KhTmbnJMxSH27DR6g.png" /></figure><h3><strong>Step 3: Generate a Certificate Signing Request (CSR)</strong></h3><p>Next, we will create a Certificate Signing Request (CSR). The CSR contains the public information that will be included in your certificate, such as your domain name and location.</p><pre>openssl req -new -key privatekey.pem -out myrequest.csr</pre><p>During the process, OpenSSL will prompt you for information such as <strong>Common Name (CN)</strong>, <strong>Organization, Locality, Country and E-mail Address</strong>. If you’re setting this up for localhost, enter localhost as the Common Name. Alternatively, if you are setting this up for a live website, use your domain name (e.g., <a href="https://www.google.com/search?q=https://www.yourwebsite.com">www.yourwebsite.com</a>) as the Common Name instead of localhost.</p><p>Here, I have taken Common Name (CN) = localhost.</p><ul><li>Use localhost as the <strong>Common Name (CN)</strong> for local testing.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rdNT8ZRIct_lwGSqqG81HQ.jpeg" /></figure><h3>Step 4: Generate a Self-Signed SSL Certificate</h3><p>Now, we will use your private key (privatekey.pem) and your CSR (myrequest.csr) to generate the final self-signed SSL certificate file (mycertificate.crt).</p><pre>openssl x509 -req -days 365 -in myrequest.csr -signkey privatekey.pem -out mycertificate.crt</pre><ul><li>x509: The OpenSSL command for managing certificates.</li><li>-req: Indicates that we are processing a CSR.</li><li>-days 365: Sets the certificate&#39;s validity period to 365 days.</li><li>-in myrequest.csr: Specifies the input CSR file.</li><li>-signkey privatekey.pem: Specifies the private key to use for signing the new certificate.</li><li>-out mycertificate.crt: The name of the final SSL certificate file.</li></ul><p>This creates:</p><ul><li>mycertificate.crt (SSL certificate)</li><li>Privatekey.pem (Private key)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o4ImkvyQSwwKGzsdFgU7og.jpeg" /></figure><h3>Step 5: Install the Certificate and Configure Apache</h3><p>For Apache to use the certificate, we need to move the generated files into the system’s SSL directories.</p><pre>sudo mv mycertificate.crt /etc/ssl/certs/<br>sudo mv privatekey.pem /etc/ssl/private/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*myVB-S6Sqp9qS0J2p2v0dw.jpeg" /></figure><p>Configure Apache to Use SSL</p><p>Edit Apache’s SSL configuration file<strong>:</strong></p><pre>sudo nano /etc/apache2/sites-available/default-ssl.conf</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*np-s_IpIp9HjYoHFQU9p_w.png" /></figure><p>Inside this file, find and update the following lines to point to your new certificate and key files:</p><p>Modify &lt;VirtualHost *:443&gt; to include the certificate files:</p><pre>&lt;VirtualHost *:443&gt;<br>    ServerAdmin email_123@gmail.com<br>    ServerName localhost<br><br>    SSLEngine on<br>    SSLCertificateFile /etc/ssl/certs/mycertificate.crt<br>    SSLCertificateKeyFile /etc/ssl/private/privatekey.pem<br><br>    DocumentRoot /var/www/html<br><br>    &lt;Directory /var/www/html&gt;<br>        Options Indexes FollowSymLinks<br>        AllowOverride All<br>        Require all granted<br>    &lt;/Directory&gt;<br>    ErrorLog ${APACHE_LOG_DIR}/error.log<br>    CustomLog ${APACHE_LOG_DIR}/access.log combined<br><br>    # ... other configurations<br><br>&lt;/VirtualHost&gt;</pre><ul><li>SSLEngine on: Enables the SSL engine for this virtual host.</li><li>SSLCertificateFile: Points to your public certificate file.</li><li>SSLCertificateKeyFile: Points to your private key file.</li></ul><p><strong>Save the file</strong> (CTRL + X, then Y, then Enter).</p><h3>Step 6: Enable SSL and Restart Apache</h3><p><strong>Enable SSL Module</strong>:</p><p>After configuring the &lt;VirtualHost&gt;, you need to enable Apache’s SSL module and the new SSL site configuration.</p><pre>sudo a2enmod ssl</pre><p><strong>Enable the SSL site configuration</strong>:</p><pre>sudo a2ensite default-ssl</pre><p>Finally, restart the Apache service to apply all the changes. You can check its status to ensure it restarted without errors.</p><p><strong>Restart Apache</strong>:</p><pre>sudo systemctl restart apache2</pre><p><strong>Verify Apache is Running</strong>:</p><pre>sudo systemctl status apache2</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*5ewHyHdmBy9BKPcKqMyNdw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*UR-w9iZFwyUSyZgeFzcJKQ.png" /></figure><p>Woah, SSL is enabled successfully, we will see active running!</p><p>Test HTTPS on localhost</p><p><strong>Open your browser</strong> and visit:</p><pre>https://localhost</pre><p>If you are running on your own domain excute the command</p><pre>https://&lt;domain name&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*YjHuuUcPOIUHu5nyPMvVRw.png" /></figure><p>If you see a <strong>certificate warning</strong>, click:</p><ul><li><strong>Advanced → Proceed to localhost</strong></li><li>(This happens because it’s a self-signed certificate.)</li></ul><p>Why Are You Getting a Certificate Warning in the Browser?</p><p>You are getting the <strong>“Your connection is not private”</strong> or <strong>certificate warning</strong> because your SSL certificate is <strong>self-signed</strong> rather than issued by a trusted Certificate Authority (CA) like Let’s Encrypt, DigiCert, or GlobalSign.</p><p><strong>Reasons for the Warning:</strong></p><ol><li><strong>Self-Signed Certificate</strong> 🚨</li></ol><p>· Browsers only trust certificates from well-known CAs.</p><p>· Since you created your certificate yourself (openssl x509 -req), it <strong>is not trusted</strong> by default.</p><ol><li><strong>Unrecognized Certificate Authority (CA)</strong></li></ol><ul><li>Trusted certificates are signed by recognized CAs.</li><li>Your browser sees <strong>your certificate as unverified</strong> since it wasn’t signed by an official CA.</li></ul><ol><li><strong>Missing Certificate Chain (Intermediate CA)</strong></li></ol><ul><li>Public CAs issue <strong>certificate chains</strong> that browsers verify.</li><li>A self-signed certificate lacks this, so it’s marked as <strong>untrusted</strong>.</li></ul><p>Below are the screenshots of certificate which has been created for localhost.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SOLe12Avvas6uCrYYc1jYw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FqQ4Fk0Ox74WnzJ3UIsSqQ.jpeg" /></figure><p>Verify SSL Certificate Details:</p><pre>openssl x509 -in /etc/ssl/certs/mycertificate.crt -text -noout</pre><p><strong>If everything works, your localhost website is now secured with HTTPS!</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*otRdiJRnVEACimpBQRtZEA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*rCiCT5jyWqRnJsBRIf6Jtw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*6dsQBUy7SlYA4jX23ZVtfg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*SeQQqV8_NM43ujkhJRzGPQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34d0ae89b55c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Wagner–Fischer algorithm: Minimum Edit Distance]]></title>
            <link>https://medium.com/@yasaswini.gaddam21/wagner-fischer-algorithm-minimum-edit-distance-4e61bba9b656?source=rss-4977adc3534e------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e61bba9b656</guid>
            <dc:creator><![CDATA[Yasaswini Gaddam]]></dc:creator>
            <pubDate>Sat, 20 Apr 2024 16:01:23 GMT</pubDate>
            <atom:updated>2024-04-20T16:39:12.310Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you ever marvelled at the seamless corrections suggested by spell-checkers for misspelled words or pondered over the intricate alignment of DNA sequences to reveal genetic similarities? These feats of modern technology are powered by a foundational algorithm known as the Wagner-Fischer algorithm.</p><p>In this blog post, we embark on an exploration of the Wagner-Fischer algorithm, a dynamic programming approach that calculates the minimum edit distance between two strings of characters.</p><p>But before we dive in, let’s start with a quick interactive activity to get us thinking about the concept of ‘transformation.’ Imagine you have two strings: ‘CAT’ and ‘CUT.’ How many operations do you think it would take to transform ‘CAT’ → ‘CUT’? Think about the possible operations: insertion, deletion, or substitution of a single character.</p><h3>Evolution from Levenshtein Distance to Wagner-Fischer Algorithm</h3><p>Vladimir Levenshtein introduced the Levenshtein distance algorithm in 1965 for spell-checking and calculating the similarity between two strings. However, the algorithm’s recursive nature led to inefficiencies, with an exponential time complexity of O(3^n), where n is the length of the strings.</p><p>In 1971, Robert Wagner and Michael Fischer revolutionized string comparison with the Wagner-Fischer algorithm. This dynamic programming approach vastly improved efficiency by solving each subproblem just once and storing their solutions. This innovation eliminated the excessive repetitive work of Levenshtein’s recursive approach, propelling string comparison into a new era of efficiency.</p><p>Wagner&#39;s Fischer algorithm is based on dynamic programming breaking down the complex problem into simpler sub problems solving each of these sub problems just once and storing their solutions by doing this the the algorithm avoids the excessive repetitive work seen in Levin’s recursive approach.</p><h3>Understanding the Wagner-Fischer Algorithm</h3><p>The minimum edit distance(Levenshtein distance) between two strings is defined by three parameters:</p><ul><li>Number of insertions</li><li>Number of deletions</li><li>Number of Substitutions</li></ul><p>For example,</p><blockquote>str 1: CAT<br>str 2: CUT<br>The lavenshtein distance i.e. LD(str1,str2)=1, because we need to substitute &#39;A&#39; with &#39;U&#39; to transform the string1 to string2.</blockquote><blockquote>str 1: Horse<br>str 2: Ros<br>The lavenshtein distance i.e. LD(str1,str2)=3, because we need to substitute &#39;H&#39; with &#39;R&#39;, remove ‘r’, remove ‘e’ to transform the string1 to string2.</blockquote><p>Dynamic Approach is done in two ways:</p><ol><li>Top Down approach</li><li>Bottom Up approach</li></ol><p>Here’s how you can implement it using both the top-down and bottom-up approaches :</p><h3><strong>Top down approach<em>(M</em></strong><em>emoization)</em></h3><ul><li><strong>Initialization:</strong> The algorithm initializes a memoization table to store edit distances, with dimensions based on the lengths of the two input strings.</li></ul><blockquote>dp[i][0] = i // Initialize first column</blockquote><blockquote>dp[0][j] = j // Initialize first row</blockquote><ul><li><strong>Recursive Calculation: </strong>The algorithm defines a recursive function that calculates the edit distance between two substrings of the input strings. If the edit distance for a particular substring pair has already been calculated, the function returns the memoized result.</li><li><strong>Base Cases:</strong> The recursive function includes base cases to handle situations where one or both of the substrings are empty, returning the appropriate edit distance based on the lengths of the substrings.</li><li><strong>Filling the Memoization Table:</strong> The algorithm calls the recursive function with the full input strings, which recursively calculates and memoizes the edit distances for all subproblems.</li><li><strong>Backtracking: </strong>After the memoization table is filled, the algorithm can backtrack through the table to reconstruct the optimal sequence of operations that lead to the minimum edit distance. Backtracking through the table from the bottom-right corner to the top-left corner.</li></ul><blockquote>Pseudocode for minimum edit distance(top-down approach):</blockquote><pre>def edit_distance(i, j):<br>    if memo[i][j] != -1:<br>        return memo[i][j]<br>    if i == 0:<br>        memo[i][j] = j<br>    elif j == 0:<br>        memo[i][j] = i<br>    else:<br>        memo[i][j] = min(edit_distance(i - 1, j) + 1,        #Deletion<br>                         edit_distance(i, j - 1) + 1,        #Insertion<br>                         edit_distance(i - 1, j - 1) + <br>                           (0 if s1[i - 1] == s2[j - 1] else 1)) #Substitution<br>    return memo[i][j]</pre><h3>Bottom Up Approach(Tabulation)</h3><ul><li><strong>Initialization:</strong> Initialize a matrix to store edit distances, with the first row and column representing the initial state of the strings.</li></ul><blockquote>dp[i][0] = i // Initialize first column</blockquote><blockquote>dp[0][j] = j // Initialize first row</blockquote><ul><li><strong>Filling the Matrix:</strong> Iterate through the matrix of size (m+1) x (n+1) where m and n are the lengths of the two strings, calculating the minimum number of operations required to transform each substring into the other.</li><li><strong>Backtracking: </strong>Trace back through the matrix from the bottom right to the top left, to determine the specific operations that lead to the minimum edit distance.</li></ul><blockquote>Pseudocode for minimum edit distance(bottom-up approach):</blockquote><pre>def wagner_fischer(s1, s2):<br>    m = len(s1)<br>    n = len(s2)<br><br>    # Initialize a 2D array for dynamic programming<br>    dp = 2D array of size (m + 1) x (n + 1)<br><br>    #Base cases<br>    for i from 0 to m:<br>        dp[i][0] = i<br>    for j from 0 to n:<br>        dp[0][j] = j<br><br>    # Fill in the rest of the matrix<br>    for i from 1 to m:<br>        for j from 1 to n:<br>            if str1[i - 1] == str2[j - 1]:   <br># If characters at this position are the same, take the value from the diagonal<br>                dp[i][j] = dp[i - 1][j - 1]<br>            else:<br># when characters at the position are not same, perform operation accordingly<br>                dp[i][j] = 1 + min(dp[i - 1][j - 1],  # substitute<br>                                   dp[i - 1][j],      # remove<br>                                   dp[i][j - 1])      # insert<br><br>    return dp[m][n]</pre><p>For a more detailed explanation, checkout my YouTube video</p><p><strong>Example</strong></p><p>for example, Suppose we have two strings, “boats” and “float”, and we want to find the minimum number of operations (insertions, deletions, or substitutions) required to transform “boats” into “float”.</p><p><strong><em>initialisation(base case):</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q1blVeFdbTauxardoWSmGg.jpeg" /></figure><p><strong><em>filling up the matrix accordingly:</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IO8oHDEg_vYCv39pyx2l7Q.jpeg" /></figure><p><strong><em>backtracking:</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GdRk8Pxof9cci2nKbosGUA.jpeg" /></figure><p>The minimum edit distance for boats → float is 3.</p><h3>Complexity Analysis</h3><blockquote>Time Complexity → O(m*n)</blockquote><blockquote>Space Complexity → O(m*n)</blockquote><p>where m is the length of source string and n is the length of target string.</p><p>Both top-down and Bottom-up approach has same complexity.</p><p>The time complexity of the Wagner-Fischer algorithm is based on the size of the dynamic programming matrix used by the algorithm, which is of size (m+1) x (n+1), where m and n are the lengths of the input strings. Each cell in the matrix requires constant time to compute, leading to a total time complexity of O(m*n) for the algorithm.</p><h3>Bottom Up approach Vs Top Down approach</h3><p>The bottom-up dynamic programming approach, or the Wagner-Fisher Algorithm, is indeed more efficient than the top-down approach because it avoids the overhead of recursion and utilizes a tabulation technique to build the solution iteratively. By iteratively building the solution from smaller subproblems to larger ones, the bottom-up approach ensures that each subproblem is solved exactly once, eliminate redundancy by calculating and reusing values in a tabulated manner. Additionally, the tabulation technique used in the bottom-up approach lends itself well to parallelization, making it suitable for parallel computing environments where multiple computations can be performed simultaneously. Overall, the bottom-up approach is preferred for its efficiency, especially in scenarios where performance and scalability are critical.</p><p>For code examples and implementations, please refer to my GitHub repository:</p><p><a href="https://github.com/yasaswini2104/Wagner-Fischer-Algorithm">GitHub - yasaswini2104/Wagner-Fischer-Algorithm: Levenshtein distance between two strings</a></p><h3>Sample Test Case Executions</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*8cWoyj921exARLIWLM1gAA.png" /><figcaption>source string: intention; target string: execution</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*vjPBRtyGyKQZpDJkp4HP6g.png" /><figcaption>source string: hello, target string: hello</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*D0hrPhhJJiwcKoXhhVeZzg.png" /><figcaption>source string: hello, target string: world</figcaption></figure><h3>Applications Of Wagner Fischer Algorithm</h3><p>The Wagner-Fischer algorithm finds primary application in computational linguistics and bioinformatics, serving various purposes such as:</p><ol><li><strong>Spell Checking and Autocorrect</strong>: It’s used to suggest corrections for misspelled words by finding the shortest path (minimum edit distance) between the misspelled word and all possible correct words.</li><li><strong>Plagiarism Detection</strong>: It can be used to compare two texts and calculate the edit distance between them, helping to detect similarities and potential plagiarism.</li><li><strong>DNA Sequencing</strong>: In bioinformatics, the algorithm can be used to compare DNA sequences and determine their similarity, aiding in evolutionary studies and identifying genetic mutations.</li><li><strong>OCR (Optical Character Recognition): </strong>It helps to recognize and correct errors in scanned text by comparing it to a database of correct words or phrases.</li><li><strong>Data Cleaning and Similarity Analysis:</strong> It’s used in data processing to identify similar records or entities by calculating the edit distance between them.</li><li><strong>Speech Recognition:</strong> In speech-to-text systems, it can be used to correct errors by comparing the recognized text with the expected text.</li><li><strong>Machine Translation:</strong> It’s used to align words or phrases in different languages to improve translation quality.</li><li><strong>Computational Biology:</strong> It’s used in various bioinformatics tasks, such as comparing protein sequences and predicting RNA secondary structures, alignment of DNA sequences.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e61bba9b656" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>