Skip to main content

Module eexec

Module eexec 

Source
Expand description

Port of fontTools.misc.eexec: the Type 1 charstring and eexec encryption.

PostScript Type 1 fonts use the same cipher for the charstrings (initial key 4330) and for the eexec encrypted part of the font program (initial key 55665). The cipher uses feedback: the ciphertext modifies the key, so the functions here return the key at the end, for continuing later.

Structs§

HexError
binascii.Error: hexadecimal data that cannot be decoded.

Functions§

de_hex_string
deHexString: drops ASCII whitespace (bytes.split()), then binascii.unhexlify.
decrypt
Decrypts cipher with the initial key r (decrypt); returns the plaintext and the key for a subsequent decryption.
encrypt
Encrypts plain with the initial key r (encrypt); returns the ciphertext and the key for a subsequent encryption.
hex_string
hexString: binascii.hexlify, lowercase hexadecimal.
is_ascii_space
Whitespace as bytes.split() sees it.
unhexlify
binascii.unhexlify.