Skip to content

PGP (.pgp)

.pgp file signature | application/pgp-encrypted

PGP file[78]

Safe

Magic Bytes

Offset 0
85

Sources: Apache Tika

All Known Signatures

2 signature variants are documented for .pgp files across multiple sources.

Hex Signature Offset Sources
85 0 Apache Tika
85 03 0 Wikipedia

Extension

.pgp

MIME Type

application/pgp-encrypted

Byte Offset

0

Risk Level

Safe

Validation Code

How to validate .pgp files in Python

Python
def is_pgp(file_path: str) -> bool:
    """Check if file is a valid PGP by magic bytes."""
    signature = bytes([0x85])
    with open(file_path, "rb") as f:
        return f.read(1) == signature

How to validate .pgp files in Node.js

Node.js
function isPGP(buffer: Buffer): boolean {
  const signature = Buffer.from([0x85]);
  return buffer.subarray(0, 1).equals(signature);
}

How to validate .pgp files in Go

Go
func IsPGP(data []byte) bool {
    signature := []byte{0x85}
    if len(data) < 1 {
        return false
    }
    return bytes.Equal(data[:1], signature)
}

API Endpoint

GET /api/v1/pgp
curl https://filesignature.org/api/v1/pgp

See the full API documentation for all endpoints and parameters.

Frequently Asked Questions

What is a .pgp file?

A .pgp file is a PGP file. PGP file[78]

What are the magic bytes for .pgp files?

The magic bytes for PGP files are 85 at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.

How do I validate a .pgp file?

To validate a .pgp file, read the first bytes of the file and compare them against the known magic bytes (85) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.

What is the MIME type for .pgp files?

The primary MIME type for .pgp files is application/pgp-encrypted.

Is it safe to open .pgp files?

PGP (.pgp) 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.