News for hackers. Stuff that matters.
Re:Socat: “the hard coded 1024 bit DH p parameter was not pr... by openasocket on Monday February 01, 2016 @02:50PM (#11014822)
There are exact tests that run in polynomial time, like https://en.wikipedia.org/wiki/AKS_primality_test
Re:Socat: “the hard coded 1024 bit DH p parameter was not pr... by schoen on Monday February 01, 2016 @03:06PM (#11014974)
I hate to say that a polynomial-time test isn't efficient because many people use that as the very definition of efficient, but my understanding is that AKS is incredibly impractical because the polynomial is ginormous, even though its asymptotic behavior is nice. So if you actually wanted to know if, say, a 1024-bit number was definitely prime, you wouldn't be able to run AKS on it in a "reasonable time" on a real computer.
Re:Socat: “the hard coded 1024 bit DH p parameter was not pr... by baby on Monday February 01, 2016 @03:11PM (#11015007)
I haven't actually studied to what extent the AKS tests are do-able. I always figured there would be no problem running one for a 1024 bits prime. Found this on SO: http://cs.stackexchange.com/questions/23260/when-is-the-aks-...

Also, to further the discussion on probable vs provable: the probable tests are enough in our case because they tell us _provably_ if an integer is not a prime (that we care), but _probably_ if an integer is a prime (which we don't care here).

Re:Socat: “the hard coded 1024 bit DH p parameter was not pr... by taejo on Tuesday February 02, 2016 @03:59AM (#11018352)
This is not conclusive, but the best deterministic primality test (an AKS variant by Pomerance and Lenstra) is 6th power. 1024^6 is quite large.
Re:Socat: “the hard coded 1024 bit DH p parameter was not pr... by zitterbewegung on Monday February 01, 2016 @03:05PM (#11014964)
Just because there are exact tests doesn't make the AKS primarily test usable in the real world because of constant factors . Using Fermats little theorem for primality testing is fine because the probably of encountering a Carmichael number is very low.
Re:Socat: “the hard coded 1024 bit DH p parameter was not pr... by openasocket on Monday February 01, 2016 @03:34PM (#11015172)
You're right, AKS is not a very efficient algorithm and randomized tests are generally good enough. But, there are exact tests which do run fast in practice, such as ECPP. Here's some of the largest primes found using ECPP: http://primes.utm.edu/top20/page.php?id=27

Note the largest there is 30,950 digits, which is about 102,813 bits unless I did my math wrong, so I bet it is usable for 1024-bit numbers. Non-exact methods are much much faster of course, but when you really really need exactness it is an option.

Re:Socat: “the hard coded 1024 bit DH p parameter was not pr... by schoen on Monday February 01, 2016 @03:46PM (#11015273)
That does seem pretty efficient for numbers of this size; thanks for the example!
Re:Socat: “the hard coded 1024 bit DH p parameter was not pr... by jcoffland on Monday February 01, 2016 @04:02PM (#11015412)
Seems like a Carmichael number could be a good choice for an attacker. This would make your chances of encountering a Carmichael number quite high. You have to consider who's choosing the number. Or do I have it wrong?
Re:Socat: “the hard coded 1024 bit DH p parameter was not pr... by pbsd on Monday February 01, 2016 @04:09PM (#11015462)
Only the simple Fermat tests are vulnerable to Carmichael numbers. The test which is used in practice, Rabin-Miller, is not vulnerable to them. In fact, if you assume the extended Riemann hypothesis is true, (log n)^2 iterations of Rabin-Miller are sufficient to prove primality.
Re:Socat: “the hard coded 1024 bit DH p parameter was not pr... by schoen on Monday February 01, 2016 @04:19PM (#11015551)
How efficient might this be compared to other approaches for searching for Riemann hypothesis counterexamples? Is there a one-to-one relationship between direct Riemann counterexamples and composite numbers that pass (log n)² Rabin-Miller tests?
Re:Socat: “the hard coded 1024 bit DH p parameter was not pr... by pbsd on Monday February 01, 2016 @04:59PM (#11015850)
I am not familiar with all the ways the GRH can be disproven, but Miller-Rabin doesn't strike me as the most efficient, with its running time of O((log n)^4) for each attempt. I am not sufficiently competent to say whether a GRH counterexample also directly results in a MR counterexample.
Re:Socat: “the hard coded 1024 bit DH p parameter was not pr... by gchpaco on Monday February 01, 2016 @04:20PM (#11015557)
In addition to what pbsd said, Carmichael numbers are incredibly rare. Your odds of stumbling across one by chance are lower than the odds of a cosmic ray flipping the bit of memory that causes you to believe you have stumbled across one, as I recall.