mersenneforum.org  

Go Back   mersenneforum.org > Extra Stuff > Miscellaneous Math

Reply
 
Thread Tools
Old 2010-07-20, 13:00   #144
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

597910 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
How about if you generate via PARI? Is it equally weak as the internet generator?
I don't know of an attack on that particular implementation, but it's a linear feedback shift register, which has known vulnerabilities (e.g., the Berlekamp-Massey algorithm).
CRGreathouse is offline   Reply With Quote
Old 2010-07-20, 13:21   #145
retina
Undefined
 
retina's Avatar
 
"The unspeakable one"
Jun 2006
My evil lair

2·11·283 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
How about if you generate via PARI? Is it equally weak as the internet generator?
LFSRs are not cryptographically secure. Simple as that. If you want the primes for crypto work then the entire generating chain must be cryptographically secure. No shortcuts allowed. But the devil is in the details. Making good crypto is very hard. I suggest you buy a few books, I recommend this one: Bruce Schneier's "Practical Cryptography".
retina is online now   Reply With Quote
Old 2010-07-20, 15:20   #146
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

69016 Posts
Default

Quote:
But the devil is in the details. Making good crypto is very hard. I suggest you buy a few books, I recommend this one: Bruce Schneier's "Practical Cryptography".
.. Alternatively, an Internet search + Some reading on the subject via the internet.
3.14159 is offline   Reply With Quote
Old 2010-07-20, 15:50   #147
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

10111010110112 Posts
Default

Quote:
Originally Posted by 3.14159 View Post
.. Alternatively, an Internet search + Some reading on the subject via the internet.
That will suffice to tell you the details, but I hope you don't write a cryptosystem on that basis!
CRGreathouse is offline   Reply With Quote
Old 2010-07-20, 16:25   #148
R.D. Silverman
 
R.D. Silverman's Avatar
 
Nov 2003

22×5×373 Posts
Default

Quote:
Originally Posted by CRGreathouse View Post
I don't know of an attack on that particular implementation, but it's a linear feedback shift register, which has known vulnerabilities (e.g., the Berlekamp-Massey algorithm).
If speed is not a requirement, then use BBS.
R.D. Silverman is offline   Reply With Quote
Old 2010-07-20, 18:12   #149
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

3×1,993 Posts
Default

Quote:
Originally Posted by R.D. Silverman View Post
If speed is not a requirement, then use BBS.
You mean instead of a LFSR? Yes, Blum Blum Shub is much more suitable to crypto (i.e., actually has value).
CRGreathouse is offline   Reply With Quote
Old 2010-07-21, 11:06   #150
jasonp
Tribal Bullet
 
jasonp's Avatar
 
Oct 2004

3·1,181 Posts
Default

There are many ways to build a cryptographically secure random number generator, assuming you have a good cryptographic primitive and a source that can supply sufficient entropy to seed it every so often. See NIST Special Publication 800-90 here. There's also been a lot of research into building a good entropy source when all you have is software, this is an excellent introduction.
jasonp is offline   Reply With Quote
Old 2010-07-21, 19:04   #151
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

110100100002 Posts
Default

Quote:
That will suffice to tell you the details, but I hope you don't write a cryptosystem on that basis!
Here's a bunny with a pancake on its head:

3.14159 is offline   Reply With Quote
Old 2010-07-21, 20:23   #152
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24·3·5·7 Posts
Default Coding my test??

Now that I know a bit of PARI, maybe I should attempt coding my test methods?
3.14159 is offline   Reply With Quote
Old 2010-07-21, 23:37   #153
CRGreathouse
 
CRGreathouse's Avatar
 
Aug 2006

175B16 Posts
Default

Sure, go for it.
CRGreathouse is offline   Reply With Quote
Old 2010-07-22, 00:49   #154
3.14159
 
3.14159's Avatar
 
May 2010
Prime hunting commission.

24·3·5·7 Posts
Default

Alright: Here we go:

It works:
Code:
isSPRP(n,b=2) = {
forprime(p=2, nextprime(10^6),
if(n%p==0,return(p))
);
my(s=valuation(n-1,2),d=n>>s);
n = Mod(b, n)^d;
if (n == 1, return(n));
while(s--,
if (n == -1, return(n));
n = n^2;
);
n == -1
};
Timings:
For a composite that passes the trial division: 16 ms.

Last fiddled with by 3.14159 on 2010-07-22 at 00:51
3.14159 is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Wheel Factorization a1call Factoring 11 2017-06-19 14:04
Efficient Test paulunderwood Computer Science & Computational Number Theory 5 2017-06-09 14:02
LL tests more credit-efficient than P-1? ixfd64 Software 3 2011-02-20 16:24
A Wheel storm5510 Puzzles 7 2010-06-25 10:29
Most efficient way to LL hj47 Software 11 2009-01-29 00:45

All times are UTC. The time now is 14:50.


Fri Aug 6 14:50:53 UTC 2021 up 14 days, 9:19, 1 user, load averages: 3.00, 2.88, 2.84

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.