Setting my key and vector values for encryption
<p>I asked some questions before. Thanks for the help. </p>

<p>My need is to encrypt a URL. So I start off with a URL, I encrypt it, make a link on my page that uses the URL. When the user clicks the link it goes to a controller (MVC), I decrypt the URL, get my data and display it. It works very well so far. </p>

<p>What I am thinking to do is to make it so that the URL encryption is based on the users ID plus a chosen key value. Everything is on the server so the keys would just be in two scripts. </p>

<p>So how could I set my key. Say for example that I wanted the key to be equal to the user_name plus "hjshdasd" where the "hj.." is always same and secret to me. Currently the key is a byte array. How can I just make it the above string. </p>

<p>Am I correct in saying that I could set the IV to anything as everything is internal and known just to my own scripts. Any suggestions on how I could set this? Bear in mind that I want the encryption to always be the same so I guess my IV would always be the same as well as I would have the same key for a certain user every time. </p>

<p>Thanks,</p>

<pre><code>private static byte[] key = { 123, 217, 19, 11, 24, 26, 85, 45, 114, 184, 27, 162, 37, 112, 222, 209, 241, 24, 175, 144, 173, 53, 196, 29, 24, 26, 17, 218, 131, 236, 53, 209 };
    private static byte[] vector = { 146, 64, 191, 111, 23, 3, 113, 119, 231, 121, 221, 112, 79, 32, 114, 156 };
    private ICryptoTransform encryptor, decryptor;
    private UTF8Encoding encoder;

    public SimplerAES()
    {
        RijndaelManaged rm = new RijndaelManaged();
        encryptor = rm.CreateEncryptor(key, vector);
        decryptor = rm.CreateDecryptor(key, vector);
        encoder = new UTF8Encoding();
    }
</code></pre>
