piighost/private-key-block

PEM armoured private key, from the BEGIN header to the matching END footer, covering the RSA, EC, DSA, OPENSSH, ENCRYPTED and PGP PRIVATE KEY BLOCK variants. The body is bounded at twenty thousand characters so the whole block is redacted as one span instead of leaving the base64 payload behind. Honest limit: a key truncated by a paste or by a log line limit has no END footer and is missed. BEGIN CERTIFICATE and BEGIN PUBLIC KEY are deliberately left alone, they are not secrets. No collision with any existing pattern, nothing else matches five-dash armour.

Label: PRIVATE_KEY_BLOCK

Pattern

-----BEGIN [A-Z0-9 ]{0,40}PRIVATE KEY(?: BLOCK)?-----[\s\S]{0,20000}?-----END [A-Z0-9 ]{0,40}PRIVATE KEY(?: BLOCK)?-----

Must be caught

Must be left alone

Tags: international, secrets, software-dev

Download the detector as TOML