iso8583sim.security.pinblock
For testing and simulation only. Real PIN handling happens inside an HSM, and clear PINs
and keys must never pass through application code like this.
Functions
encode_pin_block()
str
required
4 to 12 digit PIN
str | None
default:"None"
Primary Account Number (required for formats 0 and 3)
int
default:"0"
PIN block format: 0, 1 or 3
bytes
The 8-byte clear PIN block
decode_pin_block()
encrypt_pin_block()
str
required
4 to 12 digit PIN
str | None
required
Primary Account Number (not used by format 1)
str | bytes
required
PIN encryption key as bytes or hex
int
default:"0"
PIN block format: 0, 1, 3 or 4
str
The encrypted PIN block as uppercase hex
decrypt_pin_block()
SecurityError: The block doesn’t decode to a valid PIN block