Sign in Join
FPDoc Onlineexperiment

XorDecode function

In unit StrUtils

Decode a string encoded with XorEncode.

Declaration

pascal
function XorDecode(const Key: Ansistring; const Source: Ansistring)
: Ansistring

Arguments

Key

Key to use when decoding.

Source

String to decode.

Function result

Hexadecimal representation of the XOR-encoded string.

Description

XorDecode decodes Source and returns the original string that was encrypted using XorEncode with key Key. If a different key is used than the key used to encode the string, the result will be unreadable.

Errors

If the string Source is not a valid XorEncode result (e.g. contains non-numerical characters), then a EConversionError exception will be raised.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.