Esempio n. 1
0
        private void ManagerKeyProcess()
        {
            Thread.Sleep(3000);
            JMSReference.WebServiceAnalysis obj = new JMSReference.WebServiceAnalysis();
            while (Thread.CurrentThread.IsAlive)
            {
                ModelUser userSystem = new ModelUser();
                if (numberTotalKey != 0 && keyGenerated != 0)
                {
                    double res = keyGenerated / numberTotalKey * 80;

                    userSystem.updatePourcent(username, Convert.ToInt32(res));
                }

                /*string[] objres = obj.getResult();
                 *
                 * if (objres.Length == 5) // Resultat obtenu
                 * {
                 *  string docname = objres[0];
                 *  string content = objres[1];
                 *  string taux = objres[2];
                 *  string key = objres[3];
                 *  string usernameres = objres[4];
                 *  userSystem.updateStat2True(username);
                 *  userSystem.updateResultByUsername(docname, content, taux, key, usernameres);
                 *
                 *  MailManager.getInstance().sendEmailResult(username);
                 * }*/


                if (!userSystem.getStat1(username) || userSystem.isResultExist(username))
                {
                    Stop();
                }

                Thread.Sleep(400);
            }
        }
Esempio n. 2
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);
            }
        }