SHARE
TWEET

Untitled

a guest May 6th, 2019 95 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {
  2. setrand(getwalltime());
  3. read("rsa1.out");
  4. t=e*d-1;
  5. print("t: ",t);
  6.  
  7. while(lift(Mod(t,2)) == 0,t=t/2;);
  8.  
  9. print("t: ",t);
  10.  
  11. a=random(n-1)+1;
  12. print("a: ",a);
  13.  
  14. d=gcd(a,n);
  15. if(d > 1,print("d=",d);,
  16.   V=lift(Mod(a,n)^t);
  17.   print("V=",V);
  18.  
  19.   if (V == 1,print("V ERROR"),
  20.     while(V != 1,V0=V;
  21.           V=lift(Mod(V,n)^2);
  22.     );
  23.     print("V: ",V);
  24.     print("V0: ",V0);
  25.  
  26.     if(V0 == n-1,
  27.         print("V0 ERROR"),
  28.       p=gcd(V0+1,n);
  29.         q=n/p;print("n: ",n);
  30.         print("p*q: ",p*q);
  31.       );
  32.     );
  33.   );
  34. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top