public bool SaveNode(Node node) { RijndaelManager rsa = new RijndaelManager(KEY, IV); node.Entries.ForEach(x => { x.NodeId = node.NodeId; x.Value = rsa.Encrypt(x.Value); }); return(NodeRepository.SaveNode(node)); }
private static byte[] EncryptMessage(string username, string password, Command command, object message) { password = MD5Helper.CalculateMD5Hash(password); var bytes = MessagePackSerializer.Serialize(message); return(MessagePackSerializer.Serialize(new Message { User = username, Command = command, Content = RijndaelManager.Encrypt(bytes, password) })); }