Commit 50ec6496 authored by wx002's avatar wx002

add

parent 9a280b66
import socket
from Cryto.PublicKey import RSA
from Crypto.PublicKey import RSA
from base64 import b64decode as b64d
dest = 'eg.bucknell.edu'
port = 6997
......@@ -7,6 +8,15 @@ port = 6997
destAddr = (dest,port)
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect(destAddr)
s.send('HELLO wx002')
client.send(b'HELLO wx002')
recv = client.recv(2048)
print(recv)
en_key = recv
key_loc = '/home/accounts/student/w/wx002/.ssh/id_rsa'
rsa_key = RSA.importKey(open(key_loc,'rb').read())
dec_key = rsa_key.decrypt(en_key)
client.sendall(dec_key)
while 1:
recv = client.recv(2048)
print(recv)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment