Exemple #1
0
        public void GetRandomBytesTest()
        {
            random r = new random();

            byte[] bs = r.GetRandomBytes();

            Assert.AreEqual(8, bs.Count());
        }
Exemple #2
0
        public void SaltedBytesTest()
        {
            string source = "item";

            random r = new random();

            byte[] bs   = r.GetRandomBytes();
            string salt = System.Text.Encoding.UTF8.GetString(bs);

            stringer s = new stringer();
            string   e = s.decrypt(s.encrypt(source, salt), salt);

            Assert.AreEqual(source, e);
        }