News for hackers. Stuff that matters.
Re:Socat: “the hard coded 1024 bit DH p parameter was not pr... by schoen on Monday February 01, 2016 @02:48PM (#11014806)
> We have efficient provable tests for that: they tell you if p is prime or not and nothing else.

I think this is a typo -- the efficient general-form tests are probable rather than provable.

https://en.wikipedia.org/wiki/Primality_test#Probabilistic_t...

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.
Re:Socat: “the hard coded 1024 bit DH p parameter was not pr... by bjornsing on Monday February 01, 2016 @03:21PM (#11015083)
From your own reference (https://en.wikipedia.org/wiki/Primality_test#Probabilistic_t...): "the usual randomized primality tests never report a prime number as composite".

So I'd say that's probably what happened here (i.e p was reported composite by a randomized primality test and that would never have happened had it been prime).

Re:Socat: “the hard coded 1024 bit DH p parameter was not pr... by schoen on Monday February 01, 2016 @03:36PM (#11015179)
Oh sure, I don't mean that there's uncertainty that this number is composite, just that in a formal sense there isn't "proof" that other numbers that passed, say, openssl -checks 100000 are prime. But I wouldn't consider it unsafe to use them for cryptography.

The comment I was replying to referred to tests that "tell you if a number is prime or not", and the probable ones don't exactly always do that. :-)

Re:Socat: “the hard coded 1024 bit DH p parameter was not pr... by eutectic on Monday February 01, 2016 @03:16PM (#11015048)
They can provably tell you that a number is composite.
Re:Socat: “the hard coded 1024 bit DH p parameter was not pr... by Filligree on Monday February 01, 2016 @02:49PM (#11014811)
Keep up the tests until you have ten or twenty nines of certainty. I'd call that proof.
Re:Socat: “the hard coded 1024 bit DH p parameter was not pr... by baby on Monday February 01, 2016 @03:37PM (#11015192)
then you should re-read the definition of a proof.
Re:Socat: “the hard coded 1024 bit DH p parameter was not pr... by jibalt on Wednesday February 03, 2016 @02:25PM (#11028952)
It's clear that you haven't read it at all:

http://www.merriam-webster.com/dictionary/proof

The fact of the matter is that the sort of Platonic definition of proof that you fantasize is impossible because it depends on certainty, which itself cannot be proven. The best we can do is fail to find an error in an alleged proof.

Consider the proofreader's paradox: A proofreader can be prepared to swear, for any given page of a 1000 page book, that there are no typos on that page, but no proofreader is so foolish as to claim that there are no typos in the book.

Re:Socat: “the hard coded 1024 bit DH p parameter was not pr... by Filligree on Monday February 01, 2016 @07:59PM (#11016993)
What more are you hoping for?

Given a mathematical proof, the chance of an error in the proof is vastly larger than 10^-20.