diff options
Diffstat (limited to 'q8')
-rw-r--r-- | q8/rsa.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -2,6 +2,7 @@ | |||
2 | #include <math.h> | 2 | #include <math.h> |
3 | #include <stdlib.h> | 3 | #include <stdlib.h> |
4 | #include <string.h> | 4 | #include <string.h> |
5 | #include <time.h> | ||
5 | 6 | ||
6 | using namespace std; | 7 | using namespace std; |
7 | 8 | ||
@@ -46,6 +47,7 @@ int main() { | |||
46 | cout << "Enter the text to be encrypted: "; | 47 | cout << "Enter the text to be encrypted: "; |
47 | cin.getline(text, sizeof(text)); | 48 | cin.getline(text, sizeof(text)); |
48 | len = strlen(text); | 49 | len = strlen(text); |
50 | srand(time(0)); | ||
49 | do { | 51 | do { |
50 | p = rand() % 800; | 52 | p = rand() % 800; |
51 | } while (!isprime(p)); | 53 | } while (!isprime(p)); |