![]() |
|
|
#144 |
|
Aug 2006
597910 Posts |
|
|
|
|
|
|
#145 |
|
Undefined
"The unspeakable one"
Jun 2006
My evil lair
2·11·283 Posts |
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".
|
|
|
|
|
|
#146 | |
|
May 2010
Prime hunting commission.
69016 Posts |
Quote:
|
|
|
|
|
|
|
#147 |
|
Aug 2006
10111010110112 Posts |
|
|
|
|
|
|
#148 |
|
Nov 2003
22×5×373 Posts |
|
|
|
|
|
|
#149 |
|
Aug 2006
3×1,993 Posts |
|
|
|
|
|
|
#150 |
|
Tribal Bullet
Oct 2004
3·1,181 Posts |
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.
|
|
|
|
|
|
#151 | |
|
May 2010
Prime hunting commission.
110100100002 Posts |
Quote:
|
|
|
|
|
|
|
#152 |
|
May 2010
Prime hunting commission.
24·3·5·7 Posts |
Now that I know a bit of PARI, maybe I should attempt coding my test methods?
|
|
|
|
|
|
#153 |
|
Aug 2006
175B16 Posts |
Sure, go for it.
|
|
|
|
|
|
#154 |
|
May 2010
Prime hunting commission.
24·3·5·7 Posts |
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
};
For a composite that passes the trial division: 16 ms.
Last fiddled with by 3.14159 on 2010-07-22 at 00:51 |
|
|
|
![]() |
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 |