From Scantegrity Wiki
Invisible Ink Symbol Generator Module
The Invisible Ink Symbol Generator (IISG) Module processes symbols and produces an image of the symbols with a background of reactive ink and a foreground (font color) or non-reactive (dummy) ink. The images produced by this module are embedded into ballot files that are printed on an invisible ink-capable printer. The generated images is straightforward, but the module has a number of extra functions to increase the security properties of the printed ink.
IISG provides the following functions:
- Generate — Generates an Invisible Ink Image using the specified size, font, and other formatting data.
- GenBlocks — Takes a generated image and creates contiguous blocks of a given size, with a given amount of horizontal and vertical white spaces on each block. See the diagram for an illustration. N.B. Should not be used with anti-aliased fonts.
- Munge — On a pixel by pixel basis, randomly add or subtract from the "brightness" of a given image.
- BlockMunge — On a block by block basis, randomly add or subtract from the "brightness" of a given image.
- Mask — On a pixel by pixel basis, apply a random amount of cyan.
- BlockMask — On a block by block basis, apply a random amount of cyan.
- GetBMP — Return a bitmap of the generated image.
Any function above that relies on a random function is assumed to be taking as a parameter a pre-keyed cryptographically secure pseudo-random number generator. Also, white is considered a "null" color and any operations on it should return white.