Ejemplo n.º 1
0
        public void Decrypt(string encryptedText)
        {
            var encryptedBytes = _bytesUtil.FromBase64(encryptedText);
            var plainBytes     = _aesCryptoUtil.Decrypt(encryptedBytes);
            var plainText      = _bytesUtil.ToString(plainBytes);

            Console.WriteLine("Encrypted text:{0}, plain text:{1}", encryptedText, plainText);
        }
Ejemplo n.º 2
0
        public void Verify(string text, string signature)
        {
            var bytes          = _bytesUtil.FromString(text);
            var signatureBytes = _bytesUtil.FromBase64(signature);
            var isVerified     = _rsaCryptoUtil.Verify(bytes, signatureBytes, _key.Public);

            Console.WriteLine("Text:{0}, signature:{1}, is verified:{2}", text, signature, isVerified);
        }