[Overview][Constants][Types][Procedures and functions] |
Encode a string by XOR-ing its characters using characters of a given key, representing the result as hex values.
Source position: strutils.pp line 160
function XorEncode( |
const Key: String; |
const Source: String |
):String; |
Key |
|
Key to use when encoding. |
Source |
|
String ro encode. |
Original encoded string.
XorEncodeencodes the string Sourceby XOR-ing each character in Sourcewith the corresponding character in Key(repeating Keyas often as necessary) and representing the resulting ASCII code as a hexadecimal number (of length 2). The result is therefore twice as long as the original string, and every 2 bytes represent an ASCII code.
Feeding the resulting string with the same key Keyto the XorDecodefunction will result in the original Sourcestring.
This function can be used e.g. to trivially encode a password in a configuration file.
None.
|
Decode a string encoded with XorEncode |
|
|
Encode a string by XOR-ing its characters using characters of a given key. |
|
|
Converts a hexadecimal string to a decimal value |