KGB archive
application/octet-stream
Magic Bytes
Offset: 0
4B 49 00 00
The KGB archive is a discontinued compressed file format developed by Tomasz Pawlak, built upon the PAQ6 compression algorithm. It was primarily utilized for archiving data with extremely high compression ratios, significantly reducing file sizes for storage or transmission. Although capable of strong AES-256 encryption, the format is now considered obsolete due to excessive hardware resource requirements and the complete lack of modern software support.
Validation Code
How to validate .kgb files in Python
Python
def is_kgb(file_path: str) -> bool:
"""Check if file is a valid KGB by magic bytes."""
signature = bytes([0x4B, 0x49, 0x00, 0x00])
with open(file_path, "rb") as f:
return f.read(4) == signature
How to validate .kgb files in Node.js
Node.js
function isKGB(buffer: Buffer): boolean {
const signature = Buffer.from([0x4B, 0x49, 0x00, 0x00]);
return buffer.subarray(0, 4).equals(signature);
}
Go
func IsKGB(data []byte) bool {
signature := []byte{0x4B, 0x49, 0x00, 0x00}
if len(data) < 4 {
return false
}
return bytes.Equal(data[:4], signature)
}
API Endpoint
GET
/api/v1/kgb
curl https://filesignature.org/api/v1/kgb