Rating:

# codegate2013 bin100 solution
# cutz

using System;
using System.Text;
using System.Security.Cryptography;

namespace test
{
class Program
{

public static string KeyValue = "9e2ea73295c7201c5ccd044477228527";

public static byte[] d = new byte[] {
0x3f, 30, 0x39, 0x2f, 20, 0x4e, 50, 0x36, 0x33, 5, 0x25, 0x29, 0x52, 40, 0x45, 30,
0x2a, 0x38, 0x24, 0x49, 60, 0x44, 0x4f, 0x56, 0x18, 0x49, 0x4c, 0x13, 9, 0x1b, 0x2a, 4,
0x52, 0x2a, 0x1c, 0x56, 0x4f, 11, 0x11, 0x3f, 0x17, 14, 0x30, 0x40

};

public static void Main(string[] args)
{
Console.WriteLine("Flag: " + Decrypt(StringToXOR(ByteTostring_t(d)), KeyValue));

Console.ReadKey(true);
}

public static string StringToXOR(string data)
{
byte[] bt = new byte[data.Length];
bt = stringTobyte(data);

for (int i = 0; i < bt.Length; i++) {
bt[i] = (byte) (bt[i] ^ 0x25);
bt[i] = (byte) (bt[i] ^ 0x58);
}

return ByteTostring(bt);
}
public static string ByteTostring(byte[] bt)
{
string str = "";

for (int i = 0; i < bt.Length; i++) {
str = str + Encoding.Default.GetString(bt, i, 1);
}
return str;
}

public static byte[] stringTobyte(string str)
{
return Encoding.UTF8.GetBytes(str.ToCharArray());
}

public static string Decrypt(string textToDecrypt, string key)
{
RijndaelManaged managed = new RijndaelManaged {
Mode = CipherMode.CBC,
Padding = PaddingMode.PKCS7,
KeySize = 0x100,
BlockSize = 0x100
};

byte[] inputBuffer = Convert.FromBase64String(textToDecrypt);
byte[] bytes = Encoding.UTF8.GetBytes(key);
byte[] destinationArray = new byte[0x20];
int length = bytes.Length;
Array.Copy(bytes, destinationArray, length);
managed.Key = destinationArray;
managed.IV = destinationArray;
byte[] buffer4 = managed.CreateDecryptor().TransformFinalBlock(inputBuffer, 0, inputBuffer.Length);
return Encoding.UTF8.GetString(buffer4);
}

public static string ByteTostring_t(byte[] buf)
{
return Encoding.UTF8.GetString(buf);
}
}
}

Original writeup (http://pastie.org/pastes/6371080/text?key=ewguofqedxkdtibji87mjq).