Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ IsWeakKey()

static bool System.Security.Cryptography.TripleDES.IsWeakKey ( byte[] rgbKey)
inlinestaticinherited

Definition at line 70 of file TripleDES.cs.

71 {
72 if (rgbKey == null)
73 {
74 throw new CryptographicException(System.SR.Cryptography_InvalidKeySize);
75 }
76 if (!(rgbKey.Length * 8).IsLegalSize(s_legalKeySizes))
77 {
78 throw new CryptographicException(System.SR.Cryptography_InvalidKeySize);
79 }
80 byte[] array = rgbKey.FixupKeyParity();
81 if (EqualBytes(array, 0, 8, 8))
82 {
83 return true;
84 }
85 if (array.Length == 24 && EqualBytes(array, 8, 16, 8))
86 {
87 return true;
88 }
89 return false;
90 }
static string Cryptography_InvalidKeySize
Definition SR.cs:92
Definition SR.cs:7
static readonly KeySizes[] s_legalKeySizes
Definition TripleDES.cs:15
static bool EqualBytes(byte[] rgbKey, int start1, int start2, int count)
Definition TripleDES.cs:92

References System.array, System.SR.Cryptography_InvalidKeySize, System.Security.Cryptography.TripleDES.EqualBytes(), and System.Security.Cryptography.TripleDES.s_legalKeySizes.

Referenced by System.Security.Cryptography.TripleDESCng.IsWeakKey().