示例#1
0
        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();
        }
示例#2
0
 private byte[] EncryptMessage(string message, byte[] AESKey, byte[] AESIV)
 {
     return(AESWrapper.EncryptStringToBytes(message, AESKey, AESIV));
 }