public byte[] EncryptMessage(string clientId, string msg, byte[] nonce) { if (_clientKeys.ContainsKey(clientId)) { var pair = _clientKeys[clientId]; return(TweetNaCl.CryptoBox(_utf8.GetBytes(msg), nonce, pair.PublicKey, pair.PrivateKey)); } return(null); }
public byte[] EncryptMessage(string msg, byte[] nonce) { return(TweetNaCl.CryptoBox(_utf8.GetBytes(msg), nonce, ClientPublicKey, _pair.PrivateKey)); }