Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.

# Prime Numbers Encryption

9 replies to this topic

### #1 joeyh

joeyh

• Members
• 9 posts
• OFFLINE
•
• Local time:12:56 PM

Posted 19 September 2016 - 05:15 PM

Hello All

Is it true the encryption works on the principle of 2 large prime numbers being multiplied by each other to give you a larger prime number?

Could someone explain in brief how this works if possible?

thanks

joe

### #2 MDD1963

MDD1963

• Members
• 699 posts
• OFFLINE
•
• Local time:08:56 PM

Posted 19 September 2016 - 05:44 PM

There are many, many hours of encryption/decryption theory available on Youtube, and, a truly enhanced understanding of encryption priciples is unlikely to occur after hearing a brief, "it is scrambled securely!" explanation without a thorough understanding of the higher level math involved.

Here's a link to some 13 + hours of lecture that is a brief introduction to cryptography! \

Enjoy!

Asus Z270A Prime/7700K/32 GB DDR4-3200/GTX1060

### #3 rp88

rp88

• Members
• 3,069 posts
• OFFLINE
•
• Gender:Not Telling
• Local time:11:56 AM

Posted 20 September 2016 - 01:20 PM

Yes it is true, for assymettric* encryption atleast. One of the best explanations I have seen was a little passage in a matkematics bok that took you through the process using small numbers (primes like 5 and 7), showed you what mathematical operations were performed from the creating of a publib/private key pair right through to the encryption and decryption processes. From memory, I read it years ago, the encyrpting and decrypting parts involve raising one number to another as a power, and then at some point the remainder of a division is found. Real encyrpion uses much bigger primes but similar mathematical steps. The underlying crucial fact is that multiplying two primes to get a product is dead easy, taking that product and working out the factorisations until you get back the two primes takes a lot of work. For 3x5=15 it's pretty easy either way. For 20 digit primes the multiplication is fast but the factorising would take years.

*The type generally used thesedays, where a different key is needed to encrypt than decrypt, so you can tell the world your public (to encrypt) key and keep secret your private (to decrypt) key, so anyone can encrypt a message to you but only you can read it.

Edited by rp88, 20 September 2016 - 01:21 PM.

Back on this site, for a while anyway, been so busy the last year.

My systems:2 laptops, intel i3 processors, windows 8.1 installed on the hard-drive and linux mint 17.3 MATE installed to USB

### #4 joeyh

joeyh
• Topic Starter

• Members
• 9 posts
• OFFLINE
•
• Local time:12:56 PM

Posted 20 September 2016 - 01:36 PM

Hello all many thanks for the responses so far. So I keep reading and being told that working back is the hard bit. The stuff that takes years. I know little about cryptography in terms of degree standards but know the basics. And I believe I have a system that is so simple it's stupid. Like seeing a magic trick and then when you know how it's done being disappointed at how easy it is.
Anyway any suggestions on who I speak to, to prove this?
Thanks
Joe

### #5 Didier Stevens

Didier Stevens

• 2,735 posts
• OFFLINE
•
• Gender:Male
• Local time:12:56 PM

Posted 24 September 2016 - 03:44 PM

Is it true the encryption works on the principle of 2 large prime numbers being multiplied by each other to give you a larger prime number?

Yes, but when you multiply 2 primes you don't get a prime.

SANS ISC Senior Handler
Microsoft MVP 2011-2016 Consumer Security, Windows Insider MVP 2016-2019

If you send me messages, per Bleeping Computer's Forum policy, I will not engage in a conversation, but try to answer your question in the relevant forum post. If you don't want this, don't send me messages.

Stevens' law: "As an online security discussion grows longer, the probability of a reference to BadUSB approaches 1.0"

### #6 rp88

rp88

• Members
• 3,069 posts
• OFFLINE
•
• Gender:Not Telling
• Local time:11:56 AM

Posted 04 October 2016 - 06:55 PM

Post #5 The product of two primes is not a prime, but it is a special number in the fact that it has only four numbers it can divide by they are: 1, the first prime, the second prime and itself. So other than the trivial solution of the big number factorising down to 1 and itself there is only a single pair of numbers that can multiply to give it, these two numbers, the primes are it's factors. Multiplying them to make the big special number is very quick and easy, getting them back starting only from knowing the big number is slow and hard. That is the underlying mathematical fact but to use it to construct a working algorithm to start with a number (as all digital data is in effect numbers), encrypt it with that big number (on which the public key is based) and then be able to decrypt using the two prime factors of the big number is something rather trickier, well beyond my understanding.
Back on this site, for a while anyway, been so busy the last year.

My systems:2 laptops, intel i3 processors, windows 8.1 installed on the hard-drive and linux mint 17.3 MATE installed to USB

### #7 Crazy Cat

Crazy Cat

• Members
• 808 posts
• OFFLINE
•
• Gender:Male
• Location:Lunatic Asylum
• Local time:11:56 PM

Posted 10 October 2016 - 05:30 PM

Prime Factorization Algorithms. http://mathworld.wolfram.com/PrimeFactorizationAlgorithms.html

Ebook: Prime Numbers: A Computational Perspective. http://thales.doa.fmph.uniba.sk/macaj/skola/teoriapoli/primes.pdf

Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. ― Albert Einstein ― Insanity is doing the same thing, over and over again, but expecting different results.

### #8 APipeOrganist

APipeOrganist

• Members
• 2 posts
• OFFLINE
•
• Local time:12:56 PM

Posted 07 November 2016 - 05:25 AM

25 612 115 28 615 513 14 77 15 78 412 39 48 611 26 210 115 512 64 68 34 31 710 411 41 57 412 13 411 67 77 612 34 39 24 15 11 611 68 315 25 414 15 77 24 710 35 612 713 67 57 311 414 76 115 35 215 511 66 56 115 76 310 25 35 31 64 611 18 25 512 611 14 612 51 11 73 77 24 15 412 12 72 54 513 21 41 15 23 13 713 412 411 78 67 410 115 71 11 34 37 77 612 41 611 64 412 24 35 13 115 23 510 512 67 115 11 77 414 13 614 57 311 12 613 411 711 15 78 64 51 13 72 411 33 115 35

This is a home made field cipher. Have a go...

### #9 APipeOrganist

APipeOrganist

• Members
• 2 posts
• OFFLINE
•
• Local time:12:56 PM

Posted 07 November 2016 - 05:28 AM

25 612 115 28 615 513 14 77 15 78 412 39 48 611 26 210 115 512 64 68 34 31 710 411 41 57 412 13 411 67 77 612 34 39 24 15 11 611 68 315 25 414 15 77 24 710 35 612 713 67 57 311 414 76 115 35 215 511 66 56 115 76 310 25 35 31 64 611 18 25 512 611 14 612 51 11 73 77 24 15 412 12 72 54 513 21 41 15 23 13 713 412 411 78 67 410 115 71 11 34 37 77 612 41 611 64 412 24 35 13 115 23 510 512 67 115 11 77 414 13 614 57 311 12 613 411 711 15 78 64 51 13 72 411 33 115 35

This is a home made field cipher. Have a go...
Whoops, posted twice...

### #10 Angoid

Angoid

• Security Colleague
• 299 posts
• OFFLINE
•
• Gender:Male
• Location:East Midlands UK
• Local time:12:56 PM

Posted 10 November 2016 - 05:26 AM

Just to add into the mix here (without having watched those 13 hours of videos beforehand so I don't know what he covers but probably pretty thorough) the idea is to have a mathematical function called a "trapdoor" function.

This is a function that is easy to perform one way, but nigh on impossible to reverse.

There are algorithms out there to speed up the factorisation process (see Crazy Cat's post above), but with 2048 bit RSA cryptography you're talking of numbers that are some 617 digits long when represented in decimal. It would take longer than the remaining life of the Universe to factorise N, where N is the 617-digit number produced when multiplying two large prime numbers P and Q together.

I can understand the mechanics behind RSA (it's actually not that difficult) but ECDH (Elliptic Curves Diffie Hellman) is another matter!

Helping a loved one through a mental health issue?  Remember ALGEE...

Assess the risk | Listen nonjudgementally | Give reassurance and info | Encourage professional help | Encourage self-help and support network

#### 0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users