# Introduction of Cipher Security - Find Large Prime Number

For security of our cryptosystems, we will need to choose a large random prime number (secret keys) efficiently.

Les's assume we need a prime number which is 1000bits.

Before choosing prime numbers, we need to find an algorithm to check a number whether is prime numbers or not, so we use the algorithm that called Theorem(Euler/Fermat Theorem), let me introduce the theory.

I will introduce a notation firstly, Φ(n) means to find the number of prime numbers which are less than n, for example:

Φ(5) = {1,2,3,4} = 5

Φ(8) = {1,2,3,4,5,6,7}  --> {1,3,5,7} = 4

BTW, for any prime number Φ(n) = n - 1

And then we have: for any prime number p,q, and n = p*q then

Φ(n) = Φ（p*q）=  (p-1) * (q-1) = p*q-(p+q-1)

For example,

p = 3, q = 7

n = 21

not (Φ(3} and Φ(12)) = {0,0,3,6,7,9,14,15,18}

Φ(3) and Φ(12) = {1,2,4,5,8,10,11,13,16,17,19,20} = 12

Φ(n) = Φ((3-1)*(7-1)) = 12

Then, Let me introduce the theory.

- Theorem(Euler/Fermat Theorem): if M and n are relatively prime integers then and y(mod Φ(n)) = 1 for M < n then M^(Φ(n)) mod n = 1.

Consequently, we have:

- M^(Φ(n)) mod n = M(Φ(n))*M mod n = 1* M mod n = M

- if y mod(mod Φ(n)) = 1, i.e y = Φ(n) * k + 1 for interget k then

- M^y mod n = M^(Φ(n)*k+1) mod n = (M^(Φ(n)))^k * M mod n = 1^k * M ^1 mod n = M

For conclusion, we have: M^(Φ(n)) mod n = 1(If M and n are relatively prime number)

(That's important, because that's the algorithem we use to test large random prime number)

Then, the question becomes easier, the way we choose a large prime number is choosing a random number (P). We assume that p is a prime number, and choose multiple numbers to confirm with our assuming by implementing the algorithm (Theorem).

If for all we have a^(p-1) mod p = 1, which means the number p is a prime number.

Does it very hard to get a large prime number?

Actually, the probability of a random number is a prime number is 1/(ln(2)*L) ≈ 1/(0.693*L) ≈ 1/693

(L is the bits of a prime number we need, in there the L is 1000 because we need 1000bits prime number)

That's all how we generate a  large prime number for cipher security.

03-04 398
11-18 1614
08-22 94
01-14 1623
10-28 2635
06-26 144
03-26 2481
02-19 657
10-29 5592
03-26 1559
07-25 673
04-24 2244
08-17 164
08-12 3328
06-11 5329

### “相关推荐”对你有帮助么？

•  非常没帮助
•  没帮助
•  一般
•  有帮助
•  非常有帮助 被折叠的  条评论 为什么被折叠? 到【灌水乐园】发言   qq_40831558

¥2 ¥4 ¥6 ¥10 ¥20  余额支付 (余额：-- )  扫码支付 获取中  扫码支付 点击重新获取   扫码支付 1.余额是钱包充值的虚拟货币，按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载，可以购买VIP、C币套餐、付费专栏及课程。 余额充值