コード例 #1
0
        public void GetFirstNonceTest()
        {
            AESCipherCTR cipher   = new AESCipherCTR(key, 0);
            Bytes        expected = new Bytes(new byte[16]);

            string nonce = cipher.GetNextCounter();

            Assert.AreEqual(expected.ToString(), nonce);
        }
コード例 #2
0
        public void EncryptAESCTR()
        {
            AESCipherCTR cipher   = new AESCipherCTR(key, 0);
            Base64       expected = new Base64("L77na/nrFsKvynd6HzOoG7GHTLXsTVu9qvY/2syLXzhPweyyMTJULu/6/kXX0KSvoOLSFQ==");
            string       data     = "Yo, VIP Let's kick it Ice, Ice, baby Ice, Ice, baby ";

            string encrypted = cipher.Encrypt(data);

            Assert.AreEqual(expected.Decode(), encrypted);
        }
コード例 #3
0
 public AESFixedNonceEncryptor()
 {
     cipher = new AESCipherCTR(0);
 }