I wanna factorize large integers using Pollard's $p-1$ method. My code is based on this:
Factoring large integers with the Pollard p-1 method
And looks as follows:
n = 1939900392481175101101462893543460784447034253991263908962636876409557208043058682516864365942068336973845078922522981168365133732048049885237907479175066840706500787738827165254575315273186376834299853517761277713938051355016186322030603563728949971286889223191828141474758368917643301805545585847158202870859030856164655492881248821859014256467557880626766501568641461532357356067956229763970686764008230518833896971726760554427;
b = 65537;
y = 0;
z = 0;
p = 0;
Monitor[
For[k = 0, k <= 150000, k++,
y = PowerMod[b, k!, n];
z = y - 1;
p = GCD[z, n];
If[p > 1, Return[p]];
], k
]
Obviously, this does not work so I wonder if anyone has an idea on how to factorize large integers using Pollard's $p-1$ method in mathematica?
I also have the ciphertext:
c=829104585720293278626470138282411210590533811158703130580756826705756640524672985376810471616350668463680489398108960669984158688828010844108708408493717783601465735765204176314915216787694438820518397209550097224443643191484791651143362192151658048948204027173310314513331591611598291620931752367747278198047722865730004108846746722796203320711033035573007658737469411857835505566554339107332759317185845826056144437100913389492