document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. import socket
  2. from sys import argv
  3. def main():
  4.     s = socket.socket()
  5.     s.connect(("localhost", int(argv[1])))
  6.     while True:
  7.         mensaje = raw_input(">")
  8.         s.send(mensaje)
  9.         x = float(s.recv(4096))
  10.         x = x / 0.02
  11.         y = x
  12.         print "Y : ",y
  13.         mensaje = raw_input("> Como te llamas? ")
  14.         Llaves = open(mensaje+\'.txt\', \'r\')
  15.         nombre = mensaje
  16.         Llaves = Llaves.readline()
  17.         Llaves = Llaves.split(\',\')
  18.         print "Tu llave publica es ",Llaves[0]," ",Llaves[1]
  19.         d = float(Llaves[0])
  20.         n = float(Llaves[1])
  21.         r = ( ( y ** d ) % n)
  22.         print "d: ",d
  23.         print "n: ",n
  24.         print "r : ", r
  25.         mensaje = raw_input("> Envia tu nombre y tu r separado por commas (para identificarte con el servidor):  ")
  26.         s.send(mensaje)
  27.         respuesta = s.recv(4096)
  28.         print respuesta
  29.         if mensaje == "quit":
  30.             break
  31.         s.close()
  32. main()
');