using (ICryptoTransform Encryptor = TDes.CreateEncryptor())
{
OutputBuffer = Encryptor.TransformFinalBlock(InputBuffer, 0, 8);
}
using (ICryptoTransform Decryptor = TDes.CreateDecryptor())
{
OutputBuffer = Decryptor.TransformFinalBlock(InputBuffer, 0, 8);
}
This was the issue, I wan encrypting only 8 characters and that is the reason why I was getting back only 8. This was a real question and not a dumb one. Since many of you had no idea. Thanks for the help or at least for you trying to answer it.
Your only asking for 8:
Encryptor.TransformFinalBlock(InputBuffer, 0, 8)
http://msdn.microsoft.com/en-us/library/system.security.cryptography.icryptotransform.transformfinalblock.aspx
精彩评论