KeePass 1 TwoFish (with keyfile) Hash

Technical details, regex signatures, and cracking commands for the KeePass 1 TwoFish (with keyfile) algorithm.

Regex Identification Signature:
^\$keepass\$\*1\*\d+\*\d\*[0-9a-f]{32}\*[0-9a-f]{64}\*[0-9a-f]{32}\*[0-9a-f]{64}\*\d\*[^*]*(\*[0-9a-f]+)?\*\d+\*\d+\*[0-9a-f]{64}$
Hashcat Command (Mode: 13400):
John the Ripper Command:
← Back to Hash Identifier

What is KeePass 1 TwoFish (with keyfile)?

The KeePass 1 TwoFish (with keyfile) hash format is a legacy cryptographic scheme derived from the original KeePass password database format (pre-KeePassXC/KeePass 2.x), which was first introduced in 2003 by Dominik Reichl. This format combines the TwoFish block cipher—a 256-bit key symmetric encryption algorithm designed by Bruce Schneier—with a proprietary hashing mechanism that integrates a keyfile (an optional binary file) to enhance entropy. Structurally, the format stores the hashed password in a fixed-length 32-byte (256-bit) output, derived from a multi-stage process: the user password is first hashed using SHA-256 (or another variant in some implementations), then combined with the keyfile’s contents (if present) via XOR or a simple concatenation, and finally encrypted under TwoFish’s ECB mode with a derived key. The primary use-case was securing password databases by preventing unauthorized access through a layered encryption scheme, though it was never intended for modern cryptographic standards due to its reliance on outdated assumptions about security.

The KeePass 1 TwoFish format is highly vulnerable to cracking due to several fundamental flaws. First, it lacks a cryptographic salt in its hashing process, making it susceptible to rainbow table attacks if the same password is reused across multiple entries. Second, the use of ECB mode without authentication (e.g., no HMAC or integrity check) allows attackers to exploit patterns in plaintext recovery, particularly if the encrypted database contains repeated fields. Third, the format’s reliance on TwoFish’s 256-bit key is mitigated by the lack of key stretching—modern GPUs and FPGA-based cracking tools (e.g., Hashcat’s *twofish* mode) can brute-force the 256-bit space at rates exceeding 100 GH/s, rendering the keyfile’s entropy negligible if the user password is weak. Additionally, the fixed-length output and absence of adaptive resistance to parallel attacks (e.g., no key derivation function like Argon2) make it trivially parallelizable, enabling distributed cracking efforts like those used against older password hashes. Finally, the format’s reliance on a keyfile introduces a single point of failure: if the keyfile is leaked or guessed (e.g., via social engineering), the entire database is compromised without requiring password cracking.

Identifying KeePass 1 TwoFish (with keyfile) Hashes

Identifying a hash blindly is often difficult because multiple algorithms can output strings of the exact same length. For example, a standard 32-character hexadecimal string could be MD5, NTLM, MD4, or LM. To definitively identify KeePass 1 TwoFish (with keyfile), security researchers analyze the hash against a strict regular expression (regex) signature (shown above) to find structural matches.

How to Crack KeePass 1 TwoFish (with keyfile)

If you need to recover the plaintext password for a KeePass 1 TwoFish (with keyfile) hash during a penetration test or forensics investigation, you must supply the correct module ID to your cracking software. Use the exact commands provided at the top of this page to target the hash successfully.