 So, earlier we had Alice set up a RSA system with public modulus N equal 21,829, and public encryption key E equals 37. What's important is she tells no one that our factorization of 21,829 is 83 times 263, and that our decryption key is 11,613. And so this means that she can decrypt a message C by evaluating C raised to power 11,613 mod 21,829. However, this takes a lot of computational power. Is there any way we can improve the efficiency? And in fact there is. The standard approach to improving the efficiency relies on the Chinese remainder theorem. And one version of that is that suppose P and Q are relatively prime, then X is congruent to A mod their product PQ if and only if X is congruent to A mod P, X is congruent to A mod Q. Since she knows the factorization of N, she can use this to speed the decryption process. So, let's see how that works. So Bob sends Alice A message, and he encrypts this message as C equals 17,639. So since Alice knows the decryption exponent, she can decrypt it by finding 17,639 to power 11,613. But Alice knows the factorization of the modulus. So she can apply the Chinese remainder theorem, and she can solve the system of congruences M equals 17,639 to power 11,613 mod 83 and M congruent to 17,639 to power 11,613 mod 263. Now you might look at that and say we haven't actually made this problem any easier. I mean before we only had to calculate 17,639 to power 11,613 once to take the answer mod 21,819. Now we have to do it twice. But the important thing here is that remember, working mod N means you can always work with numbers less than N. So we don't have to work with these big numbers, we can work with much smaller numbers. So let's take a closer look at that first congruent, M congruent to 17,639 to power 11,613 mod 83. So the first thing we note is that 17,639 is congruent to 43 mod 83. So we don't have to work with this big number, we can work with a much smaller number, 43. The other thing to remember is that if long as A and N are relatively prime, A to power phi of N is congruent to 1 mod N. And what this means is that we can reduce this exponent mod phi of N. Now since 83 actually is prime, phi of 83 is 82, and so our exponent 11,613 can be reduced mod phi of 83 to 51. And now we just need to evaluate 43 to power 51 mod 83, and that works out to be 58. And so this first horrifying congruence becomes the much easier congruence, M congruent to 58 mod 83. And by the same logic, this second congruence, well the base, is congruent to 18 mod 263. Again 263 is prime, so phi of 263 is 262, and our exponent is going to be congruent to 85 mod phi of 263. And so this horrifying expression, the base gets reduced to 18, the exponent gets reduced to 85, and we can calculate this much more easily as 44 mod 263. Now we solve the congruence. For reasons that will become apparent in a second, we'll actually want to start with the congruence with the larger modulus. So from M congruent to 44 mod 263, we know that M is a multiple of 263 plus 44. Now we drop that into the second congruence, M congruent to 58 mod 83. And here we see the advantage of starting with the larger congruence. This coefficient of X is larger than the modulus, so we can reduce this equation. And then we can reduce our equation to 14X congruent to 14 mod 83. And after giving this a tremendous amount of thought, we find that we have solution X equal to 1. It won't always be this easy, sometimes we'll need to find the multiplicative inverse, but in general we have to solve this linear congruence at the end. Now we found X equals 1, so we know that M is 263 times 1 plus 44, or 307.