Пример #1
0
    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));
    }
Пример #2
0
    public byte[] Decrypt(byte[] cryptData, byte[] key)
    {
        var total = KpMsgPack.Des <NonceAndCrypt>(cryptData);

        return(SecretBox.Open(total.Crypt, total.Nonce, key));
    }