public byte[] VerifiedDecrypt(byte[] cryptData, byte[] sendPublicKey, byte[] recvPrivateKey) { var total = KpMsgPack.Des <NonceAndCrypt>(cryptData); return(Sodium.PublicKeyBox.Open(total.Crypt, total.Nonce, recvPrivateKey, sendPublicKey)); }
public byte[] Decrypt(byte[] cryptData, byte[] key) { var total = KpMsgPack.Des <NonceAndCrypt>(cryptData); return(SecretBox.Open(total.Crypt, total.Nonce, key)); }