I'm using dll for cryptography(des) which written by someone.Dll includes encrypt,decyrpt class,and that classes includes methods.Des required 8 bytes(64 bit) key.I describes a string for key.(a character is one byte).And then encoding bytes.
string keyText= "abcdefghsdsdfsdfsdf";
UTF8Encoding encoding = new UTF8Encoding();
byte[] keyfile = new byte[8];
keyfile = UTF8Encoding.UTF8.GetBytes(keyValue);
above way,even though i described size of byte array 8,size of byte array overflow,it s been length of string value.
Any suggestion. Thanks.
new byte[8], not 7?System.Security.Cryptography.GetBytesreturns a new byte array.