lazy_rsa 0.3.5 → 0.3.7
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 +4 -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: d82c509b57e993bf749370f60576fd0ca67065bd42872470e50e581aa5ed4054
|
4
|
+
data.tar.gz: d66fd6952a570c28a5b35a203036e839e8afaee03d659d18df06785c6d55252c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c61af315c46dae91905a437c16f2c70c265a018ff5fe93c2d78899f5924c020477ab2da3be347a96125821de8c03edc93f3f0ea150bda7fa471c954bdb048bd
|
7
|
+
data.tar.gz: c079c3ce8a79ae3404b9cd00b0fed0bb65d29832d5b6bdf3fa59639989376c0b0470a6d407f05116ea1657f7a3ab670f23bbe0fde383540e34e62107d459be07
|
data/lib/lazy_rsa.rb
CHANGED
@@ -16,11 +16,13 @@ module LazyRsa
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def generate_key
|
19
|
+
p = 0
|
19
20
|
q = OpenSSL::BN.generate_prime(512)
|
20
|
-
phi =
|
21
|
-
|
21
|
+
phi = 0
|
22
|
+
loop do
|
22
23
|
p = OpenSSL::BN.generate_prime(512)
|
23
24
|
phi = (p - 1) * (q - 1)
|
25
|
+
break if q.gcd(phi) == 1
|
24
26
|
end
|
25
27
|
n = p * q
|
26
28
|
e = p.mod_exp(SECURE_EXPONENT, SECURE_MODULUS)
|