Beispiel #1
0
		q = int(input('That number will not work, try another: '))
	
N=p*q
C=[d,N]
A=[d,p]
B=[d,q]

r=Conics.conic_size(A) #Size of C mod p
s=Conics.conic_size(B)	#Size of C mod q
M=r*s #Size of C mod N (due to CRT)



#Input key
e = int(input('Input the Public Key: '))
while MLib.gcd(e,M)!=1:
	e = int(input('That key will not do, try another: '))

#Output reverse key
k = Conics.conic_inv(e,A,B)

print('')
print('--Public Information--')
print('The Conic: x^2 -', d,'y^2 = 4')
print('The Modular Number: ', N)
print('The Key: ', e)
print('')
print('--Private Information--')
print('The Factorization: ', N,'=', p,'*', q)
print('The Size of the Conic: ', M,'=', r,'*',s)
print('The Reverse Key: ', k)