Ejemplo n.º 1
0
        public async Task ShouldDecrypt()
        {
            var provider = new EncryptionProvider();
            var array    = Encoding.ASCII.GetBytes("This is a test");

            var encrypted = await AsArray(provider.EncryptBlock(array)).ConfigureAwait(false);

            var decrypted = await AsArray(provider.DecryptBlock(encrypted)).ConfigureAwait(false);

            Assert.Equal(array.ToList(), decrypted);
            Assert.Equal(Encoding.ASCII.GetString(decrypted), "This is a test");
        }