By 2C
I think you mean the hex representation of the letter A
?
That would be something like String.Format("{0:X}", Convert.ToInt32('A'));
Update after clarification from OP
You either need to predefine your entire supported character set like this.
static Dictionary<char, int> cyper = new Dictionary<char, int>
{
{'A', 44},
{'B', 45},
{'C', 46},
{'D', 47},
{'E', 48},
{'F', 49},
// .. etc
};
// ...
Console.WriteLine(string.Format("{0:X}", cyper['A'])); // will print 2C
But that doesn't seem like a very good encryption if everything is just off by a few values.
Another approach would be to apply an encoding scheme. A runtime mathematical evaluation on the input that will evaluate to 2C (encrypt) and be able to take 2C and evaluate to A (decrypt).