Reverse Engineered KeePass (KDBX) File Format


Integers are stored in little endian format.

*Magic bytes

8 bytes:

0x03, 0xd9, 0xa2, 0x9a, 0x67, 0xfb, 0x4b, 0xb5

The magic bytes are used as a first check to determine if a file could be a KDBX file.

*Format version

This field is uint32, where the upper 16 bits represent the major version, and the lower 16 bits represent the minor version.

Version 2.20.1: 0x003001

*Header

The header consists of a number of header fields. The order of the fields is not important. Header fields are read until the end of header field is encountered. A header field starts with a header with the following structure:

uint8 id

uint16 size of field data

followed by the field data.

Header fields

end of header