Ejemplo n.º 1
0
        static void _encryptMessage(string key, string message)
        {
            byte[] keyBytes     = Utils.BAFromString(key);
            byte[] messageBytes = Utils.BAFromString(message); // System.Text.Encoding.UTF8.GetBytes(message);
            byte[] cipher       = new byte[messageBytes.Length];

            RC4 packer = new RC4(keyBytes);

            // TODO encrypt
            cipher = packer.Encrypt(messageBytes);

            // Output
            Console.WriteLine($"SHA1:{Utils.BAToString(packer.Hash(messageBytes))} CIPHER:{Utils.BAToString(cipher)}");
            Console.WriteLine();
        }