Example #1
0
        // Token: 0x060003D5 RID: 981 RVA: 0x00019244 File Offset: 0x00017444
        internal Class_158(Stream stream_, Class_157 arg_0, Class_161 arg_1)
        {
            this.field_1 = arg_0;
            this.field_2 = stream_;
            this.field_3 = arg_1;
            this.field_4 = 1;
            if (this.field_1 == null)
            {
                throw new Class_136("Supply a password to use AES encryption.");
            }
            int num = this.field_1.prop_5.Length * 8;

            if (num != 256 && num != 128 && num != 192)
            {
                throw new ArgumentOutOfRangeException("keysize", "size of key must be 128, 192, or 256");
            }
            this.field_6           = new HMACSHA1(this.field_1.prop_6);
            this.field_7           = new RijndaelManaged();
            this.field_7.BlockSize = 128;
            this.field_7.KeySize   = num;
            this.field_7.Mode      = CipherMode.ECB;
            this.field_7.Padding   = PaddingMode.None;
            byte[] rgbIV = new byte[16];
            this.field_8 = this.field_7.CreateEncryptor(this.field_1.prop_5, rgbIV);
            if (this.field_3 == Class_161.Encrypt)
            {
                this.field_15 = new byte[2048];
                this.field_13 = new byte[16];
            }
        }
Example #2
0
        // Token: 0x060003C8 RID: 968 RVA: 0x00018F7C File Offset: 0x0001717C
        public static Class_157 kmethod_537(string str_0, int sayıInt_0)
        {
            Class_157 class_ = new Class_157(str_0, sayıInt_0);
            int       num    = class_.prop_2 / 2;

            class_.field_0 = new byte[num];
            Random random = new Random();

            random.NextBytes(class_.field_0);
            return(class_);
        }
Example #3
0
        // Token: 0x060003C9 RID: 969 RVA: 0x00018FBC File Offset: 0x000171BC
        public static Class_157 lmethod_538(string str_0, int sayıInt_0, Stream stream_)
        {
            Class_157 class_ = new Class_157(str_0, sayıInt_0);
            int       num    = class_.prop_2 / 2;

            class_.field_0 = new byte[num];
            class_.field_1 = new byte[2];
            stream_.Read(class_.field_0, 0, class_.field_0.Length);
            stream_.Read(class_.field_1, 0, class_.field_1.Length);
            class_.field_7 = (short)((int)class_.field_1[0] + (int)class_.field_1[1] * 256);
            if (str_0 != null)
            {
                class_.field_8 = (short)((int)class_.prop_0[0] + (int)class_.prop_0[1] * 256);
                if (class_.field_8 != class_.field_7)
                {
                    throw new Class_136("bad password");
                }
            }
            return(class_);
        }
Example #4
0
 // Token: 0x060003D4 RID: 980 RVA: 0x00019231 File Offset: 0x00017431
 internal Class_158(Stream stream_, Class_157 arg_0, long sayıUınt_0, Class_161 arg_1) : this(stream_, arg_0, arg_1)
 {
     this.field_11 = sayıUınt_0;
 }