Rsa why prime numbers




















In calculations, we call these numbers p and q. You keep p and q private. Yes, you need to mind your Ps and Qs. Multiply p and q to get Let's call this value N — it's one of your public key numbers. Your second public number is a smaller one, which you can choose, and goes by the nickname e. Now publish N and e wherever you like — shout them from the rooftops if you want — but "you'd usually publish it on an online directory just like a telephone number", Professor Batten said.

Now I'm going to send you a message outlining how many bottles of beer are on the wall — 99, of course — but we don't want anyone else to know. Even if the message isn't a number, it can easily be represented as one; your phone or computer has made that conversion for you to read this article. I look you up on a directory and find your public key — your N and e — ,7. Then the calculations start. I raise my message to e it's an exponential, get it? In other words, I multiply 99 x 99 x 99 x 99 x 99 x 99 x 99 seven times and end up with a very large number.

It's more than 93 trillion. I then divide this massive number by your N The answer to this calculation is still pretty big ,,, Remember learning fractions and decimals? Divide a large number by a small number and you can end up with leftovers. For instance, 6 divided by 4 equals 1 with a remainder of 2. In our encryption example, the remainder is And it's this number that I send to you; that's our encrypted message. We don't care if it's intercepted, because only you can decipher it.

It's calculated based on your two original, secret prime numbers p and q and your public e. And now the numbers get even bigger. You take my message and multiply it by itself 23 times, ending up with a mammoth figure that's odd digits long. Then divide this new, monster number by N , the product of your original primes p and q and find the remainder. All up, you keep p , q and d secret; N and e are public.

There are, of course, online calculators that do all these sums for you. And in real encryption, you'd never choose simple prime numbers like 11 and 15 as p and q , Professor Batten explained.

The reason prime numbers are fundamental to RSA encryption is because when you multiply two together, the result is a number that can only be broken down into those primes and itself an 1. In our example, the only whole numbers you can multiply to get are 11 and 17, or and 1.

Now you only have to multipy those bruteforce until you get two numbers. Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. What makes RSA secure by using prime numbers? Ask Question. Asked 8 years, 1 month ago. Active 5 years, 5 months ago. Viewed 34k times.

Why couldn't they be any integers or odd integers? Or does that break the whole algorithm? Because prime numbers are rare in comparison to regular integers, does restricting the algorithm to only prime numbers reduce security? It would seem easier to find the private key if an attacker knows it's only going to be some prime number?

Improve this question. Joark Joark 1 1 gold badge 1 1 silver badge 4 4 bronze badges. If there are one or more small and easy to find factors, you could just have removed them before then they are meaningless for security, only make the numbers longer. RSA works by raising numbers to a large power and then finding the remainder when divided by a big number.

It's actually a little easier to understand in mathematical notation. We call our message m , our exponent e , and our big number N. To encode something using RSA, you find m e mod N.

Mod, short for modular , just means the remainder when you divide by N. M is so big that, depending on the sizes of m and e , the encrypted message m e might not be bigger than N, so it will be its own remainder mod N. So just fight the temptation to use millions-of-digits primes for RSA, at least for the time being.

It took academics two years to crack RSA, a digit number. And if you're wondering why all the big primes are Mersenne primes, check out my Slate article about it. The views expressed are those of the author s and are not necessarily those of Scientific American.

Follow Evelyn Lamb on Twitter. Already a subscriber?



0コメント

  • 1000 / 1000