/// <summary> /// Initializes a new instance of the <see cref="Decryptor"/> class. /// </summary> /// <param name="decryptionKey">The decryption key.</param> /// <param name="xor32Key">The xor32 key.</param> public Decryptor(SimpleModulusKeys decryptionKey) { this.AddDecryptor(new SimpleModulusDecryptor(decryptionKey) { AcceptWrongBlockChecksum = true }); }
/// <summary> /// Initializes a new instance of the <see cref="Decryptor"/> class. /// </summary> /// <param name="decryptionKey">The decryption key.</param> /// <param name="xor32Key">The xor32 key.</param> public Decryptor(SimpleModulusKeys decryptionKey, byte[] xor32Key) { this.AddDecryptor(new SimpleModulusDecryptor(decryptionKey) { AcceptWrongBlockChecksum = true }) .AddDecryptor(new Xor32Decryptor(xor32Key)); }
/// <summary> /// Creates an instance of <see cref="SimpleModulusKeys"/> with the crypt key as <see cref="EncryptKey"/>. /// </summary> /// <param name="encryptionKey">The decryption key with 12 integers.</param> /// <returns>An instance of <see cref="SimpleModulusKeys"/> with the crypt key as <see cref="EncryptKey"/>.</returns> public static SimpleModulusKeys CreateEncryptionKeys(uint[] encryptionKey) { var keys = new SimpleModulusKeys(); keys.ModulusKey[0] = encryptionKey[0]; keys.ModulusKey[1] = encryptionKey[1]; keys.ModulusKey[2] = encryptionKey[2]; keys.ModulusKey[3] = encryptionKey[3]; keys.EncryptKey[0] = encryptionKey[4]; keys.EncryptKey[1] = encryptionKey[5]; keys.EncryptKey[2] = encryptionKey[6]; keys.EncryptKey[3] = encryptionKey[7]; keys.XorKey[0] = encryptionKey[8]; keys.XorKey[1] = encryptionKey[9]; keys.XorKey[2] = encryptionKey[10]; keys.XorKey[3] = encryptionKey[11]; return(keys); }
/// <summary> /// Initializes a new instance of the <see cref="PipelinedEncryptor"/> class. /// </summary> /// <param name="target">The target pipe writer.</param> /// <param name="encryptionKeys">The encryption keys.</param> public PipelinedEncryptor(PipeWriter target, SimpleModulusKeys encryptionKeys) : base(target, encryptionKeys) { }
/// <summary> /// Initializes a new instance of the <see cref="Decryptor"/> class. /// </summary> /// <param name="decryptionKey">The decryption key.</param> /// <param name="xor32Key">The xor32 key.</param> public Decryptor(SimpleModulusKeys decryptionKey, byte[] xor32Key) { this.AddDecryptor(new SimpleModulusDecryptor(decryptionKey)) .AddDecryptor(new Xor32Decryptor(xor32Key)); }
/// <summary> /// Initializes a new instance of the <see cref="PipelinedDecryptor"/> class. /// </summary> /// <param name="source">The source.</param> /// <param name="decryptionKeys">The decryption keys.</param> /// <param name="xor32Key">The xor32 key.</param> public PipelinedDecryptor(PipeReader source, SimpleModulusKeys decryptionKeys, byte[] xor32Key) : base(new PipelinedSimpleModulusDecryptor(source, decryptionKeys).Reader, xor32Key) { }
/// <summary> /// Initializes a new instance of the <see cref="Encryptor"/> class. /// </summary> /// <param name="encryptionKey">The encryption key.</param> public Encryptor(SimpleModulusKeys encryptionKey) { this.AddEncryptor(new Xor32Encryptor()) .AddEncryptor(new SimpleModulusEncryptor(SimpleModulusEncryptor.DefaultClientKey)); }
/// <summary> /// Initializes a new instance of the <see cref="Encryptor"/> class. /// </summary> /// <param name="encryptionKey">The encryption key.</param> public Encryptor(SimpleModulusKeys encryptionKey) { this.AddEncryptor(new SimpleModulusEncryptor(encryptionKey)); }