//
Encrypt the symmetric key and send it to the guest using the client's public key.
EncryptandSymmetricKey (Client, RSA, SYMM); //
Use symmetric key encryption information and send
EncryptandsendSecretMessage (Client, SYMM, MSG);} catch (exception e) {console.writeline (E.MESSAGE); Console.Writeline (E.STACKTRACE);} finally {try {client.close (); listener.stop () } catCH {////
error
} Console.writeline ("Server EXITING ...");}}} private static rsaparameters getClientPublicKey (TCPCLIENT Client) {//
Get a serialized public key from the byte stream, by string and convert the write class
byte [] buffer = new byte [RSA_KEY_SIZE_BYTES]; NetworkStream ns = client.GetStream (); MemoryStream ms = new MemoryStream (); BinaryFormatter bf = new BinaryFormatter (); RSAParameters result; int len = 0; int totalLen = 0;