Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Finding prime factors to large numbers using specially-crafted CPUs

My understanding is that many public key cryptographic algorithms these days depend on large prime numbers to make up the keys, and it is the difficulty in factoring the product of two primes that makes the encryption hard to break. It is also my understanding that one of the reasons that factoring such large numbers is so difficult, is that the sheer size of the numbers used means that no CPU can efficiently operate on the numbers, since our minuscule 32 and 64 bit CPUs are no match for 1024, 2048 or even 4096 bit numbers. Specialized Big Integer math libraries must be used in order to process those numbers, and those libraries are inherently slow since a CPU can only hold (and process) small chunks (like 32 or 64 bits) at one time.

So...

Why can't you build a highly specialized custom chip with 2048 bit registers, and giant arithmetic circuits, much in the same way that we scaled from 8 to 16 to 32 to 64-bit CPUs, just build one a LOT larger? This chip wouldn't need most of the circuitry on conventional CPUs, after all it wouldn't need to handle things like virtual memory, multithreading or I/O. It wouldn't even need to be a general-purpose processor supporting stored instructions. Just the bare minimum to perform the necessary arithmetical calculations on ginormous numbers.

I don't know a whole lot about IC design, but I do remember learning about how logic gates work, how to build a half adder, full adder, then link together a bunch of adders to do multi-bit arithmetic. Just scale up. A lot.

Now, I'm fairly certain that there is a very good reason (or 17) that the above won't work (since otherwise one of the many people smarter than I am would have already done it) but I am interested in knowing why it won't work.

(Note: This question may need some re-working, as I'm not even sure yet if the question makes sense)

like image 927
Adam Batkin Avatar asked Jul 30 '09 12:07

Adam Batkin


People also ask

How do you find the prime factors of large numbers?

To calculate the factors of large numbers, divide the numbers with the least prime number, i.e. 2. If the number is not divisible by 2, move to the next prime numbers, i.e. 3 and so on until 1 is reached. Below is an example to find the factors of a large number.

Is there an algorithm for prime factorization?

Algorithm for Prime FactorizationThe simplest algorithm to find the prime-factor is by repeatedly dividing the number with the prime factor until the number becomes 1. Thus 100 divided by 2 become 50. Now our number becomes 50.

How do you find the prime factorization of a large number in C++?

For this, we will find check the frequency of 2 as a factor and divide the number by 2. Then check from 3 to square root n. divide and increase the frequency of each prime number that is a factor of the number. And stop if the number becomes 1.

What is the shortcut to find the prime factor of a number?

If the sum of the odd-positioned digits, subtracted from the sum of the even-positioned digits, is divisible by 11, then the number is divisible by 11 (for example, in 132 you have 1+2-3=0 and 132=11×12). If a number has no factors, other than 1, that are less than or equal to its square root, then the number is prime.


2 Answers

What @cube said, and the fact that a giant arithmetic logic unit would take more time for the logic signals to stabilize, and include other complications in digital design. Digital logic design includes something that you take for granted in software, namely that signals through combinational logic take a small but nonzero time to propagate and settle. A 32x32 multiplier needs to be designed carefully. A 1024x1024 multiplier would not only take a huge amount of physical resources in a chip, but it also would be slower than a 32x32 multiplier (though perhaps faster than a 32x32 multiplier computing all the partial products needed to perform a 1024x1024 multiply). Plus it's not only the multiplier that's the bottleneck: you've got memory pathways. You'd have to spend a bunch of time gathering the 1024 bits from a memory circuit that's only 32 bits wide, and storing the resulting 2048 bits back into the memory circuit.

Almost certainly it's better to get a bunch of "conventional" 32-bit or 64-bit systems working in parallel: you get the speedup w/o the hardware design complexity.

edit: if anyone has ACM access (I don't), perhaps take a look at this paper to see what it says.

like image 93
Jason S Avatar answered Sep 21 '22 13:09

Jason S


Its because this speedup would be only in O(n), but the complexity of factoring the number is something like O(2^n) (with respect to the number of bits). So if you made this überprocessor and factorized the numbers 1000 times faster, I would only have to make the numbers 10 bits larger and we would be back on the start again.

like image 34
cube Avatar answered Sep 18 '22 13:09

cube