I am using C # 4.0 Windows Application.I want to provide an encryption key to protect my file with System.Text.ASCIIEncoding.So, here my encryption key is SARAVANAN and the key length is 9.
String enKey="SARAVANAN"; DESCryptoServiceProvider des = new DESCryptoServiceProvider(); des.Key = ASCIIEncoding.ASCII.GetBytes(enKey);
he threw an exception like "The specified key is not a valid size for this algorithm." But it works well only with a length of 8. So I would like to know if there are any restrictions on this length due to this ASCII ENCODING ...
Please help me out of this problem?
Saravanan
source share