<?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 Adrian Chan on Medium]]></title>
        <description><![CDATA[Stories by Adrian Chan on Medium]]></description>
        <link>https://medium.com/@pigm1844ac?source=rss-30056b671001------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*x4-fssYnJPPwjq1n</url>
            <title>Stories by Adrian Chan on Medium</title>
            <link>https://medium.com/@pigm1844ac?source=rss-30056b671001------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 21:54:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pigm1844ac/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[How Shor’s Algorithm Threatens Modern Cryptography and How Post-Quantum Cryptography Is Preparing…]]></title>
            <link>https://medium.com/@pigm1844ac/how-shors-algorithm-threatens-modern-cryptography-and-how-post-quantum-cryptography-is-preparing-ece7ebe58a36?source=rss-30056b671001------2</link>
            <guid isPermaLink="false">https://medium.com/p/ece7ebe58a36</guid>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[post-quantum-cryptography]]></category>
            <category><![CDATA[quantum-computing]]></category>
            <dc:creator><![CDATA[Adrian Chan]]></dc:creator>
            <pubDate>Sat, 03 Oct 2026 00:55:00 GMT</pubDate>
            <atom:updated>2026-10-25T18:54:42.952Z</atom:updated>
            <content:encoded><![CDATA[<h3>How Shor’s Algorithm Threatens Modern Cryptography and How Post-Quantum Cryptography Is Preparing for It</h3><p><strong>Introduction</strong></p><p>Before Shor’s algorithm and quantum computing, I was interested in Artificial Intelligence. I wanted to do my Learn Article around it, and I was going to until I attended Azar’s group coaching. He proposed the idea of researching Quantum Computing instead of Artificial Intelligence. Before my research, I already knew a little about Quantum Computing and how it was a computer where the bits are in a state of superposition and blah blah blah. I thought it was boring because it seemed so unreal, and I assumed that quantum computers wouldn’t pose a serious threat for at least another decade. However, the more I researched, the more I realized that the question isn’t just when powerful quantum computers will arrive, but whether we will be prepared when they do. Luckily, this isn’t an entirely depressing future. Researchers are already developing post-quantum methods, such as lattice-based cryptography, designed to withstand attacks from both classical and quantum computers. This eventually led to my question: “How is Shor’s algorithm threatening current and future cryptography, and how can lattice-based cryptography be used to address it?”</p><p><strong>Modern Cryptography and How Shor’s Algorithm is a Threat:</strong></p><p>Let’s start off with the basics. Modern cryptography relies on systems such as the Rivest–Shamir–Adleman (RSA) cryptosystem, Elliptic Curve Cryptography (ECC), and Diffie–Hellman.</p><p>RSA is a public-key cryptosystem whose security relies on the difficulty of integer factorization. The basic idea is that multiplying two enormous prime numbers together is relatively easy, but recovering those original primes from their product is extremely difficult for classical computers. RSA takes advantage of this difficulty to protect information.</p><p>Elliptic Curve Cryptography (ECC) is a family of cryptographic techniques based on the mathematics of elliptic curves, which can be represented by equations such as (y²=x³+ax+b). ECC itself is not one specific encryption algorithm. Instead, it provides the mathematical foundation for systems such as the Elliptic Curve Digital Signature Algorithm (ECDSA) and Elliptic Curve Diffie–Hellman (ECDH). Their security relies on the difficulty of problems involving elliptic-curve discrete logarithms.</p><p>Finally, Diffie–Hellman is a key-exchange method that allows two parties to establish a shared secret over a public channel. Its security relies on the difficulty of the discrete logarithm problem. ECDH is an elliptic-curve version of this idea.</p><p>These systems rely on mathematical problems that are difficult for classical computers to solve at sufficiently large sizes. But this is where quantum computing becomes a problem. If sufficiently powerful, fault-tolerant quantum computers become possible, Shor’s algorithm could efficiently solve the mathematical problems behind RSA, Diffie–Hellman, and ECC.</p><p>As of right now, I have said the words “Shor’s algorithm” four times (not including this one) without actually explaining what it is. So, you may be wondering: what is Shor’s algorithm? Shor’s algorithm is a quantum algorithm used to find certain mathematical patterns and use them to factor large numbers or solve discrete logarithms much faster than known classical algorithms.</p><p>Suppose you had a number (N), and you needed to find its prime factors. If (N) were a small number, this would be relatively easy because we could simply test possible factors. But what if (N) were extremely large? Trying to find its factors directly would become incredibly difficult for a classical computer. Shor’s algorithm will help us find the two primes by solving for the period.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/669/1*UrJ62vwGROBvsWJqnZvygA.png" /><figcaption><strong><em>Figure 1.</em></strong><em> Flowchart showing an implementation of Shor’s algorithm, from the initial classical setup to quantum superposition, modular exponentiation, and measurement. It demonstrates that Shor’s algorithm combines classical computation with a quantum procedure rather than performing the entire factorization on a quantum computer.</em></figcaption></figure><p>The basic idea is to choose a number (a) that is relatively prime to (N) and create a function as shown in the picture above. Instead of trying to find the factors directly, Shor’s algorithm looks for a repeating pattern in the values of this function. The number of steps before the pattern repeats is called the period, represented by (r). The values eventually repeat after a certain number of steps, revealing the period. Once the period is found, finding non-trivial factors becomes much easier.</p><p>The key advantage that makes Shor’s a quantum algorithm is how a quantum computer can utilize superposition to put many possible (x) values into a quantum state and then evaluate the function across that superposition. The quantum computer first creates a superposition of many possible values of (x), allowing the function (f(x)=a^x \bmod N) to be evaluated across many values within the quantum state. Because the function is periodic, the same outputs appear at regular intervals. The goal is to extract this repeating structure without having to calculate every value one at a time like a classical computer would.</p><p>This is where the Quantum Fourier Transform (QFT) comes in. The QFT transforms the amplitudes of the quantum state into a frequency-based representation. Because the function contains a repeating pattern, the QFT causes quantum amplitudes corresponding to certain frequencies to reinforce each other through constructive interference while others cancel through destructive interference. This creates probability peaks around values that contain information about the hidden period.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*YSFccqpcGVq6NibwSIbMSw.png" /><figcaption><strong><em>Figure 2.</em></strong><em> An implementation of Shor’s algorithm showing the quantum computation, measurement, classical extraction of the period (r), and the final calculation of the factors of (N). The quantum computation does not directly output the factors; it produces information that allows the period to be recovered through classical post-processing.</em></figcaption></figure><p>However, there is a massive difference between factoring small numbers and breaking real RSA keys. Modern quantum computers have not yet reached the scale and reliability needed to use Shor’s algorithm against the cryptographic systems we use today. So, you may be wondering: if our data is still safe from Shor’s algorithm, why are we so worried about it now?</p><p><strong>Why Does This Matter?</strong></p><p>In the last section, I gave a brief summary of several modern cryptographic systems, but I also underplayed how important they actually are. RSA, ECC, and Diffie–Hellman have played major roles in modern cryptography because the mathematical problems behind them remain extremely difficult for classical computers to solve at appropriate key sizes. Current quantum computers have also not reached the scale and reliability required to use Shor’s algorithm to attack real-world cryptographic keys.</p><p>Let’s start by looking more closely at how RSA, ECC, and Diffie–Hellman are actually used. RSA is a public-key cryptosystem that can be used for purposes such as digital signatures and, historically, transporting or encrypting secret key material. Diffie–Hellman is mainly used to establish shared secret key material between devices communicating over an insecure network, with modern variants such as ECDHE commonly used in protocols like TLS.</p><p>Lastly, there is ECC. Unlike the others, ECC is not one specific algorithm, but a mathematical framework used to construct different cryptographic systems. One major advantage of elliptic-curve cryptography is that it can provide strong security with much smaller keys than RSA at comparable classical security levels. For example, ECDH can be used for key agreement, while ECDSA can be used for digital signatures.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/315/1*Ipjiixql7rEOEHrHicYBSw.png" /><figcaption><em>Figure 3: An example of an elliptic curve described by an equation of the form (y²=x³+ax+b).to construct systems such as ECDH and ECDSA.</em></figcaption></figure><p>Knowing how heavily we rely on these cryptographic systems made Shor’s algorithm seem even more concerning. However, there is still one major obstacle: the quantum computer itself. Although quantum computers already exist, running Shor’s algorithm against something like RSA-2048 requires a completely different level of scale and reliability.</p><p>Even though Shor’s algorithm threatens these cryptographic systems, there is still one setback: the hardware needed to run it. Quantum computers already exist, but current machines are not large or reliable enough to run Shor’s algorithm effectively. One of the biggest reasons for this is that qubits are extremely sensitive to error.</p><p><strong>Technical Difficulties and Why Shor’s Algorithm is Not Currently a Threat:</strong></p><p>Let’s start off by explaining a qubit. Unlike a classical bit, which can only have a value of 0 or 1, a qubit can exist in a superposition of both states. Qubits can also be described as physical or logical qubits. A physical qubit is an actual qubit implemented in hardware, but physical qubits are extremely sensitive to noise and prone to errors during calculations. This becomes especially problematic for Shor’s algorithm because factoring something as large as an RSA-2048 integer would require a long and complex quantum computation. To deal with these errors, quantum error correction can encode quantum information across multiple physical qubits to create more reliable, logical<strong> </strong>qubits. However, this requires a massive amount of additional hardware. In a 2021 paper, researchers Craig Gidney and Martin Ekerå estimated that, under specific assumptions about future quantum hardware, factoring an RSA-2048 integer could take around 20 million noisy physical qubits and approximately eight hours. Much of these resources would be needed to keep the quantum computation reliable enough to successfully complete the calculation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*qqjEmgEkduMn8rBo_D0V8A.png" /><figcaption><em>Figure 4: Comparison between a classical bit, which is either 0 or 1, and a qubit, which can exist in a superposition of quantum states.</em></figcaption></figure><p>We have established the oncoming threat, but you may be wondering: why fear it now? Enter Harvest Now, Decrypt Later (HNDL). This type of cyberattack is exactly what it sounds like: an attacker collects and stores encrypted data today, with the intention of decrypting it in the future when more powerful technology becomes available.</p><p><strong>Post-quantum Computing and Lattice-Based Cryptography:</strong></p><p>However, this does not mean that all encrypted data being collected today is guaranteed to become readable in the future. Organizations are already beginning to transition towards post-quantum cryptography<strong> </strong>which is designed to resist attacks from both classical and quantum computers.</p><p>For some reason, us humans love to apply the most stupid methods to solve a problem, and it somehow works 90% of the time. Lattice-based cryptography or in other words, dots on a grid. A lattice an arrangement of points created from combinations of mathematical vectors. In two dimensions it is very simple but the trick here is how it gets much more complicated the more dimensions are introduced. Lattice-based cryptography is not directly utilized but is used for learning with error algorithms (LWE). These algorithms introduce error to the code making it much harder to decrypt due to the error being unpredictable. In this simplified example (y = ax + e), (a) is public, (x) is the secret, and (e) is a small randomly generated error. Without the error, solving backwards for (x) would be straightforward. However, LWE uses many equations containing small errors, making recovering the secret computationally difficult. Real LWE and Module-LWE are significantly more complicated than this example, but the basic idea of intentionally introducing error remains.</p><p>Although lattice-based cryptography is designed to resist known classical and quantum attacks, this does not mean it is guaranteed to remain secure forever. Its security relies on mathematical assumptions about the difficulty of certain lattice problems. Researchers continue to study these problems and test proposed algorithms for weaknesses.</p><p>LWE and Module-LWE work by intentionally introducing small, random errors into mathematical equations. In the simplified equation (y=ax+e), (a) is public, (x) represents the secret, and (e) is a small randomly generated error. Without the error, solving backwards for (x) would be relatively straightforward. However, LWE uses many equations containing these small errors, making it computationally difficult to recover the secret. Module-LWE expands this idea using more complex mathematical structures involving vectors and polynomials, which allows it to be used in post-quantum systems such as ML-KEM and ML-DSA.</p><p>Modular-Lattice-Based Key-Encapsulation Mechanism (ML-KEM) is a post-quantum method for establishing shared secret key material between two parties. It serves a similar purpose to systems such as Diffie–Hellman or ECDH, but instead of relying on the discrete logarithm problem, ML-KEM uses lattice-based mathematics related to Module Learning With Errors (Module-LWE). One person generates a public and private key and shares the public key. The other person uses that public key to encapsulate a shared secret, producing a ciphertext that is sent back. The private-key holder then decapsulates the ciphertext to obtain the same shared secret. Both parties can then use that secret with symmetric encryption, such as AES, to securely communicate. Unlike RSA, DH, and ECC, there is currently no known efficient quantum algorithm like Shor’s algorithm that breaks the mathematical problems ML-KEM relies on.</p><p>Modular-Lattice-Based Digital Signature Algorithm (ML-DSA) is a post-quantum digital signature algorithm that performs a similar role to ECDSA. It allows someone to use their private key to create a digital signature, while others can use the corresponding public key to verify that signature. This helps prove that the information came from the expected sender and was not modified. However, unlike ECDSA, which relies on elliptic-curve mathematics and the difficulty of the elliptic-curve discrete logarithm problem, ML-DSA relies on lattice-based mathematical problems.</p><p><strong>Companies Which Are Implementing PQC:</strong></p><p>Earlier, I mentioned how attackers are starting to harvest user data to decrypt later which is leading to more companies acting. The main companies include Apple, Cloudflare, Google and Microsoft.</p><p>Apple has recently started implementing PQ3 into iMessages in 2025. PQ3 uses a hybrid approach that combines traditional elliptic-curve cryptography with the standardized algorithm which uses ML-KEM called Kyber. The post-quantum cryptography is used when establishing keys for when a conversation begins and refreshing the keys. Apple is currently rolling out PQ3 on iMessages with iOS 17.4 and later operating systems. As of 2026, Apple published formally verified implementations of ML-KEM and ML-DSA in its core cryptographic library. The bigger direction for Apple is making PQC reliable enough to deploy broadly across Apple platforms without introducing bugs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*YOX0w2IOYTgMgddMeUL0iQ.png" /><figcaption><em>Figure 5: Apple’s comparison of classical and post-quantum messaging security. PQ3 introduces post-quantum key establishment and ongoing post-quantum rekeying to iMessage to provide protection against threats such as Harvest Now, Decrypt Later.</em></figcaption></figure><p>Cloudflare has been deploying post-quantum hybrid key agreements across its infrastructure including systems combining <strong>X25519 algorithm</strong> with Kyber (the basis of ML-KEM). Cloudflare is also working on post-quantum authentication, digital signatures and certificates including technologies based on ML-DSA. Its broader goal is to make its entire product suite post-quantum secure by 2029.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*hCE3Wyl3stvyPZh6ltIxKw.png" /><figcaption><em>Figure 6: A hybrid TLS 1.3 key exchange combining classical X25519 with the post-quantum Kyber768 KEM. The two methods contribute to the shared secret, demonstrating how classical and post-quantum cryptography can be combined during the transition to PQC.</em></figcaption></figure><p>Microsoft is also undergoing a large-scale transition toward post-quantum cryptography and has introduced support for algorithms such as ML-KEM and ML-DSA across major platforms. Microsoft is working toward transitioning its products and services to post-quantum cryptography by 2029. One of its biggest challenges is identifying and replacing vulnerable cryptography hidden throughout applications, networks, certificates, authentication systems, hardware, and legacy infrastructure. Microsoft is also focusing on crypto-agility, so cryptographic algorithms can be replaced more easily if new threats appear in the future.</p><p><strong>Final Thoughts and Conclusion:</strong></p><p>Overall, I believe that Shor’s algorithm may not become as severe a threat as I initially thought. As quantum computers continue to evolve, cryptography will also evolve alongside them, and the transition to post-quantum cryptography has already begun. However, older data that was encrypted using quantum-vulnerable cryptography could still be at risk, especially if it was collected through Harvest Now, Decrypt Later attacks and remains valuable in the future.</p><p>To answer my original question, modern cryptographic systems such as RSA, Diffie–Hellman, and ECC are threatened by Shor’s algorithm. However, lattice-based cryptography and other forms of PQC are also rapidly developing, with algorithms such as ML-KEM and ML-DSA already designed to resist both classical and known quantum attacks. While no cryptographic algorithm can be guaranteed to remain secure forever, there is currently no known efficient quantum algorithm that breaks the mathematical problems these systems rely on.</p><p>In conclusion, I learned that quantum computing is much more realistic than I originally believed, and it could eventually create serious threats to the cryptography protecting our data. However, it is not currently capable of breaking the cryptographic systems we use at scale, and researchers and companies are already preparing for that possibility. I started this article thinking quantum computing was too unrealistic to matter yet, but I ended it realizing that the entire point of post-quantum cryptography is to prepare before the threat becomes a reality.</p><p><strong>Citations</strong></p><p>Dixit, V., &amp; Jian, S. (2022). Quantum Fourier transform to estimate drive cycles. <em>Scientific Reports, 12</em>, Article 654. <a href="https://doi.org/10.1038/s41598-021-04639-0">https://doi.org/10.1038/s41598-021-04639-0</a> <a href="https://pmc.ncbi.nlm.nih.gov/articles/PMC8758683/?utm_source=chatgpt.com">PubMed Central (PMC)</a></p><p>Gidney, C. (2025). <em>How to factor 2048 bit RSA integers with less than a million noisy qubits</em> [Preprint]. arXiv. <a href="https://doi.org/10.48550/arXiv.2505.15917">https://doi.org/10.48550/arXiv.2505.15917</a> <a href="https://arxiv.org/abs/2505.15917">arXiv</a></p><p>Gidney, C., &amp; Ekerå, M. (2021). How to factor 2048 bit RSA integers in 8 hours using 20 million noisy qubits. <em>Quantum, 5</em>, 433. <a href="https://doi.org/10.22331/q-2021-04-15-433">https://doi.org/10.22331/q-2021-04-15-433</a> <a href="https://quantum-journal.org/papers/q-2021-04-15-433/pdf">Quantum</a></p><p>Willsch, D., Willsch, M., Jin, F., De Raedt, H., &amp; Michielsen, K. (2023). Large-scale simulation of Shor’s quantum factoring algorithm. <em>Mathematics, 11</em>(19), 4222. <a href="https://doi.org/10.3390/math11194222">https://doi.org/10.3390/math11194222</a> <a href="https://ideas.repec.org/a/gam/jmathe/v11y2023i19p4222-d1256358.html?utm_source=chatgpt.com">IDEAS/RePEc</a></p><p>Cloudflare. (2013, October 24). <em>A (relatively easy to understand) primer on elliptic curve cryptography</em>. Cloudflare Blog. <a href="https://blog.cloudflare.com/a-relatively-easy-to-understand-primer-on-elliptic-curve-cryptography?utm_source=chatgpt.com">Cloudflare ECC primer</a></p><p><em>Let’s derive the quantum Fourier transform!</em> (n.d.). Essentials of Quantum. <a href="https://essentials-of-quantum.com/blog/lets-derive-the-circuit-of-the-quantum-fourier-transform?utm_source=chatgpt.com">Essentials of Quantum QFT article</a></p><p>Poetry in Physics. (2017, March 8). <em>What is a qubit?</em> <a href="https://poetryinphysics.wordpress.com/2017/03/08/what-is-a-qubit?utm_source=chatgpt.com">Poetry in Physics qubit article</a></p><p>ALLPCB. (n.d.). <em>Fourier transform fundamentals and machine learning uses</em>. <a href="https://www.allpcb.com/allelectrohub/fourier-transform-fundamentals-and-machine-learning-uses?utm_source=chatgpt.com">ALLPCB Fourier transform article</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ece7ebe58a36" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>