title: Triple DES without using forward or backward slashes
body: <p>Is it possible to modify triple DES so as not to include forward and backward slashes when encrypting/decrypting?</p>
  
  <p>I had this actionlink on mvc which works without encryption however when I tried to encrypt the id passed to the controller method, the id was being encrypted and included some forward slashes (<code>/vO5Ppr4+Phzx+lHD4Jp6JubZlYXK0Az9OA9J8urf+MJFw62c3Y0Q/Q==</code>) thus I am getting a 404 not found and the controller method is not being called.</p>
  
  <p>MVC ActionLink:</p>
  
  <pre><code>&lt;span&gt; | &lt;/span&gt; @Html.ActionLink("Student Rights", "StudentRights","Threads", new { id = CommonLayer.Securities.Encryption.EncryptTripleDES(item.ID) }, null)
  </code></pre>
  
  <p>Encryption Method:</p>
  
  <pre><code>private static byte[] KEY_192 = 
          {
              111,21,12,65,21,12,2,1,
              5,30,34,78,98,1,32,122,
              123,124,125,126,212,212,213,214
          };
  
      private static byte[] IV_192 = 
          {
              1,2,3,4,5,12,13,14,
              13,14,15,13,17,21,22,23,
              24,25,121,122,122,123,124,124
          };
  
      /// &lt;summary&gt;
      /// Encrypt using TripleDES
      /// &lt;/summary&gt;
      /// &lt;param name="vl"&gt;String to Encrypt&lt;/param&gt;
      /// &lt;returns&gt;Encrypted String&lt;/returns&gt;
      public static String EncryptTripleDES(String vl)
      {
          if (vl != "")
          { 
              TripleDESCryptoServiceProvider cryptoprovider = new TripleDESCryptoServiceProvider();
              MemoryStream ms = new MemoryStream();
              CryptoStream cs = new CryptoStream(ms, cryptoprovider.CreateEncryptor(KEY_192, IV_192), CryptoStreamMode.Write);
              StreamWriter sw = new StreamWriter(cs);
              sw.Write(vl);
              sw.Flush();
              cs.FlushFinalBlock();
              ms.Flush();
              return Convert.ToBase64String(ms.GetBuffer(), 0, (int)ms.Length);
          } 
          return "";
      } 
  
      /// &lt;summary&gt;
      /// Decrypt using TripleDES
      /// &lt;/summary&gt;
      /// &lt;param name="vl"&gt;String to Decrypt&lt;/param&gt;
      /// &lt;returns&gt;Decrypted String&lt;/returns&gt;
      public static String DecryptTripleDES(String vl)
      { 
          if (vl != "")
          { 
              TripleDESCryptoServiceProvider cryptoprovider = new TripleDESCryptoServiceProvider();
              Byte[] buffer = Convert.FromBase64String(vl);
              MemoryStream ms = new MemoryStream(buffer);
              CryptoStream cs = new CryptoStream(ms, cryptoprovider.CreateDecryptor(KEY_192, IV_192), CryptoStreamMode.Read);
              StreamReader sw = new StreamReader(cs);
              return sw.ReadToEnd();
          } 
          return "";
      }
  </code></pre>