Questions tagged [prime-numbers]

A prime number is an integer greater than 1 with no divisors other than itself and 1. Primes and prime products play an important role in public key cryptography.

A prime number is an integer greater than 1 with no divisors other than itself and 1. Primes and prime products play an important role in public key cryptography.

385 questions
14
votes
3 answers

Why does GMP only run Miller-Rabin test twice when generating a prime?

In mpz_nextprime(), after some sieving with small primes, an MR test function is called, with the number of trials set to 25 (https://github.com/alisw/GMP/blob/master/mpz/nextprime.c#L118): if (mpz_millerrabin (p, 25)) goto done; But…
fjarri
  • 289
  • 1
  • 6
10
votes
4 answers

What is the use of Mersenne Primes in cryptography

There is an international search for Mersenne Primes. The project is huge. But what is the use of Mersenne Primes in cryptography? Do they have any other properties other than the $2^n-1$ form?
MikhailTal
  • 209
  • 2
  • 4
8
votes
1 answer

Algorithm to find primes $q$ and $p$ with $q\, |\, p - 1$?

I understand that if $p$ is prime then $p-1$ must be composite (at least divisible by $2$ as it is even). But how does an algorithm find a prime $q$ such that $q \cdot r = p - 1$. I thought prime factorisation is such a hard problem?
Linus
  • 279
  • 1
  • 8
6
votes
1 answer

How does Python's pycrypto library generate primes?

The pycrypto library in Python can generate random n-bit prime numbers. The syntax I use is as follows: from Crypto.Util import number number.getPrime(2048) The above function has a very impressive performance and returns primes with a very small…
Tabish Mir
  • 258
  • 2
  • 13
5
votes
0 answers

Average false-positive rate for a round of Miller–Rabin

I'm aware that the Miller–Rabin primality test will claim primality for a composite number with at most a $\frac{1}{4}$ probability for some arbitrary, odd composite $n$ and a random witness $a$ chosen uniformly in the range $[2,n-1)$. What is the…
forest
  • 15,253
  • 2
  • 48
  • 103
4
votes
1 answer

How big are the primes used in modern cryptography?

I know that this depends on which techniques you're using, but roughly speaking, when modern cryptography makes use of so-called "large prime numbers", how large (in bits or digits) are these primes typically?
Tac-Tics
  • 143
  • 1
  • 4
4
votes
1 answer

Probability that n is prime such that n fails the Miller-Rabin test N times

I'm working through An Introduction to Mathematical Cryptography and one of the exercises asks Suppose that we run the Miller–Rabin test N times on the integer n and that it fails to prove that n is composite. Show that the probability that n is…
Case
  • 43
  • 3
3
votes
1 answer

Why are huge prime numbers important in cryptography?

I read an article the other day about the search for prime numbers. According to the article and several online sources the biggest prime number is over 17 million digits! This made me wonder why anyone would want a prime number that big. The…
java
  • 139
  • 2
2
votes
1 answer

why AKS is so slow in practice?

This note (http://maths-people.anu.edu.au/~brent/pd/primality4.pdf) states that AKS is not practical. However, it is known that AKS runs in polynomial-time, and I cannot understand where the slowness of AKS algorithm comes from? Brent, on the above…
Faith
  • 445
  • 6
  • 11
2
votes
1 answer

AugPake implementation Doubt K computation

try to implement the AugPake protocol in java using BigInteger. I am having some difficulty computing $K=Y^z \mod p$ because $z$ is always $0$, for $z={1\over x+(w*r)} \mod q$. Being a ratio between $1$ and a very large number $z$ will be always…
Marco
  • 21
  • 2
2
votes
1 answer

Largest number that could be factored in milli seconds

Considering a home pc/laptop as machine used (Say typical 2.4 GHz, 16GB RAM, 4 core processor) for running any factorization algorithm. What would be the largest number that could be factored into its prime factors in milli seconds ? rather how many…
sashank
  • 6,174
  • 4
  • 32
  • 67
2
votes
1 answer

How can I evaluate the congruency of an AKS primality test?

Despite the fact primality test is a mathematical issue, it plays a part on the security of many cryptosystems such as RSA. I was trying to understand how it works until I came to the following congruency: 〖(X+a)〗^p≡X^p+a (mod X^r-1,p) The above…
BoFatom
  • 171
  • 2
1
vote
0 answers

Question about using residue number system for repeated multiplications

I understand that when you are using RNS you need a co-prime moduli-set e.g. ${\{m_1, m_2, m_3\}}$, and the dynamic range is the product of each modulus in that set $M = m_1.m_2.m_3$. Also it's advantageous to select modulus values that are…
bsdevlin
  • 85
  • 6
1
vote
1 answer

How to formally say that the integers modulo $p$ for a prime $p$ gives results that are "more random" than for a composite $n$?

I'm doing a presentation on cryptography for non-experts. My main algorithm of the presentation is the Diffie Hellman key exchange. It uses modulo arithmetic for a prime $p$. During my presentation, I'd like to be able to explain why the modulo…
1
vote
0 answers

Algorithms to test vs. generate primes

What would be the value in having a true prime number generator algorithm instead of a prime number test algorithm? Also, if such a thing existed, what would be the impact on not only cryptography?
Ben
  • 11
  • 1
1
2