NITF
image/nitf
Magic Bytes
Offset: 0
4E 49 54 46 30 31 2E 31 30
National Imagery Transmission Format (NITF) is a comprehensive standard for imagery exchange developed by the United States Department of Defense and maintained by the National Geospatial-Intelligence Agency. It is primarily utilized within intelligence and defense sectors for the transmission of high-resolution satellite imagery and complex geospatial datasets. While this specific version has been largely superseded by newer iterations, the format remains a critical standard requiring robust parsing to prevent vulnerabilities associated with processing complex metadata.
Validation Code
How to validate .nitf files in Python
Python
def is_nitf(file_path: str) -> bool:
"""Check if file is a valid NITF by magic bytes."""
signature = bytes([0x4E, 0x49, 0x54, 0x46, 0x30, 0x31, 0x2E, 0x31, 0x30])
with open(file_path, "rb") as f:
return f.read(9) == signature
How to validate .nitf files in Node.js
Node.js
function isNITF(buffer: Buffer): boolean {
const signature = Buffer.from([0x4E, 0x49, 0x54, 0x46, 0x30, 0x31, 0x2E, 0x31, 0x30]);
return buffer.subarray(0, 9).equals(signature);
}
Go
func IsNITF(data []byte) bool {
signature := []byte{0x4E, 0x49, 0x54, 0x46, 0x30, 0x31, 0x2E, 0x31, 0x30}
if len(data) < 9 {
return false
}
return bytes.Equal(data[:9], signature)
}
API Endpoint
GET
/api/v1/nitf
curl https://filesignature.org/api/v1/nitf