public void SizeKeyTest() { KeyByte key = new KeyByte(32); string str = key.GetKey(); Assert.AreEqual(4, str.Length); }
public void DifferentIncrementKeyTest() { KeyByte key = new KeyByte(32); string str1 = key.GetKey(); string str2 = key.GetKey(); Assert.AreNotEqual(str1, str2); }
static void Main(string[] args) { KeyGenerator.KeyByte keygen = new KeyByte(32); while (keygen.nextKeyExist()) { Console.WriteLine(keygen.GetKey()); } Console.ReadLine(); }
public void inverseArrayTest() { KeyByte key = new KeyByte(16); double[] arr = new double[2]; arr[0] = 25; arr[1] = 90; double[] arrAttendu = new double[2]; arrAttendu[0] = 90; arrAttendu[1] = 25; double[] val = key.inverseArray(arr); Assert.ReferenceEquals(arrAttendu, val); }
private void DecryptProcess(string filestr, string namefile) { KeyByte keygen = new KeyByte(48); JMSReference.WebServiceAnalysis obj = new JMSReference.WebServiceAnalysis(); numberTotalKey += keygen.getAmountMaxKey(); string nameFile = namefile; while (keygen.nextKeyExist() && Thread.CurrentThread.IsAlive) { keyGenerated++; string key = keygen.GetKey(); string decryptedFile = XORdecrypt(filestr, key); //string decryptedFile = XORdecrypt(filestr, "fjuiop"); string contentReadyTosend = ChaineToBinaire(decryptedFile).ToString(); obj.rechercheDocumentDecrypte(username, contentReadyTosend, namefile, key); } }