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); }
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); }
public AESFixedNonceEncryptor() { cipher = new AESCipherCTR(0); }