sanitize - Command option to sanitize models
Synopsis
host% gridlabd model_name.glm --sanitize
Description
The sanitizing process destroys the name and position data of objects in a GLM file. This can be used to protect sensitive data is models.
Object names are obfuscated by generating a unique hexadecimal number and appending it to the sanitize_prefix string.
Object positions are obfuscated by moving the latitude by +/-5 degrees and the longtitude by +/-180 degrees.
When the process runs, an index file can be output to allow future recovery of the names and positions, if desired.
The follow global variables can be used to control the sanitizing process.
- sanitize
- Specifies the sanitizing options. The current valid options are NAMES and POSITIONS. The default is to sanitize both names and positions.
- sanitize_index
- Specifies the name of the sanitizing index file. If the index is ".xml" or ".txt", then "-index.xml" or "-index.txt" will be appended to the base model name (the ".glm" is truncated). Only XML and TXT file types are recognized. The default index file is "modelname-index.txt".
- sanitize_offset
- Specifies the lat/lon offset to use when changing the position of objects. Offsets are specified as either lat,lon or lat/lon where lat and lon are decimal values in the range ±90 and ±180, respectively. If the offset is blank, a random value in the range ±5 and ±180, respectively, is used. If the offset is destroy all the latitude and longitude information found in objects is completely erased. The erased values cannot be recovered from the index file.
- sanitize_prefix
- Specifies the prefix to use on names. The default is "GLD_". Prefixes are strongly recommended because the obfuscated names can begin with a digit, which is not allowed in GridLAB-D unless relax_naming_rules is used.
Examples
The following example sanitizes the GLM file sensitive.glm and outputs an index file sensitive-index.txt
host% gridlabd sensitive.glm --sanitize
The following example only sanitized the object names and outputs the index file as an XML file named index.xml:
host% gridlabd sensitive.glm -D sanitize=NAMES -D sanitize_index=index.xml --sanitize
Caveats
Coordinates above +85N latitude or below -85S latitude may be corrupted irretrievably because positions can be moved by as much as ±5 degrees, go above or below ±90 and get truncated.