This class performs basic XOR encoding.
This method encodes the supplied data, taking into account the badchar list, and returns the encoded buffer.
# File lib/rex/encoder/xor.rb, line 32 def encode(data, badchars = '', opts = { }) self.raw = data self.badchars = badchars self.opts = opts # apply any transforms to the plaintext data data = _unencoded_transform(data) self.encoded, self.key, self.fkey = encoder().find_key_and_encode(data, badchars) # apply any transforms to the encoded data self.encoded = _encoded_transform(encoded) return _prepend() + encoded + _append() end
Generated with the Darkfish Rdoc Generator 2.