yazdmich

Crypto transfer client

Jun 13th, 2014
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. from crypto import *
  2. from socket import *
  3. s = socket(AF_INET,SOCK_STREAM)
  4. s.connect(('nope, not telling you', 20))
  5. a = Crypto('gen', '', 5)
  6. get = []
  7. while True:
  8.     get.append(s.recv(4096).decode())
  9.     if 'CRYPT_KEY' in get[-1]:
  10.         a.key = s.recv(4096).decode()
  11.         continue
  12.     elif get[-1] == 'FIN\n':
  13.         s.close()
  14.         get.pop([-1])
  15.         break
  16.     print(get[-1])
  17.     s.send(b'ACK\n')
  18.     continue
  19.  
  20. out = ''
  21. for word in get:
  22.     a.update(word)
  23.     print(a.Out())
  24.     out += a.Out()+' '
Advertisement
Add Comment
Please, Sign In to add comment