---
id: "openssh_private_key"
kind: "datatype"
status: "draft"
is_pii: false
categories: ["secrets", "cryptography"]
langs: ["common"]
quality: 70
url: "https://registry.apicrafter.io/datatype/openssh_private_key"
---

# OpenSSH private key (`openssh_private_key`)

> **Draft.** Draft records have not been reviewed yet and may be incomplete or wrong; do not treat them as authoritative for legal or compliance decisions.

Private key in the OpenSSH key format (openssh-key-v1): a Base64 block between the lines -----BEGIN OPENSSH PRIVATE KEY----- and -----END OPENSSH PRIVATE KEY-----, which ssh-keygen writes. Keys in the PEM formats of OpenSSL (RSA PRIVATE KEY, EC PRIVATE KEY, PRIVATE KEY) are the datatype x509_private_key.

- Parent datatype: `private_key`
- Personal data (PII): no
- Categories: Secrets and credentials (passwords, keys, tokens) (secrets), Cryptographic identifiers (cryptography)
- Countries: global
- Languages: Common to most languages (common)
- Classification: identifier

## Detection

Regular expression (Python `re`):

```
^-----BEGIN OPENSSH PRIVATE KEY-----[\s\S]+-----END OPENSSH PRIVATE KEY-----$
```

## Examples

- `-----BEGIN OPENSSH PRIVATE KEY-----` (invalid example) — Header line without the key and the footer

## Supported by tools

- `cloudflaredlp`
- `gitguardian`
- `githubsecretscanning`
- `gitleaks`
- `pywhat`

## Sources

- doc: <https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key>
- other: <https://github.com/openssh/openssh-portable/blob/master/sshkey.c>

## Quality

Score 70/100. Missing: examples, mapping (Wikidata, Schema.org, ...), translation.

JSON: <https://registry.apicrafter.io/api/v1/datatypes/openssh_private_key.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/secrets/openssh_private_key.yaml>
