Finding the prime factors of big numbers is not a trivial thing. Criptography is based in keys that are the product of two keys big enough so that event the biggest parallel computers choke on them. When there is an improvement on computing power or methods you just use bigger nimbers to keep it safe,
Trial division chockes very fast, For bigger numbers there are trial and error methods as Brent's that can go further.
The code i attach found 600851475143 = [71, 839, 1471, 6857] in 0,1 seconds, but it chokes the same for bigger numbers.
It uses trial division up to 1M then switches to Brent's method.
I can't explain Brent, I just copied the code...
#Py3.4
from fractions import gcd
from random import randint
from time import clock
def brent(N):
# brent returns a divisor, not guaranteed to be prime
if N%2==0: return 2
y,c,m = randint(1, N-1),randint(1, N-1),randint(1, N-1)
g,r,q = 1,1,1
while g==1:
x = y
for i in range(r):
y = ((y*y)%N+c)%N
k = 0
while (k<r and g==1):
ys = y
for i in range(min(m,r-k)):
y = ((y*y)%N+c)%N
q = q*(abs(x-y))%N
g = gcd(q,N)
k = k + m
r = r*2
if g==N:
while True:
ys = ((ys*ys)%N+c)%N
g = gcd(abs(x-ys),N)
if g>1: break
return g
def factorize(n1):
if n1<=0: return []
if n1==1: return [1]
n=n1
b=[]
p=0
mx=1000000
while n % 2 ==0 : b.append(2);n//=2
while n % 3 ==0 : b.append(3);n//=3
i=5
inc=2
while i <=mx:
while n % i ==0 : b.append(i); n//=i
i+=inc
inc=6-inc
while n>mx:
p1=n
#iterate until divisor is prime
while p1!=p:
p=p1
p1=brent(p)
print(p1)
b.append(p1);n//=p1
if n!=1:b.append(n)
b.sort()
return b
from functools import reduce
from sys import argv
def main():
if len(argv)==2:
n=int(argv[1])
else:
n=int(eval(input(" Integer to factorize? ")))
t1=clock()
li=factorize(n)
print (n,"= ",li)
print(clock()-t1, " seconds")
print ("n - product of factors = ",n - reduce(lambda x,y :x*y ,li))
if __name__ == "__main__":
main()