lazy_rsa 0.3.7 → 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lazy_rsa.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cccc75263a2e8af28c8ca5611c1bb50482f96c1abf8a3df05829692527318597
|
4
|
+
data.tar.gz: 9d366feaff5efac3686308152de46eaadb9053ab6950ee77a1a412402e0471be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ba51891aae0d13c0795c3ff036e6fb9a1ecec913aed70b6d932252ce1b02f46b5f563d421884b9c7cccadd2e7e28fa51bf4481b7c0fa8c5214c944451846e620
|
7
|
+
data.tar.gz: 3c75a367345f92b65701b6393a5667610e215240e109148bcd52b2286a62ee15874a6a03c9274508a64b73f4ed679f5a70e2abd0eb5d45629241c6713194ff82
|
data/lib/lazy_rsa.rb
CHANGED
@@ -22,10 +22,10 @@ module LazyRsa
|
|
22
22
|
loop do
|
23
23
|
p = OpenSSL::BN.generate_prime(512)
|
24
24
|
phi = (p - 1) * (q - 1)
|
25
|
-
|
25
|
+
e = p.mod_exp(SECURE_EXPONENT, SECURE_MODULUS)
|
26
|
+
break if e.gcd(phi) == 1
|
26
27
|
end
|
27
28
|
n = p * q
|
28
|
-
e = p.mod_exp(SECURE_EXPONENT, SECURE_MODULUS)
|
29
29
|
d = e.mod_inverse(phi)
|
30
30
|
|
31
31
|
build_key(e:, d:, n:)
|