I am learning about cryptographic algorithms and in the process am attempting to implement some well known schemes. I understand the mathematical explanations behind RSA and El Gamal, but am currently unable to test my implementations of either. The underlying problem is that I cannot see the way to convert plain text into a manipulatable number.
For Example:
Message = "This is a message I want to encrypt";
int x = (int)Message;
Encrypt(x,key);
In my mind, it should be possible to cast a string to an integer, but doing so in a method similar to the above example doesn't work. How can I turn a plain-text message into a numerical value (and later back into a plain-text value) for the purposes of encryption?