- I choose p and q, these numbers have to be primes and random
- Then I get n by multiplying p*q
- After this I calculate phi, using this formula (p-1)(q-1)
- Next I implement the Extended Euclidean Algorithm to get d (for private key)
- Then I choose e and check that this number is greater than 1 but less than phi
- Then create the public.txt and private.txt
- Create the server.py and client.py following this steps:
Well, with this assignment it was difficult to me to understand the Extended Euclidean Algorithm and I lost a lot of time with that and I could only get the parameters for the public and private keys, and because of that I couldn't do the sockets.
I thank my classmate Obed Guevara for helping to understand the part of the sockets, and during this week I would get this RSA algorithm complete.
Well, here is the code for getting the parameters.
Sources
- Extended Euclidean Algorithm - Wolfram & trans4mind
- Wikipedia
- rsa
Falta todo lo de sockets y tu algoritmo extendido de Euclides está bien feo. Checa los blogs de los demás por una implementación bella recursiva. Van 3 pts por lo que llevas hecho.
ReplyDelete