How Quantum Computers Could Quickly Break Encription 🌱

Primer on Encryption with Prime Numbers

The way things are encrypted today is to use public and private keys. A public key is created by generating two massive prime numbers, and each public key is unique. The private key is just one of those prime numbers. How they are used:

  1. Say Jason wants to send an encrypted message to Jessica.
  2. Jason fetches Jessica’s public key and inputs it into a cryptographic hash function along with his message.
  3. Jason sends the message to Jessica, who can only read it if she inputs her private key into the decryption algorithm. Encryption only requires public key, whereas decryption requires a private key.

So if someone wanted to read the message, they would need to compute Jessica’s private key A by factoring the public key N. Let’s try to hack open this message.

Decrypting the Message

To create Jessica’s public key, say she multiple two prime numbers A and B together to get N, where A is her private key. So, we are given N, but we need A. Let’s try the following strategy to get A.

  1. Guess a random positive integer g
  2. We want to find a positive, even prime number p such that: gpmodN=1 or gp=mN+1 where m is some positive integer. This number exists as long as g and N are coprime (proof below).
  3. Once we find p, we calculate (Ap/2+1)(Ap/2βˆ’1)=mN.
    • if p is even and both (Ap/2+1) and (Ap/2βˆ’1) are not multiples of N, then we know that (Ap/2+1) and (Ap/2βˆ’1) must contain factors of N.
    • Therefore, they contain A and B as factors
    • 37.5% of the time, these conditions are met from a random guess of g
  4. We can find the common factors between (Ap/2+1), (Ap/2βˆ’1), and N to get the values of A and B.

Complexity in decryption stems from getting the right p.

Look at Proof #2 : https://en.wikipedia.org/wiki/Euler’s_theorem#Proofs

  • Basically if you have a set of values abiding by these https://en.wikipedia.org/wiki/Reduced_residue_system conditions, then if you multiply the set by some constant that’s coprime to N (n in Wiki), the set of values will have the same modulo/remainder values, although they may be in a different order.
  • Then with some algebra manipulation, you can show that after multiplying this constant by itself totient(N) times, it will have a remainder of 1 when divided by N.

Use a Quantum Computer

  1. Guess a random positive integer g
  2. Create quantum state which a value for every possible guess of p (let’s call each of these guesses i) and the corresponding value of gimodN for that guess (<i, gimodN)
    • Notice that gpmodN=1 and thus multiplying/dividing gp by any power of g, will result in the same remainder modN. For example, suppose gxmodN=7, then gx+3pmodN=7
    • So, gp is actually the smallest unit of distance we can move from gx to reach the next value with g as the base that has the same remainder/modulo.
    • This means that if we take only the set of guesses for p in the quantum state that have a remainder/modulo of 7, the distance between these guesses i will be p. For example, we would have values in the state of <6,7>, <15,7>, <24,7>,…, which would mean that p=9 (the distance between each i).
    • This is equivalent to a wave with a period of p (frequency of 1/p). So, using a quantum computer where we want to get rid of the states that don’t match the same values of gimodN, we can input this into the quantum equivalent of a Fourier transform to then just have as output, frequency of the wave, which gives us the value of p.

Now we p and so we can calculate the private key!

Real RSA Encryption

http://mathonline.wikidot.com/rsa-encryption#toc0

Notes mentioning this note

There are no notes linking to this note.


Here are all the notes in this garden, along with their links, visualized as a graph.

5G and WiFiAWS Step FunctionsAnalyzing Reddit Post on the Dollar StandardAsync, Await, and PromisesBayesian AverageBias Variance DecompositionBlockchain PresentationBreakpoint Debugging in VSCodeBrief Look into Measure TheoryC4 Model for Software ArchitectureCache vs Session StoreCant compare mean and median from different setsClient vs Server Side RenderingCode Production in an AI CompanyComparing Client Side Storage MethodsComputational Perception HighlightsConfidence Intervals for Known Distributions and...Cool Stocks ListCrazy Meeting with Obama, McCain, and Bush Post...Curse of DimentionalityDatabase vs Data Warehouse vs Data LakeDifferent Git AddsDocker (containerization) vs Vagrant (virtual...Explaining Decision Boundary of a Support Vector...Exporting Databricks Files to GithubFloyds Tortoise and Hare AlgorithmFresh Mac Setup Installation EssentialsGraphical Model IndependenciesHighlights from Bad SamaritansHighlights from Good Economics for Hard TimesHighlights from The Righteous MindHow Does Chromosomal Heredity WorkHow Does Light Influence the Rate of Capture in a...How Does Sweating WorkHow Does Version Naming WorkHow Not To Be Wrong Excerpt Self Selecting BiasHow Not to be Wrong Excerpt Public Opinion Doesn't...How Quantum Computers Could Quickly Break...How Someone Made a Spectral Lamp that Can Emit all...How are images compressed and stored in a computerHow do SPACs WorkHow does Hypothesis Testing WorkHow does air slow objects downHow is Neural Network a Universal ApproximatorHow is Unit Testing DoneHow to Access a Previous Commit with GitHow to Add to Your System Path Variable for MacHow to Build a Full Stack ApplicationHow to Clear Unused Docker ContainersHow to Convert from Celsius to FahrenheitHow to Delete a Branch GithubHow to Export Pandas DataFrame to CSV ProperlyHow to Force Pull and Overwrite GitHow to Get the Bootstrapped Standard Error for a...How to handle violations in positivityHow to Properly Explain Technical ToolsHow to Push Code for ProductionHow to Read a Path in S3How to Set Up Python Aliasing In the Command LineHow to Set a Specific Branch to Track a Specific...How to Store and Access SQL Queries in DatabricksHow to Take a Weighted AverageHow to Temporarily Stash Changes with Git StashHow to Untrack Committed Files from GitHow to Use PyenvHow to Use Sample Splitting for Doubly Robust...How to Write Output to Text FileHow to edit Obsidian themes with CSSHow to make copies of DNA with PCRHow to use Bounds and Sensitivity Analysis in...How to use Scipy Optimize to solve for values when...Info on Stock OptionsInspirational Computer PioneersIntuition Behind the Doubly Robust EstimatorInverting Hypothesis TestsInvesting LessonsJupyter Widgets ExistML CheatsheetsMaking Sense of a Betting Market with...Managing Ruby Versions with rbenvMarket Makers and Quant TradingMarket Making PresentationMatching IntuitionMethodology for Managing Web AppsMicroservices vs Monolithic ArchitectureModeling Advice and Lessons Learned Working at a...Multinomial to Binomial Stick Breaking...Music Theory NotesNotes from Michael Nielsen Effective Research PostNotes from the Martian by Andy WeirNotes on Bayesian OptimizationNotes on Exon Skipping with ASOsNotes on Options SpreadsNotes on Quantum CountryOne Persons Perspective About Why We Shouldnt Read...Presentation on the Kronovet Family Clothing...Python Dataclasses UpdatePython Package Reference InstructionsRandom CMU Course WebpagesRandom Facts from What If by Randall MunroeReading about Internet ServicesRock Thrust ExplainedSSHing into AWS and Running ThingsSome Bash Commands to Find Redundant Files and...Some Cool Python FeaturesSome Notes on Exploding Gradient ProblemStats BlogsStock Options in a CompanyTesting Code on GithubThoughts after Reading Hillbilly ElegyThoughts on Andy Matuschak Article on Teaching...Thoughts on Approaching Infinite KnowledgeThoughts on Maria Konnikova Knowledge Project...Thoughts on the End of Natural SelectionTor Network and .Onion DomainsUsing nonparametric models in doubly robust...Various Treatment Effects and their...Virtual Environment in AWSWhat Database do I useWhat are Git Pull and Push RequestsWhat are Information CriteriaWhat are Javascript WorkersWhat are MakefilesWhat are Moment Generating FunctionsWhat are Multiple CPU CoresWhat are Progressive Web AppsWhat are Wasserstein and Earth Movers DistancesWhat are the Four Fundamental Forces in Our...What is Apache SparkWhat is Bootstrapping in StatisticsWhat is Cryptocurrency StakingWhat is ElasticsearchWhat is Express.jsWhat is GLUEWhat is GraphQLWhat is HTTPSWhat is IV CrushWhat is Integration ReallyJAMStackWhat is KubernetesWhat is Mahalanobis DistanceWhat is MakerDAO CryptoWhat is Markov Chain Monte Carlo SamplingWhat is Nested Cross ValidationWhat is Next.jsWhat is PAC LearningWhat is R SquaredWhat is RedisWhat is ShrinkageWhat is Spearman CorrelationWhat is SvelteWhat is TerraformWhat is The Graph (Blockchain)What is Variational InferenceWhat is Vue.jsWhat is WebAssemblyWhat is a Credible IntervalWhat is a Fourier transformWhat is a Gaussian Mixture ModelWhat is a Gaussian ProcessWhat is a Object Relational MapperWhat is a Qini CurveWhat is a Sufficient StatisticWhat is independent component analysisWhat is the C-Statistic for BenefitWhat is the Dirichlet ProcessWhat is the EM AlgorithmWhat is the Hidden Markov ModelWhat is the Indian Buffet ProcessWhat is the Naive Bayes algorithmWhat is the Negative Binomial DistributionWhat is the Runtime of a LanguageWhat is the Studentized BootstrapWhat is the Wake Sleep AlgorithmWhat is the hypergeometric distributionWhy are Conjugate Priors UsefulWhy are there 12 Notes in Western MusicWhy is Cross Fitting Useful for Estimating...Why is a room hotter when you leave the fridge...Working with ClientsWorking with Terminaldata science overviewhighlights from Debt The First 5000 Yearshighlights from Enlightenment Nowhighlights from Hacking Darwinhighlights from How Not to be Wronghighlights from Leonardo da Vincihighlights from Open an Autobiographyhighlights from Range Why Generalists Triumph in a...highlights from Salt, Fat, Acid, HeatSapiens a Brief History of Humankindhighlights from Stumbling on Happinesshighlights from The Genehighlights from Thinking Fast and Slowhighlights from Trick Mirror