public void SendMessage(string serializedMessage) { var AESIV = SecurityWrapper.GetRandomBytes(); var encryptedMessage = AESWrapper.EncryptStringToBytes(serializedMessage, AESKey, AESIV); var message = JoinIVToEncryptedMessage(encryptedMessage, AESIV); Writer.WriteLine(message); Writer.Flush(); }
private byte[] EncryptMessage(string message, byte[] AESKey, byte[] AESIV) { return(AESWrapper.EncryptStringToBytes(message, AESKey, AESIV)); }