Exemple #1
0
        public static void Challenge2()
        {
            const string plaintext = "1c0111001f010100061a024b53535009181c";
            const string cipher    = "686974207468652062756c6c277320657965";

            Console.WriteLine(StringConverters.BitsToHex(StringConverters.HexToBits(plaintext).Xor(StringConverters.HexToBits(cipher))));
        }
Exemple #2
0
        public static string decipherCText(string cText, char cipher)
        {
            BitArray cTextBits = StringConverters.HexToBits(cText);

            BitArray cipherBits = StringConverters.CharToBits(cipher, cText.Length / 2);

            cTextBits.Xor(cipherBits);


            return(StringConverters.BitsToString(cTextBits));
        }
Exemple #3
0
        public static void Challenge1()
        {
            const string hex = "49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d";

            Console.WriteLine(StringConverters.BitsToBase64(StringConverters.HexToBits(hex)));
        }