Esempio n. 1
0
        public void SizeKeyTest()
        {
            KeyByte key = new KeyByte(32);

            string str = key.GetKey();

            Assert.AreEqual(4, str.Length);
        }
Esempio n. 2
0
        public void DifferentIncrementKeyTest()
        {
            KeyByte key = new KeyByte(32);

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

            Assert.AreNotEqual(str1, str2);
        }
Esempio n. 3
0
        static void Main(string[] args)
        {
            KeyGenerator.KeyByte keygen = new KeyByte(32);

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

            Console.ReadLine();
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
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);
            }
        }