How many people know about, uh, quantum physics? Yeah? Yeah? So I was looking at this, uh, I was looking at this, this, this, uh, this talk synopsis and I'm like, maybe this is gonna be a good talk. Maybe it won't. I guess I won't really know until I take a look at the talk. Yeah? Learned that from a baby book. Yeah. Awesome. Alright. So, let's give Andreas a big round of applause for coming all the way to Vegas from Sydney, Australia to talk to us about quantum cryptography. Have a good time, man. Thanks so much. Alright. Welcome everybody. Um, yeah, after that introduction, uh, hopefully you walk away and, uh, learn something in this talk. So, um, quantum computing, if you read whatever's in the press, you either think we are completely doomed and, you know, the internet's gonna end or, uh, nothing's gonna happen because they will never exist. So I thought I want to explore this topic a little bit more from an algorithmic point of view and really see where we are. Not so much on the hype, but more really what are the algorithms, uh, that we talk about right now. So, um, I started various companies in the security space, you know, starting in 2002, which, um, uh, makes me feel slightly old, uh, right now. Um, but first I'm speaking at DEF CON. I'm very happy about this, you know, long-term FND, but never spoke here, so let's get right into this. So when you talk about cryptography, we mainly, you know, look into two different, um, uh, types of cryptography. One is, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh, uh system right now that is deployed uh anywhere is what we call computationally secure. That is secure in the sense that there are known algorithms that can break them but all of the algorithms that can break them are not easy to do in the sense that you know uh if I want to break an uh you know 2048 RSA key with a normal computer takes me a couple trillion years which means I'm secure even though there's a known algorithms uh that can break them. Uh there are information theoretic algorithms out there most notably an algorithm called um a one time pet or vernon ciphers but they're really tricky and not really practically usable for example it's one time pet you do need to use the same amount of keys as you want to transmit so if you want to transmit a one megabyte file you need to have a one megabyte key basically for every byte you need a different um uh for every byte data you need to have a one megabyte key basically for every byte data you need a one byte key so you would have to manage massive amount of uh key material which is not really uh practically but I mean they do exist but outside of this virtually every uh cryptosystem is just uh computationally secure. And um uh when you look at this uh quantum realm and I'm going to quite some detail about this uh for those two different types of algorithms it is uh much more interesting to look at the asymmetric part of the uh of the cryptosystems. Because in the symmetric part there is a quite a number of uh cryptosystems that can break down the uh cryptosystems and uh you can look at the quantum algorithm as well called uh Grover which basically looks into um a or provides a quadratic speed up to the classical um uh version. Basically in the classical world if I want to look for the shared key I need to basically brute force every different combination which obviously takes forever. Uh I get a squared root up uh um a squared speed up in the quantum version which is a fantastic speed up you know if I can speed up a hundred fifty trillion years it's you know a lot of years but it's still obviously a hundred fifty trillion years uh to break it. So that's not really too interesting. So we want to focus here on the asymmetric part where um uh the uh speedups that quantum computers can provide are massive. And uh we want to go into quite some detail uh why uh their speedup is so big as it is and uh how they work. So let's revisit just a little bit of how RSA encryption works and it's really just a basic uh introduction so we can use them uh to understand how the uh quantum versions of these algorithms works. Basically. I choose two prime numbers P and Q and um uh with those I I just multiply them get the number N. Now with the number N I can calculate this lambda N function which is a Carmichael function which is just the function I can easily calculate this. And once I have this I just choose another parameter E which is smaller than the uh lambda N uh uh value and then this N together with the number E is my public key. I can give this to everybody out there who uh is interested in this I wanna choose to do um uh the asymmetric encryption. And I basically retain my private key which is this uh uh number D here which is just the modular inverse of the number E which is the the public key. Obviously mod mod lambda N is always mod lambda N kind of uh in in this uh uh scenario which is the private key that I retain. And with this private key now with this scenario I can now look into hi I can now encrypt something I can now do the encryption. And uh it will give me a and send something um from Alice to Bob. And as everybody knows with isometric encryption I can only encrypt something that is smaller than my key. So if I have a 2 4 uh 2048 bit key I can only encrypt something that is smaller than uh 2048. Um so I need to pad my plaintext into um uh a number N so I turn this big M into a small number M. Um uh there's various way for this, ways for this I don't go into too much detail but this is where the padding schema comes in. And then I basically end up with this number uh uh small M. And my ciphertext my encrypted version is really I just take uh this number M to the power of E, mod N and that's basically my ciphertext. And this is what I encrypt with a public key and I can now send this uh number C to uh um to Bob uh or receive this and if you have the private key you can uh encrypt this number C. You can easily decrypt this as well on the other side. And uh you can easily see how this works. It's it's really very straight forward. If someone has the C and the ciphertext and the D the private key by definition C is M to the power of E. So you see um uh but the definition of D was that is actually the inverse of E. So this E to the power of D just uh equals out. So I end up with M mod N. So uh if I have the private key I can easily recover um uh the uh the small M. And obviously by just reversing the padding scheme I have now my uh my message again. So this is basically how RSA encryption works into some detail. So my task is now I do have a public key because that's public. Everybody knows what the public key is. How do I turn this into a private key? Now from the divi- uh from the definitions it's really pretty uh straight forward and simple. Um I need to find those prime numbers that make up this number N. The number N is known, it's part of the public key. And if I can do this I can easily calculate lambda N. Which is really just the uh least common uh multiplier of uh lambda P and lambda Q. And from that I can easily derive the private key D. Um uh and I'm done. So all I need to do to basically go from a public key to private key is to find those two prime factors P and Q. Um that I chose in the very beginning um but I kinda. But I am the first one on meaning when I set up my key um and then I have everything I need to do to basically derive a private key from a public key. Um while that sounds pretty easy and straight forward actually to do this and to factor this number N into the two prime parts P and Q is um uh is really really hard and all of the classically known algorithms are all from exponential complexity. Which means they're really really hard uh to solve even you know the uh GNFS algorithm is uh slightly sub exponential but still massive in scale so that gives you those assurance that if you have if you use any of the asymmetric algorithms uh people would need trillions of years to decrypt them so they're fairly secure for generations to come. But in 1984 a guy called Peter Shaw he was a um theoretical physicist came up with this algorithm. If we were to use quantum computers obviously in 1984 there was all just a theory quantum computers didn't exist and they hardly exist today but um but the theory says he came up with an algorithm of how to factor those numbers in just polynomial time. And in just polynomial time really is a difference that is re that is almost incomprehensible. Because it really means instead of taking a trillion years on a classic computer with a trillion operations per second let's suppose I have a quantum computer which just does a million operations per second I can actually do the same thing in just 10 seconds. So the difference between exponential complexity and polynomial complexity is just out of this world and that obviously if we could run this algorithm would pose a big threat to uh basically the whole um uh crypto systems as it is as it is deployed because the base of this whether it is um you know for RSA or elliptic curves or for digital signatures ECDSA which is used in bitcoin or for a key exchange like Tiffy-Hellman which is mainly used in everywhere you go uh on SSL, TLS exchanges so the base foundation of this is used virtually everywhere in today's internet so that would be a big threat. So let's explore a little bit um how Peter Shaw could came up with his algorithms what is actually needed and how they work in uh in reality. So now we need to do a little bit of a introduction into quantum computing and uh it gets only as deep as I thought we need to go to understand how Shaw's algorithm works and uh what we need to understand um uh so hopefully it it's not it's not too bad. So basically there are two big types of quantum computers that we look at right now. One is called gate based quantum computers that's a big chunk what everybody's working on all the big guys IBM, Intel, Microsoft, Alibaba they're all working on gate based quantum computing which is a big chunk of what everybody's working on all the big guys IBM, Intel, Microsoft, Alibaba they're all working on gate based quantum computing which is called universal quantum computing because I can solve virtually any problem similar to a classical computing uh on this computer. There's then a different computer um uh called quantum annealers or adiabatic uh quantum computing which is what's the first quantum computer that was available was uh from D-Wave. And D-Wave's computer this adiabatic quantum computer is not a general quantum computer. You cannot solve every problem on this quantum computer. It is very specialized to only solve a particular problem. So you can't solve any problem on this quantum computer. It is very specialized to only solve a particular optimization problem. So it's very much um you can look at this basically as a physical system and physical systems tend to always end up in the lowest energy state which we call the ground state of this physical system. So if I can now define a function that I want to solve and I basically define those functions in a way that the lowest energy state is basically the same as the solution to this optimization problem. I can use this physical system to solve the problem that I have because I know the physical system will end up in the lowest uh energy state in the ground state and I know then this also tend this also represents in the state where my optimization problem reached the lowest point. And that's a really cool um uh theorem um which actually guarantees to me that I end up in the lowest state that there is. You can really think of this as kind of like mountains and valleys and you could end up in a valley that's uh uh uh uh uh uh uh uh uh uh uh uh uh uh uh uh uh uh uh uh uh uh uh valley that is just halfway through and you're not really in the lowest state. But there's a theorem um we are gonna explore this a little bit which guarantees which gives me way how I can really be at the lowest state so I can solve or I can find the optimal solution to this optimization problem. But it's really just solving optimization problems. The guide based quantum computing uh is really a general quantum is general computing um uh architecture where you start with an input, you apply all sorts of different calculations to it, technically those are all guide based uh calculations. You do an end guide, you take two qubits, do something to it, you get a result. But essentially you have an input, you calculate something and you have an output. And it's basically uh you can calculate every uh everything you want to calculate uh with these uh universal quantum computers uh while quantum computers like D-Base can really only solve um optimization problems. But actually as it turns out both approaches can be used to solve the factorization problem. And uh uh uh uh uh uh uh uh uh uh uh uh uh uh uh uh we have Shor's algorithm from 1984 which uh um uses gates to um uh solve this problem. And in quantum annealing we have various approaches since 2002 and I want to explore those a little bit in the uh next couple of slides as well. How they work to actually um uh solve the factoring problem as an optimization problem. So let's dive a little bit into quantum computing and what I need to understand to to explore a little bit Shor's algorithm and really understand the problem. And really with the idea of giving you an understanding of how can someone derive an algorithm that gives me now such a dramatic improvement over an classical algorithm which takes uh exponential time uh uh to solve. So the basic building blocks for uh quantum computers are what we call qubits. Qubits is the equivalent of uh classical bit. A classical bit is either zero or one. A qubit is now a you can almost think of it as a quantum computer but it's a mechanical system which can be in any state you want it to be and you don't actually really know in what state it is. But once you measure this quantum mechanical system it is either gonna be zero or one. And this is an uh this is something that we gonna exploit later on that why before we measure this system we don't know in which state it is. But it can be actually in a super position it can be in a state where all of these um uh qubits can um interact with each other very end of my processing step I will measure the system and all of those superposition state will uh basically terminate and I know it's either 0 or 1. But it's really a quantum mechanical system, you don't really know what it is, it's neither 0, it's neither 1, it is something in between, uh quite often we then uh assign um uh variables to it and here you can see a representation of one of those qubits. We have this uh two bases, 0 and 1, which basically represent this uh 0 means if I measure this particular qubit in 100% of the cases I will get the the measurement outcome of 0. The 1 means in 100% of the case of measurement it will give me the uh measurement outcome of 1. And now a qubit is in the superposition of those two with uh alpha and beta. Those are two complex numbers, I can represent those and uh that can now define uh the state of this particular qubit. Now, what I can do is I can we call alpha and beta probability amplitudes because if I measure this particular uh or one with a certain probability associated with it and the probabilities are really defined by those two numbers uh and basically to the squared um uh for alpha and beta uh you know I know it's gonna end up in zero and with those two numbers I can represent those qubits it's basically a mathematical representation of the quantum mechanical system uh that the uh quantum computers operate in. But remember all of these measurements and everything we do in the quantum world is probabilistic. Everything is just a probability. I can put a quantum in a state where I can tell you in exactly half of my measurement it's gonna be zero in half of my measurement it's gonna be one. Which is perfect for random numbers for example because I can tell you hey you don't really know whether it's zero or one it's exactly equal probability of getting zero and one so I just take one qubit measure it five trillion times and I get five trillion uh random bits. But obviously I don't really know whether I get zero or one it's all defined by probabilities. Which has a big implication on the algorithms because the algorithms will also only give me probabilities. There's no algorithm that can give me I run through this algorithm once and it will give me the answer yes it is this answer. It will always only give me yeah I think with 83 percent uh probability it's gonna be this answer for example. So quite often you run these algorithms multiple times to really see um uh uh uh where you end up with. The second um uh principle uh principle that I'm gonna use is uh the that we need for Shor's algorithm is the concept of entanglement. And uh that gets slightly philosophical um I wanna focus a little bit more on the mathematical part of this. Entanglement is basically a property where I can have two qubits and I know that there's some correlation between those two qubits. In a classical world I have two bits and the two bits are completely independent of each other neither of those those bits will interact with the other and if I if this qubit if this bit is one doesn't matter what this is. In a quantum world I can have a a a relationship a correlation between those those two qubits. And a simple example is the Bell state of two qubits. So this state is here a state where you can set where you have two qubits. In those funny notations the first zero is the is the value of the first qubit the second zero is the value of the second qubit. But if I would measure this qubit here and let's suppose I measure the first qubit as being zero. It cannot be the second one because you know the first zero the first qubit was zero. So if I measure this qubit here and let's suppose I measure the second qubit has to be zero as well. I know that the second qubit is gonna be zero simply because I measured the first qubit and there's no way because I don't have zero ones or one zero in there that the second qubit could something different than zero. So I take basically two qubits give them into this quantum mechanical system prepare this Bell state and now I have two qubits that are separate uh from each other but in this quantum mechanical system those qubits are now correlated. Or what we call entangled. And now I could give one qubit to Alice and send her to the moon and one qubit to Bob and send him to Mars and I know that if Alice looks at her qubit and Alice says oh I got a zero. I know Bob has a zero as well. Even though there's no communication between those simply because there's this correlation those properties now I need obviously those two qubits I need to prepare them together and then I can send them anywhere. So I can send them anywhere I want uh and they are correlated without any communication in between those two. Um there's lots of physio-philosophical implications because I could give I could put those two qubits light years away from each other and uh did I really find a way of uh communicating faster than light? Uh no I didn't because if Alice measures it's gonna be zero. If she wants to tell Bob hey I measured zero she needs to communicate this information uh to Bob which obviously uh she needs a few light years uh to do so. But it's an important principle that we're gonna use in Shor's algorithm as well. And the main thing for you to understand is the um exponential large size I can look into when dealing with those quantum systems. Let's suppose I take two classical bits I can uh represent four possible states with two classical bits. But only one of them at the time so you know if uh I mean you see the four states there my system with those two bits is in one of those states at any one point. So I can look at those quantum systems and I can look at the two point at any point in time. In a quantum world I can take two qubits and basically at the end when I measure this system it's also gonna be in one of those four states. But before I measure this system the because of superposition those qubits can be in all four states at the same time. And only when I measure the system the system will collapse to one of those uh four states. And this is exactly now um a situation we're gonna exploit. The way if I have n qubits I'm gonna represent two to the power of n states. While I do calculations I still at the end of the day need to know what the result is of my uh calculation. So I need to measure at some stage and then it will collapse obviously to um uh those n states. But during calculation I have two to the power of n states which is a massive amount of uh um uh states that I can represent with just a few amount of uh of qubits. So now I I now have everything kind of uh to look into short and algorithm and uh and how it works. Um uh and we're gonna look into this. So the main idea for that Shaw had was actually if I want to look into how to factor uh uh n into p and q into those prime two prime numbers I don't actually need to solve that problem. That problem is equivalent to a different problem. And basically he looked into number sequences and he realized from number theory that you have a number sequence for example uh you look at the number sequence here um you multiply the number sequence and you multiply the number sequence and you multiply the number sequence and you multiply the previous number by two. So 1, 2, 4, 8, 16, 32. If you now do if you now use this number sequence and do this mod 15 for example in uh in this example you end up with a number sequence 1, 2, 4, 8, 1, 2, 4, 8, 1, 2, 4, 8. This is what we call a periodic um uh sequence. So it's always gonna be the same uh kind of uh sequence of 1, 2, 4, 8. And we can now define a um uh uh a number which is called the period. Uh uh a number which is called the period. This is uh this value in uh zouka or stephens 것은 which is 4 which is basically the number of the the amount of numbers before it repeats itself. And um uh the underlying algorithm ersch Lif stopped is th e if I want to find out the factors for this number n, if I wanna find out this PNQ I can actually transform this into problem of finding the period r. And thh that terms out for that problem I can run tht very easily on a quantum computer. So basically if I look into this and the cool thing is and I want to show you this on the next slide. The mathematics behind it is actually fairly trivial. Basic level of linear algebra gives you everything to understand how this works. So the only thing you need to accept is that out of number theory there's a theory which basically says this number this function uh f fi x to the power of i mod n is a periodic function. Um if x has uh particular properties and now I only need to find uh the number uh the uh period r. And with this I have my algorithm show which we run through in quite some detail actually but essentially it's comprised of three phases. First is I turn this factoring problem into a uh period finding problem and that's actually trivial. Then I use a quantum computer to actually give me this period r to solve this period r on a classic computer is again really really hard. Actually on a classic computer it's still a very uh very big of exponential um uh complexity which mean that this algorithm on a classic computer does not give me any advantage whatsoever but I can use a quantum Fourier transform and that gives me the speedup. And then basically once I have the period r I can really very trivially um uh use this to find the factor. So stage one and or step one and step step three are really trivial. Step two is where all the magic happens and that's where the um uh that that's where the main speed up comes. Now I don't want to go into too much detail but it's actually really simple so I think you can uh download the slides and you can look through this. I know that f a is periodic. I know that x to the power of zero is one. I mean everything to the power of zero is one. And if r is now my period I know because the function is periodic that x to the power of r mod n equals one two equals the same what it was before because it is period. And really with basic linear algebra I can now use the x to the power of r equals x to the uh power of r half. Two. To the power of two and I can uh um uh um just write this in a different form which gives me this um uh multiplication of two numbers that will give zero mod n. So if I can use this if I have this r I I have these two numbers so but if those two numbers um uh mod n is an uh those are an integer and a multiple of n because their product. Is zero mod n so that means they're an integer and a multiple of n. So either those are directly factors or if they're not directly factors each one of those. Has a factor in common with the number I want to look at. So the greatest common divisor which is actually um not too hard to compute uh classically it's just an n squared complexity so by computing the greatest common divisor for each of those numbers with n. I have my factor. So that's just a common divisor. Now, my factors uh for uh uh for n. And uh that is really simple but to get to this r is really really hard. But I can put this together in a really uh quick example. Let's suppose I have n equals 15. Now everybody can calculate in their head that the prime numbers are 3 and 5. Basically I choose any integer between 1 and 15 and let's really use for the sake of simplicity let's use x equals 2. So you can see my period here mod 15 is 1 to 4 r and 5. Uh so I have the period 4 I can see this that's a really hard part to uh calculate. But with the period 4 the greatest common divisor of x to the power of uh uh r half is r is 4 so r half is 2. Uh x is 2 so that's 2 to the power of 2 which is 4. So the greatest common divisor of 3 and 15 and 5 and 15 so so uh 4 minus 1 and 4 plus 1 is obviously 3 and 5. And when you calculate this through actually in every case. You come up with uh 3 and 5. So that's exactly what Shor's algorithm is all about. But the really hard part is uh figuring out uh what is this period r. And this is kind of where the quantum uh compu uh quantum algorithm comes in. And those quantum computers or those quantum algorithms always work in the same principle. You basically you you initialize basically the result that you want to see and say let's think of we want to get a 256 bit number or two 2048 bit number. And you basically every bit every bit of this bit representation is going to be either 0 or 1. So you basically put this in an equal uh superposition. So every bit you basically put at 50% 0 and 50% 1 because you don't really know what it is. So it's really kind of like uh at 50%. Then you run through this um uh quantum Fourier transform which will use amplitude amplification. So with every iteration of this algorithm those amplitudes will now go towards 1 or to 0 which is going to be the final result. And you run this through uh um a number of times. And then you measure it at the end and you will see when you end up with. I'm gonna have an example of this uh um when we run this uh through on a on a real quantum computer. But just to um uh summarize Shor's algorithm all together is uh fairly simple. You choose any random number a which is uh smaller than n. You compute the greatest common divisor. If this is not 1 actually you found uh you found a factor and you're done. Uh but that's uh obviously not the most likely not the case. I used my quantum computer to find this period r and once I have r I just need to find the greatest common divisor of those uh um uh two terms and I'm done. So um uh another example I choose randomly uh number 7 calculate period r r equals 4. I have this greatest com divisor of 48 and 15 and 15 and 15 gives me uh 3 and 5. So there's uh what I'm doing I'm so it all works fine. I can now use this and use a um a library a toolkit called Qiskit which is an open source toolkit there's now at least 5 or 6 different open source platforms how you can use quantum computers and how you can program quantum computers um either on quantum simulators or on real quantum hardware. And I gave you some references here you can look up those it's actually kind of fairly easy um uh to go through. But they all start the same and here you see an example of this amplitude amplification. Basically in the end you see all of the possibilities what the my prime numbers could be. They're all in the same probability what they could be. That's my starting point. And once I run through this algorithm and I ran through this uh Shor's algorithm on from these references the amplitude of the correct results have now been amplified and the amplitudes of the wrong results have now been kind of like gone down to zero. And I actually see that the amplitude of the wrong results have now been amplified. So you can see that there's two results r equals zero and r equals 4. R equals zero is obviously trivial um uh um uh probability so I discard this and I end up with r equals 4. So this was now executed on a quantum simulator. Quantum simulator I can simulate a quantum state on my normal computer. But remember in quantum computing we're exploiting this fact that I have this massive large space of 2 to the power of n. So I'm gonna have really trouble simulating more than whatever 100 qubits or so on a normal computer. And um uh uh but for smaller ones uh for illustration it's actually quite cool. So the cool thing is IBM has a quantum computer that you can publicly access. You can write a uh quantum computer program execute it towards their cloud. It's very simple you just change hey my backend is a simulator you change the backend to uh IBM's quantum computer. Um and if you execute this against a real quantum computer it's just a 5 qubit quantum computer um uh right now. I still get r equals 4. So I can execute this against a real quantum computer. It's just a 5 qubit quantum computer. But you see there's lots of other probabilities. And those probabilities are representative of all the errors you have in the system simply because those quantum computers that we have right now are really pretty bad. What they are what we call noisy. They don't produce the correct results because they're noisy. They produce lots of wrong results. Now by re-repeating my algorithm lots of times I can still get around this fact. And obviously in this case I still have r equals 4 the highest probability. But obviously that has big implication on performance because I need to now repeat these uh my algorithms much more. And obviously I will end up in uh dead cases because uh obviously the noise will basically um reduce the speed up in the quantum effects uh to zero. And it basically collapses to um uh a um a classical computation uh that I have. But the cool thing is actually with uh Qiskit as well there there is a libraries for every quantum algorithm that uh you know that people know and they kind of uh provide easy libraries. If you want to run Shor's algorithm to factor prime uh to factor any numbers you just import Shor's algorithm from uh Qiskit Aqua which is uh which is a library. You just say alright I want to factor this number n equals 15. I use a simulator. I do this uh 1000 times. And off I run this instance and I get a result. How cool is that that you can run this against uh against a quantum computer? Uh oh. Uh oh. Uh oh. Uh oh. Uh oh. Uh oh. Uh oh. Uh oh. Uh oh. Uh oh. So this is a software, this is a very good software even if you run it against a quantum computer. The only thing you need to do in these examples if you run this against a real quantum computer is to change this back end from the simulator to a different back end. And now there's a call out to IBM's uh quantum computer to run this uh on on that back end. It's actually really really cool and this feeling when you run a quantum computing uh software for the first time is actually is actually quite cool. So I encourage everybody to look at Qiskit or various quantum computing uh libraries um uh and uh to play around with this. So the problem obviously is um uh and you guessed it that in order to do anything meaningful I need lots of qubits. So in order to use Shaw's algorithm to um uh break RSA 2048 I need 4,000 qubits. And I need 4,000 proper qubits meaning without any noise I need for the time of the computation there can't be any noise on the computation as well. And it's not really a surprise because when Shaw came up with this in 1984 there were no quantum computers. He didn't have to worry about hey can I really implement my algorithm or not? He really just came up with a system and method. So um it was never really meant to run on a quantum computer. And uh right now lots of people look at Shaw's algorithm and then see alright kinda right now we have 70 qubit so it's every the qubit count doubles every year whatever so it's gonna be another 10 years we have before we have uh Shaw's algorithm. Nobody's gonna run Shaw's algorithm because it was just a theory. So let's look at some of the the uh researches where people took people took Shaw's algorithm and modified them and optimized them to run on real quantum uh quantum hardware. So the first one was Fowler in uh 2012. Basically the the first approach is really kind of I need to tweak this algorithm so it can be so it can sustain errors. Because Shaw's algorithm really was an assumption there's no errors all the qubits are fantastic uh no errors. So basically they used they used the algorithm to run on real quantum uh quantum hardware. They used what's called uh surface codes to allow for errors to occur and the error rate is 0.1 per side of the uh of the gate error rate. And um uh Fowler came up I can run Shaw's algorithm and I can factor 2048 bit number but I need 1 billion qubits uh to do so. Which is obviously a massive amount uh in terms of overhead um uh to run this. So that was in 2012. Not not too long not too long ago. And then in 2017 with further optimization uh the first optimization from O'Gorman we suddenly kind of like uh had an uh had an algorithm where we reduced 1 billion qubits to just 230 million qubits uh in 2017. And that was a really optimization of physical connectivity of those qubits. And uh then Joju kind of reduces further to 170 million qubits. So you can see there's algorithmic improvements without any hardware improvements obviously that's happening at the same time as well. But obviously I get down from 1 billion qubits to right now. So that's a huge improvement. So that's a huge improvement. So that's a huge improvement. So that's a huge improvement. So now uh 170 million qubits. And the biggest um uh contribution was from Githney and Akira from uh from uh um uh Google and uh University of Stockholm where they uh provided paper just not long ago earlier this year. Where they uh looked into how they could do the same thing what everybody else is doing which is 20 million qubits. Now we went fr- in 2012 from 1 billion qubits to 2019 to 20 million qubits. And we are far from the end of the research that we're doing now. So there in terms of optimization uh to this problem. Now I won't go into too much detail of this uh of what they do but basically they also look into lots of optimization of how things work and they basically also choose similar to Shaw not really look into factoring the numbers directly so they basically convert this factoring problem into Shaw discrete algorithm problem and um uh they have a part that is computed computed uh classically and a part that is computed um uh uh quantumly on a quantum computer and they can show that in order to find P and Q they can uh come up with obviously they know what N is which is uh the uh multiplication of those two they can come up with a number where they know the addition of those numbers are D so D is known so if they have two um two equations for two different numbers they can two variables which they can fairly easily solve fairly easy is obviously an overstatement because they still need uh 20 million uh qubits uh to do so um uh but obviously the um the reduction from one billion qubits to 20 million qubits is massive and uh I expect in the next couple of years there's gonna be lots of optimization to Shaw's algorithm and especially to get in the Keras um uh uh algorithm uh where this is gonna be uh reduced uh further on. Obviously 20 million qubits is still a long way away from uh the uh the uh the uh uh the application capabilities that are usual uh from uh quantum computers that are accessible today um uh where we are more you know slowly below 100 qubits um uh at this point in time. So I wanna spend the next you know or the last ten minutes of my presentation on a process on quantum annealing. Those is the second type of quantum computer and uh that is actually what's quite surprising to me even though everybody's talking about Shaw and the implication of crypto cryptography. Actually quantum annealing right now is much much further ahead in terms of structure, demanding more data. If these quantum structures all connected and also up west solving this factorization problem and we're gonna look into a little bit how uh these algorithms work. So as mentioned before quantum annealing those computers are really computers that can solve an optimization problem. I need to I need to define my problem as an optimization problem then basically quantum annealing computer can take this problem and find the minimum of this uh problem because it represents a physical state and another physical state will always end up in the ground state and uh I can read then this ground state and I have the solution to my problem. And there's really a cool a cool theorem um uh where you wanna find you wanna go into the lowest point you wanna find this lowest point on the right hand side. So how do we end up in this lowest point and not get caught up in those uh minimas uh in between and there's lots of ways how you can do this from the uh from the physical system. And there's a really cool case on this quantum annealing. So I'm gonna talk about the quantum annealing case where there is a theorem that says if I start in a really in a very easy quantum mechanical system in this really easy quantum mechanical system I know the ground state. So this is my problem I wanna solve is here I am starting here and I really know where I am. I can now slowly evolve and adiabatic means slowly evolving this the state from this here to the state where I really wanna be and now this theorem gives me a guarantee or physical proof that I will end up in the in the maximum or in the in the optimal minima of the problem I wanna solve. And it's really cool so I have Hamiltonians are functions that define a physical system but basically if you look at the first function if you put in s equals zero you end up in this h zero which is my easy to understand system where I know the local minima and in my calculation I slowly move s from zero to one and then I end up at one and if I'm at one I'm in a stage h one which is the problem that I really wanna solve but this uh adiabatic theorem guarantees to me that I will end up in the maximum uh minima uh for the problem that I really wanna solve which is really really cool because it gives me I'm I know I'm not gonna be caught into some local minima but still essentially I wanna solve an optimization problem. How do I do this? And the first research came from Burgess in 2002 from uh Microsoft where you know he provided a foundation to solve the problem and he provided a foundation of hey I wanna solve basically if I wanna look into the problem n equals p times q I'm looking for p and q um uh so that this uh equation is true so I just need to solve this I need to write this as an optimization problem and basically re re rewrote this as n minus p q squared and this is a positive function this is always greater than zero and this is obviously only zero if n equals p q and if you write it this way you have what's called a cubo or a quadratic unconstrained binary um optimization problem which you can happily run on any quantum annealer that is out there. And you basically use binary representation and it's really just a fancy way up here of writing p i and q i are just the i's you know bit it's either zero or one and uh you basically now uh write this down and it's a very simple example my example fifteen is five times three. Now um uh in binary notation p equals x one one and uh p equals x one the the last bit always has to be one because the prime number can't be an even number and I just you know n minus p q squared I just write this through and kind of by hand and see oh this is a function I need to minimize now. And I can run this against D-Wave's quantum computer and if I find the minimum I know n equals p q because that's by definition a positive function. So I can use quantum uh um D-Wave's quantum computer they provide a library as well and um you see the link here you can download it it's basically the same thing I just call factor p, p is my um uh product and I can run this on this uh D-Wave's quantum computer. The problem is if I just use this without any optimization I need uh n squared qubits for this so I mean my number of qubits that I need really kind of like grow quite heavily and for larger numbers this is not sustainable um uh to do. But I wanted to show you it's all probabilistic so if I run this one time I end up with um uh my four fifteen uh for the p and q for my two prime numbers is one and seven which is obviously wrong so I ran this once and I didn't really end up in the uh in the right spot. But I ran this five times now I've already have five and three it's already sixty percent um uh you know probabilities and if I ran this fifty times you know I know my prime numbers are uh three and five so I know I need to run those quantum algorithms more and more often to make sure I end up in the same results. Um I'm gonna skip over some of those things because virtually all optimizations of now this base you know of of Birch's work where he basically looked into hey my multiplication matrix that you write out as a function to be minimized there can be lots of optimizations virtually all of the uh work that I will present here now is based on optimizations of how you do the multiplications down below here. If you've ever done uh multiplications by hand you know you start on the right and you kind of multiply the lowest numbers and then you have carryovers to the left and virtually all of those optimizations um uh go through this uh how I can do this multiplications much easier. Dridi and Agassi did some work in 2016 where they used some of these uh optimizations to remove some of the odd of the degrees so they were already able to factor a number greater than two hundred thousand with almost nine hundred qubits. Now D-Wave's qubits on quantum annealing are not as don't have to be as good as universal quantum computer qubits so D-Wave announced a system with uh I think around five thousand qubits for next year so nine hundred qubits what was was what available then then uh back then. On universal quantum computers the biggest prime number is less than one hundred and I these guys in 2016 could already now factor a number that was over two hundred thousand. The big breakthrough was from Zhang and uh in uh Indiana uh in uh April 2018 and it's really kind of mind blowing uh you see the next one which was really just uh two months after really around optimization of this uh multiplication map and they've now raised they could factor a number which is greater than three hundred fifty thousand with just ninety four qubits. Remember D-Wave comes up with five thousand qubit uh quantum computer uh next week uh next year um uh and it's all based on this optimization of uh problem that we solve for factoring and with uh optimization to the multiplication table. And then Pang in 2000 uh in uh earlier this year really um uh and you can see this uh submission was received in July while the previous submission was I think uh submitted in April or something like this just months after optimizes even further and they've been able to factor a number that is greater than one million with just ninety qubits. So that's already twenty bit number. So right now when we look into the problem of hey what's the problem with the algorithm today? Can I use a quantum computer to uh factor prime numbers? Universal quantum computers and Shor's algorithms are nowhere compared to uh quantum annealers. And with quantum annealers I can already um uh um do this with a twenty bit uh twenty bit numbers. So um there's uh three things really interesting so they they could run this on already existing hardware today. And all of those algorithm that's a really big take away um uh that you have to do this I don't have just one algorithm. I can run this on all the existing hardware today. One quantum problem that I want to solve. It's always a hybrid model of some classical computation and some quantum computation. I really use a classic computer what he's good at and a quantum computer what a quantum computer is uh um uh is good at. So um my point is quantum annealers are a thousand fold better right now than uh Shor's algorithm on universal quantum computers. But because they are too noisy right now we are far away from breaking anything that is uh in use in practical terms. Right now the biggest number is a twenty bit number. But obviously we we know uh those two are kind of like converging curves here. The algorithms are getting better and better. At the same time the quantum hardware gives me more and more qubits as well. So both of them will actually have a big impact. I can't just rely on my prediction saying hi the number of qubits grow by fifty percent every year so I'm going to be fine for the next fifty years. You're neglecting the improvements that the algorithms are doing. Uh this is really interesting. And this is a uh will make over the next uh over the next uh couple of years or two. So, a couple of uh myths and reality. Shor, nobody's gonna implement Shor on any quantum computer whatsoever. Um uh Shor was a theoretical work. There are practical work um uh you know derivations of this work that will be implemented. Um at some point obviously on the on the base of Shor's algorithms people will break um uh the RSA encryption. It is a matter of time. Now we can argue whether it's 10 years, 20 years, 50 years but we're only arguing about the time. We're not arguing even arguing about that it will happen. And obviously there's lots of cases where this is already has an impact right now. If I have bitcoins right now and if my public key is known I don't care whether it takes me 20 years to uh get the private key to those uh to those bitcoins. If I get in 20 years there's you know one and a half million bitcoins from Satoshi flying around which is around 12 billion dollars right now. Hey if someone comes to me and says hey Andreas you know can you can you build me a quantum computer? I say hey it's really hard it takes me 12 billion dollars you know. Hey here's 12 billion dollars right there. So um um so anyway uh it takes it will be quite a while but I want to provide an overview of the algorithms. I started this talk talking about hey just the asymmetric world of the RSA world but there's plenty of work and this is uh kind of you know from this Chinese paper in the very very end that's the that's the uh uh the end statement. There's plenty of work underway right now to use quantum annealers also to look into symmetric uh encryption. So if you say hey I just use symmetric encryption I'm fine. That may not be holding up for too long and I thank you very much I'm out of time. Thank you very much for your time. Do you have time for questions? We don't have time for questions. You can find me anywhere if you have some questions happy to engage with you. Thanks very much.