new (PDF::Writer::Object::Encryption)

        # File lib/pdf/writer/object/encryption.rb, line 18
    18:   def initialize(parent, options)
    19:     super(parent)
    20:
    21:     @parent.encrypt_obj = self
    22:
    23:       # Figure out the additional parameters required.
    24:     @owner  = "#{options[:owner_pass]}#{PAD}"[0...32]
    25:     @user   = "#{options[:user_pass]}#{PAD}"[0...32]
    26:     @perms  = options[:permissions]
    27:
    28:     @parent.arc4.prepare(Digest::MD5.hexdigest(@owner)[0...5])
    29:
    30:       # Get the 'O' value.
    31:     @owner_info = ARC4.encrypt(@user)
    32:       # Get the 'U' value.
    33:     ukey = @user.dup
    34:     ukey << @owner_info
    35:     ukey << [ @perms, 0xFF, 0xFF, 0xFF ].pack("C*")
    36:     ukey << @parent.file_identifier
    37:     @parent.encryption_key = Digest::MD5.hexdigest(ukey)[0...5]
    38:
    39:     @parent.arc4.prepare(@parent.encryption_key)
    40:
    41:     @user_info = @parent.arc4.encrypt(PAD)
    42:   end