this is my class which Encrypts / Decrypts the string, But i am getting the error in the KeGen() Routine
Error is
System.Security.Cryptography.CryptographicException: 'Specified key is not a valid size for this algorithm.'

Actually the below code Works fine (Same version) in vb.net Application, but Why fails in C#

c# Code:
  1. namespace GoAppLibrary.EncryptionServices
  2. {
  3.    public  class AESencryptionProvider
  4.     {
  5.         private TripleDESCryptoServiceProvider TripleDes = new TripleDESCryptoServiceProvider();
  6.         private String Key  = "128" ;
  7.  
  8.         private String _encryptedtext;
  9.         private String _PlainText;
  10.  
  11.         public AESencryptionProvider(string PlainText)
  12.         {
  13.             _PlainText = PlainText;
  14.             KeyGen();
  15.         }
  16.    
  17.     public AESencryptionProvider(String EncryptedString , Boolean Decrypt)
  18.         {
  19.             _encryptedtext = EncryptedString;
  20.             KeyGen();
  21.         }
  22.  
  23.         private void KeyGen()
  24.         {
  25. // getting Error
  26. //
  27.             // Initialize the crypto provider.
  28.             int Tk = TripleDes.KeySize / 8;
  29.             int Tb = TripleDes.BlockSize / 8;
  30.  
  31.         TripleDes.Key = TruncateHash(Key, TripleDes.KeySize / 8);
  32.             TripleDes.IV = TruncateHash("",Tb );
  33.         }
  34.        
  35.         private Byte[]  TruncateHash(String key , int length )
  36.         {
  37.             SHA1CryptoServiceProvider sha1 = new SHA1CryptoServiceProvider();
  38.  
  39.             // Hash the key.
  40.             Byte[] keyBytes = System.Text.Encoding.Unicode.GetBytes(key);
  41.  
  42.             byte[] hash = sha1.ComputeHash(keyBytes);
  43.  
  44.             // Truncate or pad the hash.
  45.             Array.Resize(ref hash,  length -1);
  46.  
  47.             return hash;
  48.  
  49.         }
  50.  
  51.         private String EncryptData()
  52.         {
  53.             // Convert the plaintext string to a byte array.
  54.             byte[] plaintextBytes = System.Text.Encoding.Unicode.GetBytes(_PlainText);
  55.  
  56.             // Create the stream.
  57.         MemoryStream ms = new MemoryStream();
  58.  
  59.         // Create the encoder to write to the stream.
  60.         CryptoStream encStream = new CryptoStream(ms,TripleDes.CreateEncryptor(), System.Security.Cryptography.CryptoStreamMode.Write);
  61.  
  62.  
  63.             // Use the crypto stream to write the byte array to the stream.
  64.             encStream.Write(plaintextBytes, 0, plaintextBytes.Length);
  65.             encStream.FlushFinalBlock();
  66.  
  67.  
  68.             //  Convert the encrypted stream to a printable string.
  69.             return Convert.ToBase64String(ms.ToArray());
  70.  
  71.         }
  72.  
  73.    
  74.  
  75.           private String DecryptData()
  76.         {
  77.             // Convert the encrypted text string to a byte array.
  78.             byte[] encryptedBytes = Convert.FromBase64String(_encryptedtext);
  79.  
  80.             // Create the stream.
  81.             MemoryStream ms = new MemoryStream();
  82.  
  83.             // Create the decoder to write to the stream.
  84.             CryptoStream decStream = new CryptoStream(ms, TripleDes.CreateDecryptor(), CryptoStreamMode.Write);
  85.  
  86.             // Use the crypto stream to write the byte array to the stream.
  87.             decStream.Write(encryptedBytes, 0, encryptedBytes.Length);
  88.             decStream.FlushFinalBlock();
  89.  
  90.             // Convert the plaintext stream to a string.
  91.             return Encoding.Unicode.GetString(ms.ToArray());      
  92.  
  93.         }
  94.        
  95.         public String EncryptedOutput
  96.         {
  97.             get { return EncryptData(); }
  98.         }
  99.  
  100.         public String DecryptedOutput
  101.         {
  102.             get { return DecryptData(); }
  103.         }
  104.  
  105.     }
  106. }
Any body help to fix it please.