I want to be able to work with KeePass files in the application I'm planning to develop (as a hobby project), however I could not find any file format specifications for the database file, nor for the key file.
Can someone point me in the right direction?
Export a database as XML to see the format. View the key file in Notepad.
The full DB format will be in the source code.
Unfortunately, there's no documentation or schema for the database. I have spent quite a bit of time working with the kdbx file format (while developing a faster alternative) - the code you want to read is in \KeePassLib\Serialization\KdbxFile.Write.cs
The general structure is some header bytes which describe the encryption parameters for an encrypted data stream, followed by the encrypted stream itself. That stream contains XML, optionally GZipped (before encryption).
XML Key files are trivial, it's just some metadata structure around a base64 encoded key of random bytes, but the source for it is in \KeePassLib\Keys\KcpKeyFile.cs