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

◆ CreateTransform()

ICryptoTransform Internal.Cryptography.DesImplementation.CreateTransform ( byte[] rgbKey,
byte[] rgbIV,
bool encrypting )
inlineprivate

Definition at line 45 of file DesImplementation.cs.

46 {
47 if (rgbKey == null)
48 {
49 throw new ArgumentNullException("rgbKey");
50 }
51 long num = (long)rgbKey.Length * 8L;
52 if (num > int.MaxValue || !((int)num).IsLegalSize(LegalKeySizes))
53 {
55 }
56 if (DES.IsWeakKey(rgbKey))
57 {
59 }
60 if (DES.IsSemiWeakKey(rgbKey))
61 {
63 }
64 if (rgbIV != null)
65 {
66 long num2 = (long)rgbIV.Length * 8L;
67 if (num2 != BlockSize)
68 {
70 }
71 }
72 if (Mode == CipherMode.CFB)
73 {
75 }
76 return CreateTransformCore(Mode, Padding, rgbKey, rgbIV, BlockSize / 8, FeedbackSize / 8, this.GetPaddingSize(Mode, FeedbackSize), encrypting);
77 }
static void ValidateCFBFeedbackSize(int feedback)
static UniversalCryptoTransform CreateTransformCore(CipherMode cipherMode, PaddingMode paddingMode, byte[] key, byte[] iv, int blockSize, int feedbackSize, int paddingSize, bool encrypting)
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
static string Cryptography_InvalidIVSize
Definition SR.cs:102
Definition SR.cs:7
static bool IsWeakKey(byte[] rgbKey)
Definition DES.cs:77
static bool IsSemiWeakKey(byte[] rgbKey)
Definition DES.cs:92

References System.Security.Cryptography.SymmetricAlgorithm.BlockSize, Internal.Cryptography.DesImplementation.CreateTransformCore(), System.SR.Cryptography_InvalidIVSize, System.SR.Cryptography_InvalidKey_SemiWeak, System.SR.Cryptography_InvalidKey_Weak, System.SR.Cryptography_InvalidKeySize, System.Security.Cryptography.SymmetricAlgorithm.FeedbackSize, System.Security.Cryptography.DES.IsSemiWeakKey(), System.Security.Cryptography.DES.IsWeakKey(), System.L, System.Security.Cryptography.SymmetricAlgorithm.LegalKeySizes, System.Security.Cryptography.SymmetricAlgorithm.Padding, and Internal.Cryptography.DesImplementation.ValidateCFBFeedbackSize().

Referenced by Internal.Cryptography.DesImplementation.CreateDecryptor(), Internal.Cryptography.DesImplementation.CreateDecryptor(), Internal.Cryptography.DesImplementation.CreateEncryptor(), and Internal.Cryptography.DesImplementation.CreateEncryptor().