diff options
Diffstat (limited to 'q8/rsa.cpp')
-rw-r--r-- | q8/rsa.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -47,10 +47,10 @@ int main() { | |||
47 | cin.getline(text, sizeof(text)); | 47 | cin.getline(text, sizeof(text)); |
48 | len = strlen(text); | 48 | len = strlen(text); |
49 | do { | 49 | do { |
50 | p = rand() % 30; | 50 | p = rand() % 800; |
51 | } while (!isprime(p)); | 51 | } while (!isprime(p)); |
52 | do { | 52 | do { |
53 | q = rand() % 30; | 53 | q = rand() % 800; |
54 | } while (!isprime(q)); | 54 | } while (!isprime(q)); |
55 | n = p * q; | 55 | n = p * q; |
56 | phi = (p - 1) * (q - 1); | 56 | phi = (p - 1) * (q - 1); |