Пример #1
0
def is_prime(n, t):

    for i in xrange(1, t):
    	a = random.randint(2, n-1)
    	#r = (a**n-1) % n
    	r = p5_expm.expm(a, n-1, n)
    	#print a , r
    	if r != 1:
    		return False

    return True
Пример #2
0
def is_prime(n, t):

    for i in xrange(1, t):
        a = random.randint(2, n - 1)
        #r = (a**n-1) % n
        r = p5_expm.expm(a, n - 1, n)
        #print a , r
        if r != 1:
            return False

    return True
Пример #3
0
def rsaDec(n,d,c):

	return p5_expm.expm(c, d, n)
Пример #4
0
def rsaEnc(n,e,m):
	
	return p5_expm.expm(m, e, n)