Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I'm a bit mathematically challenged and have been working on the RSA cipher (good start). I can find the public and private keys and know how to work do modulo operations on a calculator. The problem is that I can't do them when the numbers get to high. For example say I have:
10^541 mod 2923 = C
The numbers involved here become very large and don't display fully on a calculator, if it can even handle the numbers (mine is crap). What I am wondering is if there is a better method to work out the ciphertext or plaintext that will work for largish numbers.
I think http://math.stackexchange.com would be a better place for this question.
But, essentially, don't save the mod for the end. Break the exponentiation up into many smaller operations with mod after each one.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
As the title says, is it possible?
No, this isn’t possible. There are several ways you can encode “the set of all prime numbers” as a language, and the standard ways of doing so (writing the number out in binary, writing out a number of tally marks equal to the number, etc.) aren’t regular.
Formally proving this is a bit tricky but is doable using either the pumping lemma for regular languages or the Myhill-Nerode theorem. The crux of the arguments boil down to the fact that replicating parts of prime numbers repeatedly will eventually give you a non-prime number, and that’s where the technical details of the proofs come in.
Hope this helps!
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I was doing RSA private key decrypt,but this big number always give me infinite or NaN,how to calculate it programmably?
Big integers are not primitives in most programming language, but many of them have a BigInt or BigInteger class.
Usually, there are specialized implementation for speeding up that power/modulus operation, rather than a simplistic implementation.
You have to specify the desired programming language for suggesting a complete bit integer library.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 5 years ago.
Improve this question
So yeah, different modulus(n), same exponent(e), different encrypted messages(C). Can I do anything with that to find the original messages(M) ? Thank you !
Sure. You can factor the modulus, altho for real world RSA keys, that's not gonna be very practical.
More seriously, 99% of all RSA keys use 65537 as the exponent. If a common public exponent were a weakness 99% of all RSA applications would be vulnerable.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I heard this a lot when talking about software engineering and abstract data types, what does this do? Can anyone give me a concrete example of this concept?
A representation invariant is a condition concerning the state of an object. The condition can always be assumed to be true for a given object, and operations are required not to violate it.
In a Deck class, a representation invariant might be that there are always 52 Cards in the deck. A shuffle() operation is thus guaranteed not to drop any cards on the floor. Which in turn means that someone calling shuffle(), or indeed any other operation, does not need to check the number of cards before and after: they are guaranteed that it will always be 52.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I had read someone's blog that the high precision random number is hard to get, he said if we want to get a chance in a million, using :
Random(1,1000)*Random(1,1000) < 2 is better than Random(1,1000000)<2
( we suppose Random(1,n) generate integer numbers between 1 to n )
theoretically, the probilities of two are the same, but what's different action of those expression in a real program? for example rand() function in standard C language, and please give more information.
What you probably want by asking for 'high-precision' is a cryptographically secure pseudorandom number generator, that is, one with a high enough entropy that it's certifiably random enough for high security applications. LavaRnd is one of these, if you provide it with a lens capped webcam (ideally a webcam in a box completely devoid of light) for input.
Another cryptographically sound algorithm is Blum-Blum-Shub, but it's very slow. You could also take a look at Fortuna.