Example #1
0
        public void DifferentIncrementKeyTest()
        {
            KeyByte key = new KeyByte(32);

            string str1 = key.GetKey();
            string str2 = key.GetKey();

            Assert.AreNotEqual(str1, str2);
        }
Example #2
0
        public void SizeKeyTest()
        {
            KeyByte key = new KeyByte(32);

            string str = key.GetKey();

            Assert.AreEqual(4, str.Length);
        }
Example #3
0
        static void Main(string[] args)
        {
            KeyGenerator.KeyByte keygen = new KeyByte(32);

            while (keygen.nextKeyExist())
            {
                Console.WriteLine(keygen.GetKey());
            }

            Console.ReadLine();
        }
Example #4
0
        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);
            }
        }