コード例 #1
0
        private void encodePhae2_Click(object sender, EventArgs e)
        {
            Encoder          enc = new Encoder();
            BitShifter       bs  = new BitShifter();
            ParityBitEncoder pbe = new ParityBitEncoder();

            //string validatedText = pbe.DeleteIllegalBytes(encTextBox.Text);
            //Console.WriteLine($"Lenght of validated Text: {validatedText.Length}");

            //string encodedText = bs.TomsOnionShifterDecodeAll(enc.decodeAll(pbe.DeleteIllegalBytes(encTextBox.Text)));
            string encodedText = pbe.decodeAll(encTextBox.Text);

            Console.WriteLine($"Original Payload: {encTextBox.Text.Length} ");
            Console.WriteLine($"Decrypted Text: {encodedText.Length}");
            Console.WriteLine(encodedText);

            //string ascii85DecodedText = enc.decodeAll(encTextBox.Text);
            //Console.WriteLine($"ascii85DecodedText: {ascii85DecodedText.Length}");
            //string shiftedText = bs.TomsOnionShifterDecodeAll(ascii85DecodedText);
            //string decodedText = pbe.DeleteIllegalBytes(shiftedText);
            //Console.WriteLine($"DecodedText: {decodedText.Length}");

            //
            ///Console.WriteLine(shiftedText);
            //Console.WriteLine("\n\n---====================================================================================================================================---\n\n\n\n");
            //Console.WriteLine(decodedText);
            encTextBox.Text = Utility.addSystemNewLine(encodedText);
        }
コード例 #2
0
        private void encryptPhase2_Click(object sender, EventArgs e)
        {
            Encoder    enc         = new Encoder();
            BitShifter bs          = new BitShifter();
            string     decodedText = enc.decodeAll(encTextBox.Text);

            decodedText     = bs.TomsOnionShifterDecodeAll(decodedText);
            encTextBox.Text = Utility.addSystemNewLine(decodedText);
        }