public void RunTripAspMachine()
        {
            Skip.IfNot(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
            var entropy   = new byte[] { 24, 76, 211, 4, 255 };
            var protector = new AspNetWrapper();

            RunTrip(entropy, DataProtectionScope.LocalMachine, protector);
        }
        public void MachineCannotReadUser()
        {
            var protector = new AspNetWrapper();
            var entropy   = new byte[] { 24, 76, 211, 4, 255 };
            var encrypted = protector.Protect(_sampleBytes, entropy, DataProtectionScope.CurrentUser);

            Assert.ThrowsAny <CryptographicException>(() => protector.Unprotect(encrypted, entropy, DataProtectionScope.LocalMachine));
        }
        public void DifferentEntropyFailsUser()
        {
            var protector = new AspNetWrapper();
            var entropy1  = new byte[] { 24, 76, 211, 4, 255 };
            var entropy2  = new byte[] { 24, 76, 211, 4, 254 };
            var encrypted = protector.Protect(_sampleBytes, entropy1, DataProtectionScope.CurrentUser);

            Assert.ThrowsAny <CryptographicException>(() => protector.Unprotect(encrypted, entropy2, DataProtectionScope.CurrentUser));
        }