Beispiel #1
0
 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);
 }
Beispiel #2
0
 public byte[] EncryptMessage(string msg, byte[] nonce)
 {
     return(TweetNaCl.CryptoBox(_utf8.GetBytes(msg), nonce, ClientPublicKey, _pair.PrivateKey));
 }