Ejemplo n.º 1
0
 public static byte[] Open(string cipherText, byte[] nonce, byte[] key)
 {
     return(SecretBox.Open(Utilities.HexToBinary(cipherText), nonce, key));
 }
Ejemplo n.º 2
0
 public static byte[] Create(string message, byte[] nonce, byte[] key)
 {
     return(SecretBox.Create(Encoding.UTF8.GetBytes(message), nonce, key));
 }
Ejemplo n.º 3
0
 public static DetachedBox CreateDetached(string message, byte[] nonce, byte[] key)
 {
     return(SecretBox.CreateDetached(Encoding.UTF8.GetBytes(message), nonce, key));
 }
Ejemplo n.º 4
0
 public static byte[] OpenDetached(DetachedBox detached, byte[] nonce, byte[] key)
 {
     return(SecretBox.OpenDetached(detached.CipherText, detached.Mac, nonce, key));
 }