Post: breaking ff
05-24-2011, 10:01 PM #1
teelub
Pokemon Trainer
(adsbygoogle = window.adsbygoogle || []).push({}); Given n as the modulus, and exponents d & e, this python function returns the factors of n as an array:

Code:

def rfact(n, e, d):

""" because e*d is congruent to 1 mod phi(n), e*d is very close to
being a multiple of phi, and phi is very close to n for an RSA
modulus - so the whole number quotient (e*d)/n is 1 less than
this factor """
k = 1 + (e * d) / n
phi = (e * d - 1) / k

""" if n=p*q, then phi(n) = (p-1)*(q-1) = p*q + 1 - (p+q); but p*q=n,
so phi(n) = n + 1 - (p+q); set 'sum' to p+q """
sum = n + 1 - phi

""" we now know the product of p and q (n) and their sum (sum). we
solve for p and q using the quadratic formula. set 'delta' to
the radical in the numerator of the formula """
delta = isqrt(sum**2 - 4*n)

p = (sum + delta) / 2
q = (sum - delta) / 2

if p*q != n:
print '!Failed: modulus not factored correctly!'

return [p, q]



Function rfact() requires this integer square root function:

Code:

def isqrt(n):
# construct an initial guess value
d = len(str(n)) # count of decimal digits
x = '3'
d = d / 2
while d > 0:
d = d - 1
x = x + '1'
x = int(x)

# perform Newton-Raphson iteration
prev = 0
while x != prev:
prev = x
q = n / x
x = (x + q) / 2

return x

could anyone run this script using ps3 paramters my cpu cant hang

DISCLAIMERS: 1) This code is offered without any warranty. If your computer catches fire when you try to run it, don't say I didn't warn you. 2) If you don't know how to run python code, search the interwebs: tons of python info!
(adsbygoogle = window.adsbygoogle || []).push({});
05-24-2011, 10:22 PM #2
Okay, sorry you're being to general. What exactly is the input?
05-24-2011, 10:27 PM #3
teelub
Pokemon Trainer
sorry im scared to release if u have public key this is generel set up for the algorithm

---------- Post added at 06:27 PM ---------- Previous post was at 06:25 PM ----------

I know someone thats waiting to release just trying to find away without all the heat
05-25-2011, 08:49 AM #4
Originally posted by teelub View Post
I know someone thats waiting to release just trying to find away without all the heat


As much as I doubt that, PM me anything you wanna get off your chest and I'll release it :420:

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo