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

◆ Key

override byte [] System.Security.Cryptography.DES.Key
getsetinherited

Definition at line 23 of file DES.cs.

24 {
25 get
26 {
27 byte[] key = base.Key;
28 while (IsWeakKey(key) || IsSemiWeakKey(key))
29 {
31 key = base.Key;
32 }
33 return key;
34 }
35 set
36 {
37 if (value == null)
38 {
39 throw new ArgumentNullException("value");
40 }
41 if (!(value.Length * 8).IsLegalSize(s_legalKeySizes))
42 {
44 }
45 if (IsWeakKey(value))
46 {
47 throw new CryptographicException(System.SR.Cryptography_InvalidKey_Weak, "DES");
48 }
50 {
51 throw new CryptographicException(System.SR.Cryptography_InvalidKey_SemiWeak, "DES");
52 }
53 base.Key = value;
54 }
55 }
static string Cryptography_InvalidKey_SemiWeak
Definition SR.cs:94
static string Cryptography_InvalidKey_Weak
Definition SR.cs:96
static string Cryptography_InvalidKeySize
Definition SR.cs:92
Definition SR.cs:7
static readonly KeySizes[] s_legalKeySizes
Definition DES.cs:18
static bool IsWeakKey(byte[] rgbKey)
Definition DES.cs:77
static bool IsSemiWeakKey(byte[] rgbKey)
Definition DES.cs:92

Referenced by Internal.Cryptography.DesImplementation.CreateDecryptor(), System.Security.Cryptography.DESCryptoServiceProvider.CreateDecryptor(), Internal.Cryptography.DesImplementation.CreateEncryptor(), System.Security.Cryptography.DESCryptoServiceProvider.CreateEncryptor(), Internal.Cryptography.DesImplementation.TryDecryptCbcCore(), Internal.Cryptography.DesImplementation.TryDecryptCfbCore(), Internal.Cryptography.DesImplementation.TryDecryptEcbCore(), Internal.Cryptography.DesImplementation.TryEncryptCbcCore(), Internal.Cryptography.DesImplementation.TryEncryptCfbCore(), and Internal.Cryptography.DesImplementation.TryEncryptEcbCore().