title: 3DES Key Size Matter in C#.Net
body: <p><p>Below Code is Working Fine in c#.NET</P></p>
  
  <pre><code>byte[] key = Encoding.ASCII.GetByte("012345678901234567890123"); //24characters        
  byte[] plainText = Encoding.ASCII.GetBytes("lasaa"); 
  TripleDES des = TripleDES.Create();
  des.Key = key;
  des.Mode = CipherMode.CBC;
  ICryptoTransform ic = des.CreateEncryptor();
  byte[] enc = ic.TransformFinalBlock(plainText, 0, plainText.Length);
  MessageBox.Show(UTF8Encoding.UTF8.GetString(enc));
  </code></pre>
  
  <p>My questions regarding above are...</p>
  
  <ol>
  <li>How can I specify KeySize? if i use <code>des.KeySize=</code> <code>128</code> or <code>192</code> or <code>256</code> it gives</li>
  </ol>
  
  <blockquote>
    <p>Specified key is not a valid size for this algorithm</p>
  </blockquote>
  
  <ol>
  <li>If I change character length in key by adding more (ex:40 chars). It gives error</li>
  </ol>
  
  <blockquote>
    <p>Specified key is not a valid size for this algorithm</p>
  </blockquote>
  
  <p>I want to know why is this happen?</p>