开发者

Why do I only get 8 digits back? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. 开发者_高级运维 Closed 12 years ago.
        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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜