September 13, 2012

Algoritmo RSA

For this week, the homework was to implement the RSA Algorithm, for doing this I have to create private and public keys and create sockets for the server and client. I follow the next steps:

  • 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


1 comment:

  1. 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