Tools › Entity types

Credentials and secrets

Redact private keys from text, JSON, and CSV

A private key block is trivially detectable by its header, which makes it one of the few secrets you can catch with certainty. Redactly flags the BEGIN header, then extends the span to the matching END marker so the key material goes with it.

Try it on the live API No signup. 2,000 characters, 20 runs per 10 minutes.
Output appears here.

How Redactly detects private keys

  • Matched by regex on the BEGIN header for RSA, EC, OpenSSH, and PGP private keys.
  • The whole PEM block is replaced when the matching END marker is present, and the header alone is caught when a paste was truncated.
  • Runs independently of the model, so no context is required.

Why redact private keys?

A private key compromises every signature and handshake it backs, retroactively and prospectively.

Example request

curl -X POST https://api.bitbanger.in/v1/redact \
  -H "X-API-Key: rdct_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"text": "Key loaded: -----BEGIN RSA PRIVATE KEY----- MIIEowIBAAKCAQEA...", "style": "replace"}'

Every hit in the response carries entity, text, start, and end. The offsets index into the text you sent, so you can apply the redactions to your own copy of the document. The full response schema is in the API reference.

Questions

Does Redactly redact private keys automatically?

Yes. Send text to the API and every detected type is redacted, including private keys. To redact only this type, pass the value credential.private_key in the entities filter. No training or configuration is required.

What happens to private keys after redaction?

With style set to replace, each match becomes [credential.private_key] — the entity type in square brackets. Setting style to mask replaces every character with a block character, and remove deletes the span entirely.

Related entity types

Redact private keys in production

Get an API key and send your first request in a minute. Plans start at $24/month.

See pricing