module HexaPDF::Encryption::ARC4::ClassMethods

def encrypt(key, data)

See: PDF2.0 s7.6.3

Encrypts the given +data+ with the +key+.
def encrypt(key, data)
  new(key).process(data)
end

def encryption_fiber(key, source)

+key+.
Returns a Fiber object that encrypts the data from the given source fiber with the
def encryption_fiber(key, source)
  Fiber.new do
    algorithm = new(key)
    while source.alive? && (data = source.resume)
      Fiber.yield(algorithm.process(data)) unless data.empty?
    end
  end
end