Ejemplo n.º 1
0
        public byte[] DecryptDataFrom(BinaryHexString senderPublicKey, BinaryHexString data, BinaryHexString nonce, bool uncompress, string secretPhrase)
        {
            var senderPublicKeyBytes = senderPublicKey.ToBytes().ToArray();
            var dataBytes            = data.ToBytes().ToArray();
            var nonceBytes           = nonce.ToBytes().ToArray();
            var decrypted            = _crypto.AesDecryptFrom(senderPublicKeyBytes, dataBytes, nonceBytes, secretPhrase);

            if (uncompress)
            {
                decrypted = _gzipCompressor.GzipUncompress(decrypted);
            }
            return(decrypted);
        }