Python Tool Anonymises Sensitive PDF Bank Statements While Preserving Layout
A developer building a UK bank statement parser created a Python tool to anonymise sensitive PDF data without breaking font encoding or document layout. The tool, called bank_statement_anonymiser, uses the pikepdf library to directly modify a PDF's content stream at the byte level, replacing sensitive data rather than overlaying black boxes or swapping text. It targets patterns such as sort codes, account numbers, IBANs, card numbers, merchant names, and transaction values. Unlike traditional redaction methods, the approach preserves the PDF's visual appearance and structural integrity, ensuring anonymised files can still be processed by existing parsers. The tool also supports optional consistency, allowing the same account details across multiple statements to always scramble to the same fake values.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in