编程语言
首页 > 编程语言> > DES/3DES算法_.net检测弱密钥

DES/3DES算法_.net检测弱密钥

作者:互联网

参考文献https://blog.csdn.net/MHSMIE/article/details/52353111?spm=1001.2014.3001.5502

1 Type t = Type.GetType("System.Security.Cryptography.CryptoAPITransformMode");
2             object obj = t.GetField("Encrypt", BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly).GetValue(t);
3             MethodInfo mi = des3.GetType().GetMethod("_NewEncryptor", BindingFlags.Instance | BindingFlags.NonPublic);
4             ICryptoTransform desCrypt = (ICryptoTransform)mi.Invoke(des3, new object[] { byteKey, CipherMode.ECB, null, 0, obj });
具体代码

 

标签:3DES,_.,DES,Instance,NonPublic,BindingFlags,ICryptoTransform,net,Type
来源: https://www.cnblogs.com/qq-2311024/p/15385585.html