Skip to content

DEB (.deb)

.deb file signature | application/x-debian-package

linux deb file

High

Magic Bytes

Offset 0
21 3C 61 72 63 68 3E 0A 64 65 62 69 61 6E 2D 62 69 6E 61 72 79

Sources: Apache Tika

All Known Signatures

3 signature variants are documented for .deb files across multiple sources.

Hex Signature Offset Sources
21 3C 61 72 63 68 3E 0A 64 65 62 69 61 6E 2D 62 69 6E 61 72 79 0 Apache Tika
21 3C 61 72 63 68 3E 0A 64 65 62 69 61 6E 2D 73 70 6C 69 74 0 Apache Tika
21 3C 61 72 63 68 3E 0A 0 Wikipedia

Extension

.deb

MIME Type

application/x-debian-package

Byte Offset

0

Risk Level

High

Validation Code

How to validate .deb files in Python

Python
def is_deb(file_path: str) -> bool:
    """Check if file is a valid DEB by magic bytes."""
    signature = bytes([0x21, 0x3C, 0x61, 0x72, 0x63, 0x68, 0x3E, 0x0A, 0x64, 0x65, 0x62, 0x69, 0x61, 0x6E, 0x2D, 0x62, 0x69, 0x6E, 0x61, 0x72, 0x79])
    with open(file_path, "rb") as f:
        return f.read(21) == signature

How to validate .deb files in Node.js

Node.js
function isDEB(buffer: Buffer): boolean {
  const signature = Buffer.from([0x21, 0x3C, 0x61, 0x72, 0x63, 0x68, 0x3E, 0x0A, 0x64, 0x65, 0x62, 0x69, 0x61, 0x6E, 0x2D, 0x62, 0x69, 0x6E, 0x61, 0x72, 0x79]);
  return buffer.subarray(0, 21).equals(signature);
}

How to validate .deb files in Go

Go
func IsDEB(data []byte) bool {
    signature := []byte{0x21, 0x3C, 0x61, 0x72, 0x63, 0x68, 0x3E, 0x0A, 0x64, 0x65, 0x62, 0x69, 0x61, 0x6E, 0x2D, 0x62, 0x69, 0x6E, 0x61, 0x72, 0x79}
    if len(data) < 21 {
        return false
    }
    return bytes.Equal(data[:21], signature)
}

API Endpoint

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

See the full API documentation for all endpoints and parameters.

Frequently Asked Questions

What is a .deb file?

A .deb file is a DEB file. linux deb file

What are the magic bytes for .deb files?

The magic bytes for DEB files are 21 3C 61 72 63 68 3E 0A 64 65 62 69 61 6E 2D 62 69 6E 61 72 79 at byte offset 0. These bytes uniquely identify the file format regardless of the file extension.

How do I validate a .deb file?

To validate a .deb file, read the first bytes of the file and compare them against the known magic bytes (21 3C 61 72 63 68 3E 0A 64 65 62 69 61 6E 2D 62 69 6E 61 72 79) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.

What is the MIME type for .deb files?

The primary MIME type for .deb files is application/x-debian-package.

Is it safe to open .deb files?

DEB (.deb) files are high risk because they can contain executable code. Never open .deb files from untrusted sources. Always scan with antivirus software, verify the source, and consider running in a sandboxed environment.