title: C# TripleDESCryptoServiceProvider - how it is possible that it can work with short key
body: <p>I'm trying to port following code to java, but wondering how this can work in C#.
  Provider is being initialized with keySize = 192, but key is only 16 bytes long. 
  When doing this in java I got error about incorrect key size.</p>
  
  <p>Can someone explain what is going on here?</p>
  
  <pre><code>public static byte[] TripleDesEncryptOneBlock(byte[] plainText)
  {
      //This is key of length 16 bytes (128 bits)
      byte[] key = Encoding.ASCII.GetBytes("0123456789abcdef");
      byte[] result;
      try
      {
          int count = (plainText.Length &gt; 8) ? 8 : plainText.Length;
          byte[] array = new byte[8];
          Buffer.BlockCopy(plainText, 0, array, 0, count);
          ICryptoTransform cryptoTransform = new TripleDESCryptoServiceProvider
          {
              KeySize = 192,
              Key = key,
              Mode = CipherMode.ECB,
              Padding = PaddingMode.None
          }.CreateEncryptor();
          byte[] array2 = cryptoTransform.TransformFinalBlock(array, 0, 8);
          result = array2;
      }
      catch (Exception)
      {
          result = null;
      }
      return result;
  }
  </code></pre>