![]() |
[QUOTE=3.14159;222077]How about if you generate via PARI? Is it equally weak as the internet generator?[/QUOTE]
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). |
[QUOTE=3.14159;222077]How about if you generate via PARI? Is it equally weak as the internet generator?[/QUOTE]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".
|
[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".[/QUOTE]
.. Alternatively, an Internet search + Some reading on the subject via the internet. |
[QUOTE=3.14159;222098].. Alternatively, an Internet search + Some reading on the subject via the internet.[/QUOTE]
That will suffice to tell you the details, but I hope you don't write a cryptosystem on that basis!:smile: |
[QUOTE=CRGreathouse;222081]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).[/QUOTE]
If speed is not a requirement, then use BBS. |
[QUOTE=R.D. Silverman;222121]If speed is not a requirement, then use BBS.[/QUOTE]
You mean instead of a LFSR? Yes, Blum Blum Shub is much more suitable to crypto (i.e., actually has value). |
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 [url="http://csrc.nist.gov/publications/nistpubs/800-90/SP800-90revised_March2007.pdf"]here[/url]. There's also been a lot of research into building a good entropy source when all you have is software, [url="http://www.cypherpunks.to/~peter/06_random.pdf"]this[/url] is an excellent introduction.
|
[QUOTE]That will suffice to tell you the details, but I hope you don't write a cryptosystem on that basis![/QUOTE]
Here's a bunny with a pancake on its head: :oolong: |
Coding my test??
Now that I know a bit of PARI, maybe I should attempt coding my test methods?
|
Sure, go for it.
|
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 }; [/code] Timings: For a composite that passes the trial division: 16 ms. :smile: |
| All times are UTC. The time now is 22:06. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.