public void EncryptStrTest() { OneTimePad myCipher = new OneTimePad(TEST_STR.Length); TestCtor(myCipher); myCipher.GenKey(); TestStrEnc(myCipher, myCipher.Encrypt(TEST_STR), TEST_STR.Length); }
public void GenKeyTest() { OneTimePad cipher = new OneTimePad(TEST_STR.Length); TestCtor(cipher); cipher.GenKey(); Assert.IsNotNull(cipher.GetKey(), "key was not intialized"); Assert.AreEqual(TEST_STR.Length, cipher.GetKey().Length, "Incorrect KeyLen Found"); }
public void DecryptStrTest() { OneTimePad myCipher = new OneTimePad(TEST_STR.Length); TestCtor(myCipher); myCipher.GenKey(); string encStr = myCipher.Encrypt(TEST_STR); TestStrEnc(myCipher, myCipher.Encrypt(TEST_STR), TEST_STR.Length); TestStrDec(encStr, myCipher.Decrypt(encStr)); }
public void SetKeyTest() { const int KEY_LEN = 10; OneTimePad encryptorOne = new OneTimePad(); OneTimePad encryptorTwo = new OneTimePad(KEY_LEN); TestCtor(encryptorOne); TestCtor(encryptorTwo); encryptorTwo.GenKey(); encryptorOne.SetKey(encryptorTwo.GetKey()); CompareKeys(encryptorTwo.GetKey(), encryptorOne.GetKey()); }