- We need a listener wait for a client
- Accept a socket
- We need to load e and n from a file
- Send a random number and send it to client
- Compute a y = r^e%n
- Check if we have the same value
- We have a login
The other script is the Client that has the following steps:
- Looking for a socket
- We need to load d and n from a file
- Compute y = f(x) and then r = y^d%n
- Wait for login
Server
Client
Generator keys
Also I made a generator of keys, following the slides from the course.
This is how works my code, for example, if we need a new user:
User.dat = User d n
Claves-Server.txt = User e n
But, if we try to login with a different user.
y = (int(r)**e)%n costs you a point; 6 pts.
ResponderEliminar