public uint ReadOffset() { var offset = (uint)BaseStream.Position; offset = (offset - FStart) ^ uint.MaxValue; offset *= Hash; offset -= CryptoConstants.WzOffsetConstant; offset = CryptoConstants.RotateLeft(offset, (byte)(offset & 0x1F)); var encryptedOffset = ReadUInt32(); offset ^= encryptedOffset; offset += FStart * 2; return(offset); }
public static WzMutableKey GenerateWzKey(byte[] WzIv) { return(new WzMutableKey(WzIv, CryptoConstants.GetTrimmedUserKey())); }
public static WzMutableKey GenerateWzKey(byte[] wzIv) => new WzMutableKey(wzIv, CryptoConstants.GetTrimmedUserKey());
public static byte[] GenerateWzKey(byte[] WzIv) { return(GenerateWzKey(WzIv, CryptoConstants.getTrimmedUserKey())); }
public WzBinaryReader(Stream input, byte[] wzIv) : base(input) { WzKey = CryptoConstants.GenerateWzKey(wzIv); }
public WzBinaryReader(Stream input, WzMapleVersion mapleVersion) : base(input) { WzKey = new WzMutableKey(mapleVersion.EncryptionKey(), CryptoConstants.GetTrimmedUserKey(mapleVersion)); }
public WzBinaryReader(Stream input, byte[] WzIv) : base(input) { WzKey = new WzMutableKey(WzIv, CryptoConstants.GetTrimmedUserKey()); }
/// <summary> /// Encrypts data with AES and updates the IV /// </summary> /// <param name="data"> The data to crypt </param> public void Crypt(byte[] data) { AESEncryption.AESCrypt(IV, data, data.Length, CryptoConstants.GetTrimmedUserKey()); UpdateIV(); }