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()), thenbinascii.unhexlify.- decrypt
- Decrypts
cipherwith the initial keyr(decrypt); returns the plaintext and the key for a subsequent decryption. - encrypt
- Encrypts
plainwith the initial keyr(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.