ranisalt

C++ RSA Cracker

Aug 1st, 2013
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.49 KB | None | 0 0
  1. #include <iostream>
  2. #include <math.h>
  3. using std::cout;
  4.  
  5. static bool primo(unsigned long n) {
  6.     for (unsigned short i = 3; i < sqrt(n) + 1; i += 2)
  7.         if (n % i == 0) return false;
  8.     return true;
  9. }
  10.  
  11. static unsigned long long num = 67590067757306080;
  12. int main() {
  13.     for (unsigned long i = pow(2, 27) + 1, max = pow(2, 28); i < max; i += 2)
  14.         if (num % (i - 1) == 0) if (primo(i)) if (primo(num / (i - 1) + 1)) {
  15.             cout << i << ' ' << num / (i - 1) + 1 << '\n';
  16.             break;
  17.         }
  18.     return 0;
  19. }
Add Comment
Please, Sign In to add comment