<?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" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ TLS - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ TLS - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Tue, 23 Jun 2026 22:45:27 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/tls/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ Common Attacks on SSL/TLS – and How to Protect Your System ]]>
                </title>
                <description>
                    <![CDATA[ By Megan Kaczanowski The SSL and TLS protocols are frequently attacked. And understanding past attacks can inform your knowledge as a defender and help you secure current systems. It can also help you predict the direction of future attacks. So here'... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/attacks-on-ssl-tls-and-how-to-protect-your-system/</link>
                <guid isPermaLink="false">66d46043a326133d12440a3d</guid>
                
                    <category>
                        <![CDATA[ cybersecurity ]]>
                    </category>
                
                    <category>
                        <![CDATA[ information security ]]>
                    </category>
                
                    <category>
                        <![CDATA[ #infosec ]]>
                    </category>
                
                    <category>
                        <![CDATA[ SSL ]]>
                    </category>
                
                    <category>
                        <![CDATA[ TLS ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Mon, 29 Aug 2022 21:17:07 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/08/cybersecurity-by-Christiaan-Colen-creative-commons-free-to-use.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Megan Kaczanowski</p>
<p>The SSL and TLS protocols are frequently attacked. And understanding past attacks can inform your knowledge as a defender and help you secure current systems. It can also help you predict the direction of future attacks.</p>
<p>So here's a summary of some of the most famous attacks targeting these protocols:</p>
<h2 id="heading-browser-exploit-against-ssltls-beast">Browser Exploit Against SSL/TLS (BEAST):</h2>
<p>BEAST (disclosed in 2011) allowed a man-in-the-middle attacker to discover encrypted information from an SSL/TLS session. It impacted SSL 3.0 and TLS 1.0.</p>
<p>This attack depended on the implementation of the block cipher used by TLS. The implementation used CBC, Cipher Block Chaining mode. This involves XORing each block of plaintext (except the first) with the previous block of ciphertext, then using the encryption algorithm on the block.</p>
<p>The first block is XORed with an IV (initialization vector). Much of the mode's security depends on the IV being truly random. But TLS 1.0 didn't randomly generate IVs – it just used the last block of ciphertext from the previous message. That meant that anyone able to snoop on the encrypted traffic had a copy of the IV.</p>
<p>An attacker who could snoop on the encrypted traffic could launch a chosen plaintext attack by guessing a block of data, XORing it with the (known) IV and the previous block of ciphertext, and injecting the created block into the session. This allowed the attacker to check if the entire block was correct.</p>
<p>Given this, the flaw was seen as largely theoretical until BEAST was released. BEAST found a way to shift the cipher block boundaries to isolate one byte of a message at a time until it had been guessed.</p>
<p>That, and the fact that HTTP messages are typically standardized so that an attacker would know where in the message sensitive information (like the session cookie) was transmitted, allowed an attacker to brute force compromise a session cookie.</p>
<p>While the attack was theoretically extremely interesting, and generated a lot of interest, it only works if the attacker can insert malicious code into a page and violate the same-origin policy. If the attacker had this much access to your system, they would also have a number of attacks they could attempt, many of which are far less complicated to execute.</p>
<h3 id="heading-mitigation-measures-for-ssltls-attacks">Mitigation Measures for SSL/TLS Attacks:</h3>
<ol>
<li><p>(Safest) Only allow TLS 1.1 or 1.2 since they addressed the vulnerability. However, at the time, most websites and browsers didn't support TLS 1.1. or 1.2.</p>
</li>
<li><p>As TLS supported both a block cipher and a stream cipher, switch to the stream cipher (RC4). However, in 2013 it was demonstrated that RC4 was insecure, and in 2015 it was officially banned (by the Internet Engineering Task Force, or IETF).</p>
</li>
<li><p>Use a different block cipher mode. Unfortunately, TLS 1.0 didn't support any other modes.</p>
</li>
<li><p>Insert packets of length 0. Essentially, as a packet of length 0 would be padded to the block size, it becomes a packet of just padding for the sender, but is immediately discarded by the recipient. These blocks would be used as IVs for the next message, solving the problem of insecure IVs. This option was largely unused as it caused interoperability issues with some SSL stacks, notably including Internet Explorer 6.0. OpenSSL implemented this, but disabled it by default.</p>
</li>
<li><p>Practice defense in depth to prevent attackers from getting man-in-the-middle access to a victim network.</p>
</li>
</ol>
<h3 id="heading-sourcesfurther-information">Sources/Further Information:</h3>
<ul>
<li><p><a target="_blank" href="https://www.netsparker.com/blog/web-security/how-the-beast-attack-works/">How the BEAST Attack Works</a></p>
</li>
<li><p><a target="_blank" href="https://commandlinefanatic.com/cgi-bin/showarticle.cgi?article=art027">An Illustrated Guide to the BEAST Attack</a></p>
</li>
<li><p><a target="_blank" href="https://vnhacker.blogspot.com/2011/09/beast.html">Original Write Up of BEAST</a></p>
</li>
<li><p><a target="_blank" href="https://www.nccgroup.com/us/our-research/attacks-on-ssl/">A Comprehensive Study of BEAST, CRIME, TIME, BREACH, LUCKY 13 &amp; RC4 Biases</a></p>
</li>
</ul>
<h2 id="heading-heartbleed-vulnerability">Heartbleed Vulnerability:</h2>
<p>Heartbleed (introduced in 2012/disclosed in April 2014) was a vulnerability in the heartbeat extension of the OpenSSL library (this is used to keep a connection opened).</p>
<p>This library is used largely for servers running Apache and NGINX (at the time of disclosure, roughly 17% of the internet's 'secure' (using SSL/TLS) websites were vulnerable), but impacted any server which depended on the vulnerable version of OpenSSL.</p>
<p>Essentially, the client sends a message to the server which contains the response it requests and the size of the response. The server would respond with the requested data in the size it was requested (see below for an explanation from xkcd).</p>
<p><img src="https://megankaczanowski.com/content/images/2020/12/Screen-Shot-2020-12-29-at-4.16.21-PM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>The vulnerability was that the server would not check that the request was actually the same size as its stated size. If the user sent a requested response (for example 'bird') which was shorter than the requested length (500 letters), the server would 'pad' the response with data from its memory to meet the length requirement, potentially leaking sensitive memory information.</p>
<p><img src="https://megankaczanowski.com/content/images/2020/12/Screen-Shot-2020-12-29-at-4.16.31-PM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p><img src="https://megankaczanowski.com/content/images/2020/12/Screen-Shot-2020-12-29-at-4.16.38-PM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p><em>https://xkcd.com/1354/</em></p>
<p>This leaked data would be unencrypted and could contain anything – sensitive credentials, documents, and so on.</p>
<p>But in order to successfully exploit this bug, several things needed to happen: the site had to have implemented SSL, it needed to be running a vulnerable version of OpenSSL (the vulnerable versions were between 1.0.1 and 1.0.1f), the attacker needed to have had access to the environment between finding out the bug exists and it being patched, and there needed to have been something useful in memory at the time the attacker carried out the attack. This is relatively more difficult, though far from impossible.</p>
<p>Unfortunately, since the exploitation doesn't leave any abnormal traces in logs, it's hard to know if or how often this bug was actually exploited.</p>
<p>Also, this doesn't account for the danger of an attacker having previous pcaps of traffic and pulling the site's private key in an attack. This means they could have decrypted large amounts of sensitive data, causing a serious breach.</p>
<p>If intelligence agencies were able to pull off this type of attack, it's likely it would never be publicly released.</p>
<h3 id="heading-mitigation-measures-for-heartbleed">Mitigation Measures for Heartbleed:</h3>
<ul>
<li>Upgrade OpenSSL to the latest version, patching the vulnerability (the vulnerable versions were between 1.0.1 and 1.0.1f).</li>
</ul>
<h3 id="heading-sourcesfurther-reading">Sources/Further Reading:</h3>
<ul>
<li><p><a target="_blank" href="https://blog.malwarebytes.com/exploits-and-vulnerabilities/2019/09/everything-you-need-to-know-about-the-heartbleed-vulnerability/">5 Years Later, Heartbleed Vulnerability Still Unpatched</a></p>
</li>
<li><p><a target="_blank" href="https://xkcd.com/1354/">XKCD Heartbleed</a></p>
</li>
<li><p><a target="_blank" href="https://www.troyhunt.com/everything-you-need-to-know-about3/">Everything you need to know about the Heartbleed Bug</a></p>
</li>
</ul>
<h2 id="heading-padding-oracle-on-downgraded-legacy-encryption-poodle">Padding Oracle On Downgraded Legacy Encryption (POODLE):</h2>
<p>POODLE (disclosed in September 2014) took advantage of a flaw in SSL3.0. In order to support legacy systems, some systems continued to offer support for SSL 3.0, even though it had been replaced by newer versions.</p>
<p>For the attack to be successful, the attacker needed to be able to control parts of the client side of the SSL connection and needed to have visibility of the resulting ciphertext (the most common way to have this access is to act as a man-in-the-middle).</p>
<p>This attack, while powerful, does require a separate attack to gain this access.</p>
<p>During a typical handshake negotiation, the client and server will work together to find a protocol which works for both to communicate. They'll start with the highest protocol they both offer and work down (so the client may offer TLS 1.2, and the server may respond with TLS 1.1).</p>
<p>But if the connection fails (either due to an attacker or a network connection problem), the client server will downgrade to the lowest protocol they offer, likely SSL 3.0. This is a 'feature' offered so that servers and clients at different stages of advancement can communicate.</p>
<p>SSL3.0 uses either RC4 (stream cipher) or a block cipher in CBC mode for encryption. RC4 was well-known, even at the time, for having a number of flaws, including that if the same secret (like a cookie) was sent repeatedly, more and more information about it would leak.</p>
<p>CBC mode requires that the message length is a multiple of the block size or that padding is used to fulfill the length condition. This means that padding is frequently used, and in the SSL 3.0 implementation it isn't verified that it hasn't changed in transit.</p>
<p>Essentially, while the message is hashed before sending and at the receiving end, and the re-compiled hash is compared to ensure message integrity, the padding is not included.</p>
<p>The only specification for padding is that the last byte needs to be the padding length. Therefore, an attacker can replace the padding and it will still be accepted, as long as they get the last digit correct.</p>
<p>If an attacker knows the location of the data they're trying to decrypt (for example an HTTP session cookie, which is typically sent in the same part of the block each time and is therefore easy to locate), they can copy it over into the final block, replacing the padding.</p>
<p>Then, the receiver will XOR the padded block with the previous block's ciphertext (which the attacker can see) and will only accept the data if the last byte matches the padding's length.</p>
<p>Essentially this attack makes brute-forcing SSL feasible. Whereas it would be practically impossible to brute force SSL without any information, this attack allows for recovering each byte after a maximum of 256 attempts per byte. That means that, in a few minutes, an attacker could compromise a session cookie or other sensitive information.</p>
<h3 id="heading-mitigation-measures-for-poodle">Mitigation Measures for POODLE:</h3>
<ul>
<li><p>Disabling SSL 3.0 is the only complete mitigation of POODLE. However, some sites only supported SSL 3.0.</p>
</li>
<li><p>An alternative is to use the TLS_FALLBACK_SCV cipher suite. This suite allows a server to fall back to earlier protocols, but rather than dropping immediately to SSL 3.0, the client can specify a preference. One problem with this suite is that it wasn't broadly supported when it was introduced (limited to largely Google services). Additionally, if the only option the server supports is SSL 3.0, POODLE attacks are still possible. However, it means that an attacker can't force a downgrade on a connection with a server which supports alternative protocols.</p>
</li>
<li><p>Practice defense in depth to prevent attackers from getting man-in-the-middle access to a victim network. While the attack is dangerous, it requires man-in-the-middle access, making it much harder to exploit than the remotely exploitable Heartbleed.</p>
</li>
</ul>
<h3 id="heading-sourcesfurther-information-1">Sources/Further Information:</h3>
<ul>
<li><p><a target="_blank" href="https://www.troyhunt.com/everything-you-need-to-know-about/">Everything you need to know about the POODLE bug</a></p>
</li>
<li><p><a target="_blank" href="https://templatelab.com/ssl-poodle/">This POODLE Bites: Exploiting the SSL 3.0 Fallback</a></p>
</li>
<li><p><a target="_blank" href="https://www.acunetix.com/blog/web-security-zone/what-is-poodle-attack/">What is the POODLE Attack?</a></p>
</li>
<li><p><a target="_blank" href="https://us-cert.cisa.gov/ncas/alerts/TA14-290A">CISA SSL 3.0 Protocol Vulnerability</a></p>
</li>
</ul>
<h2 id="heading-wrapping-up">Wrapping Up</h2>
<p>Understanding past attacks on TLS and SSL can both inform your knowledge as a defender and help you secure your systems.</p>
<p>Often systems are out of date, or legacy applications may require use of outdated protocols. This means that even older attacks may be successful if defenses aren't applied appropriately.</p>
<p>In many cases, working in corporate security requires having enough information to make informed decisions and recommendations. If, for example, a legacy app requires using an outdated protocol, knowledge of attacks like POODLE and Heartbleed can help you make effective recommendations about how to secure that application, rather than making general recommendations like 'update to a newer protocol' (which might be impossible).</p>
<p>Typically, as a security analyst, you're trying to balance business needs with technical capabilities, and making recommendations based on the organization's risk level. That might mean saying that a legacy app shouldn't be run anymore, or it may mean making recommendations on how to secure the application as much as possible, given that it needs to use an insecure protocol.</p>
<p>Understanding past TLS/SSL attacks can also help you predict the direction of future attacks. Since Heartbleed and POODLE (in 2014), we've seen attacks like FREAK and Logjam in 2015 and Sweet32 in 2016. We'll likely continue to see additional attacks.</p>
<p>Understanding the fundamentals of how TLS and SSL work, and how they've been attacked in the past can help you predict or understand future attacks.</p>
<p>Cover photo: "cybersecurity" by Christian Colen</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ What is TLS? Transport Layer Security Encryption Explained in Plain English ]]>
                </title>
                <description>
                    <![CDATA[ If you want to have a confidential conversation with someone you know, you might meet up in person and find a private place to talk.  But if you want to send data confidentially over the Internet, you might have a few more considerations to cover. TL... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/what-is-tls-transport-layer-security-encryption-explained-in-plain-english/</link>
                <guid isPermaLink="false">66bd8f99c1ca1df1936e29e9</guid>
                
                    <category>
                        <![CDATA[ cybersecurity ]]>
                    </category>
                
                    <category>
                        <![CDATA[ information security ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Security ]]>
                    </category>
                
                    <category>
                        <![CDATA[ TLS ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Victoria Drake ]]>
                </dc:creator>
                <pubDate>Tue, 08 Sep 2020 16:39:48 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2020/09/13466286-1BED-4E1F-A3BE-92A971BBF635.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>If you want to have a confidential conversation with someone you know, you might meet up in person and find a private place to talk. </p>
<p>But if you want to send data confidentially over the Internet, you might have a few more considerations to cover.</p>
<p>TLS, or Transport Layer Security, refers to a protocol. "Protocol" is a word that means, "the way we've agreed to do things around here," more or less. </p>
<p>The "transport layer" part of TLS simply refers to host-to-host communication, such as how a client and a server interact, in the <a target="_blank" href="https://en.wikipedia.org/wiki/Internet_protocol_suite">Internet protocol suite model</a>.</p>
<p>The TLS protocol attempts to solve these fundamental problems:</p>
<ul>
<li>How do I know you are who you say you are?</li>
<li>How do I know this message from you hasn't been tampered with?</li>
<li>How can we communicate securely?</li>
</ul>
<p>Here's how TLS works, explained in plain English. As with many successful interactions, it begins with a handshake.</p>
<h2 id="heading-getting-to-know-you">Getting to know you</h2>
<p>The basic process of a <a target="_blank" href="https://en.wikipedia.org/wiki/Transport_Layer_Security#TLS_handshake">TLS handshake</a> involves a client, such as your web browser, and a server, such as one hosting a website, establishing some ground rules for communication. </p>
<p>It begins with the client saying hello. Literally. It's called a <em>ClientHello</em> message.</p>
<p>The <em>ClientHello</em> message tells the server which TLS protocol version and <em>cipher suites</em> it supports. </p>
<p>While "cipher suite" sounds like a fancy hotel upgrade, it just refers to a set of algorithms that can be used to secure communications. </p>
<p>The server, in a similarly named <em>ServerHello</em> message, chooses the protocol version and cipher suite to use from the choices offered. Other data may also be sent, for example, a <em>session ID</em>, if the server supports resuming a previous handshake.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/09/hello-hello.png" alt="Image" width="600" height="400" loading="lazy">
<em>Cartoon of a browser window and server saying hello, by author.</em></p>
<p>Depending on the cipher suite chosen, the client and server exchange further information in order to establish a shared secret. </p>
<p>Often, this process moves the exchange from <a target="_blank" href="https://en.wikipedia.org/wiki/Public-key_cryptography">asymmetric cryptography</a> to <a target="_blank" href="https://en.wikipedia.org/wiki/Symmetric-key_algorithm">symmetric cryptography</a> with varying levels of complexity. Let's explore these concepts at a general level and see why they matter to TLS.</p>
<h2 id="heading-asymmetric-beginnings">Asymmetric beginnings</h2>
<p>This is asymmetry:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/09/image.jpeg" alt="Image" width="600" height="400" loading="lazy">
<em>Small egg, big egg.</em></p>
<p>Asymmetric cryptography is one method by which you can perform <em>authentication</em>. When you authenticate yourself, you answer the fundamental question, "How do I know you are who you say you are?"</p>
<p>In an asymmetric cryptographic system, you use a pair of keys in order to achieve authentication. These keys are asymmetric. One key is your public key, which, as you would guess, is public. The other is your private key, which – well, you know.</p>
<p>Typically, during the TLS handshake, the server will provide its public key via its digital certificate, sometimes still called its <em>SSL certificate</em>, though TLS replaces the deprecated Secure Sockets Layer (SSL) protocol. </p>
<p>Digital certificates are provided and verified by trusted third parties known as <a target="_blank" href="https://en.wikipedia.org/wiki/Certificate_authority">Certificate Authorities (CA)</a>, which are a whole other article in themselves.</p>
<p>While anyone may encrypt a message using your public key, only your private key can then decrypt that message. </p>
<p>The security of asymmetric cryptography relies only on your private key staying private, hence the asymmetry. </p>
<p>It's also asymmetric in the sense that it's a one-way trip. Alice can send messages encrypted with your public key to you, but neither of your keys will help you send an encrypted message to Alice.</p>
<h2 id="heading-symmetric-secrets">Symmetric secrets</h2>
<p>Asymmetric cryptography also requires more computational resources than symmetric cryptography. </p>
<p>Thus when a TLS handshake begins with an asymmetric exchange, the client and server will use this initial communication to establish a shared secret, sometimes called a <em>session key</em>. This key is symmetric, meaning that both parties use the same shared secret and must maintain that secrecy for the encryption to be secure.</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/09/image-11.png" alt="Image" width="600" height="400" loading="lazy">
<em>Wise person say: share your public key, but keep your shared keys private.</em></p>
<p>By using the initial asymmetric communication to establish a session key, the client and server can rely on the session key being known only to them. For the rest of the session, they'll both use this same shared key to encrypt and decrypt messages, which speeds up communication.</p>
<h2 id="heading-secure-sessions">Secure sessions</h2>
<p>A TLS handshake may use asymmetric cryptography or other cipher suites to establish the shared session key. Once the session key is established, the handshaking portion is complete and the session begins.</p>
<p>The <em>session</em> is the duration of encrypted communication between the client and server. During this time, messages are encrypted and decrypted using the session key that only the client and server have. This ensures that communication is secure.</p>
<p>The integrity of exchanged information is maintained by using a checksum. Messages exchanged using session keys have a <a target="_blank" href="https://en.wikipedia.org/wiki/Message_authentication_code">message authentication code (MAC)</a> attached. This is not the same thing as your device's <a target="_blank" href="https://en.wikipedia.org/wiki/MAC_address">MAC address</a>. The MAC is generated and verified using the session key. </p>
<p>Because of this, either party can detect if a message has been changed before being received. This solves the fundamental question, "How do I know this message from you hasn't been tampered with?"</p>
<p>Sessions can end deliberately, due to network disconnection, or from the client staying idle for too long. Once a session ends, it must be re-established via a new handshake or through previously established secrets called <em>session IDs</em> that allow resuming a session.</p>
<h2 id="heading-tls-and-you">TLS and you</h2>
<p>Let's recap:</p>
<ul>
<li>TLS is a cryptographic protocol for providing secure communication.</li>
<li>The process of creating a secure connection begins with a handshake.</li>
<li>The handshake establishes a shared session key that is then used to secure messages and provide message integrity.</li>
<li>Sessions are temporary, and once ended, must be re-established or resumed.</li>
</ul>
<p>This is just a surface-level skim of the very complex cryptographic systems that help to keep your communications secure. For more depth on the topic, I recommend exploring cipher suites and the various <a target="_blank" href="https://en.wikipedia.org/wiki/Cipher_suite#Supported_algorithms">supported algorithms</a>.</p>
<p>The TLS protocol serves a very important purpose in your everyday life. It helps to secure your emails to family, your online banking activities, and the connection by which you're reading this article. </p>
<p>The <a target="_blank" href="https://en.wikipedia.org/wiki/HTTPS">HTTPS communication protocol</a> is encrypted using TLS. Every time you see that little lock icon in your URL bar, you're experiencing firsthand all the concepts you've just read about in this article. </p>
<p>So now you know the answer to the last question: "How can we communicate securely?"</p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
