PPK (.ppk)
.ppk file signature | application/octet-stream
PuTTYprivate key file version 2
Magic Bytes
Offset 0
50 75 54 54 59 2D 55 73 65 72 2D 4B 65 79 2D 46 69 6C 65 2D 32 3A
Sources: Wikipedia
All Known Signatures
2 signature variants are documented for .ppk files across multiple sources.
Extension
.ppk
MIME Type
application/octet-stream
Byte Offset
0
Risk Level
Safe
Validation Code
How to validate .ppk files in Python
def is_ppk(file_path: str) -> bool:
"""Check if file is a valid PPK by magic bytes."""
signature = bytes([0x50, 0x75, 0x54, 0x54, 0x59, 0x2D, 0x55, 0x73, 0x65, 0x72, 0x2D, 0x4B, 0x65, 0x79, 0x2D, 0x46, 0x69, 0x6C, 0x65, 0x2D, 0x32, 0x3A])
with open(file_path, "rb") as f:
return f.read(22) == signature
How to validate .ppk files in Node.js
function isPPK(buffer: Buffer): boolean {
const signature = Buffer.from([0x50, 0x75, 0x54, 0x54, 0x59, 0x2D, 0x55, 0x73, 0x65, 0x72, 0x2D, 0x4B, 0x65, 0x79, 0x2D, 0x46, 0x69, 0x6C, 0x65, 0x2D, 0x32, 0x3A]);
return buffer.subarray(0, 22).equals(signature);
}
How to validate .ppk files in Go
func IsPPK(data []byte) bool {
signature := []byte{0x50, 0x75, 0x54, 0x54, 0x59, 0x2D, 0x55, 0x73, 0x65, 0x72, 0x2D, 0x4B, 0x65, 0x79, 0x2D, 0x46, 0x69, 0x6C, 0x65, 0x2D, 0x32, 0x3A}
if len(data) < 22 {
return false
}
return bytes.Equal(data[:22], signature)
}
API Endpoint
/api/v1/ppk
curl https://filesignature.org/api/v1/ppk
See the full API documentation for all endpoints and parameters.
Frequently Asked Questions
What is a .ppk file?
A .ppk file is a PPK file. PuTTYprivate key file version 2
What are the magic bytes for .ppk files?
The magic bytes for PPK files are 50 75 54 54 59 2D 55 73 65 72 2D 4B 65 79 2D 46 69 6C 65 2D 32 3A at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.
How do I validate a .ppk file?
To validate a .ppk file, read the first bytes of the file and compare them against the known magic bytes (50 75 54 54 59 2D 55 73 65 72 2D 4B 65 79 2D 46 69 6C 65 2D 32 3A) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.
What is the MIME type for .ppk files?
There is no officially registered MIME type for .ppk files. Systems typically use application/octet-stream as a generic fallback when handling this format.
Is it safe to open .ppk files?
PPK (.ppk) files are generally safe to open. They are classified as low risk because they primarily contain data rather than executable code. However, always ensure files come from a trusted source.