Blog | G5 Cyber Security

Truecrypt Password Recovery: Brute Force

TL;DR

This guide shows how to attempt brute-force password recovery on a Truecrypt (or VeraCrypt) encrypted file when you have some partial knowledge of the password. It uses hashcat, a powerful password cracking tool. Be aware that this can take a very long time – days, weeks or even longer – depending on password complexity and length.

Prerequisites

Step-by-step Guide

  1. Determine the Truecrypt/VeraCrypt Hash Type: This is crucial for using hashcat correctly. VeraCrypt uses different hash algorithms than older versions of Truecrypt.
    • If you know which version of Truecrypt or VeraCrypt was used to encrypt the file, consult its documentation to find the correct hash type.
    • Alternatively, you can try to identify it by attempting a crack with common hashes (see Step 3). Hashcat will tell you if the hash is invalid for that algorithm.
  2. Create a Hash File: You need to create a file containing the hash of your encrypted Truecrypt/VeraCrypt volume.
    hashcat --file-type truecrypt .tc > hash.txt

    Replace .tc with the actual name of your encrypted file.

  3. Choose a Wordlist or Mask: This is where you define what passwords Hashcat will try.
    • Wordlists: If you suspect the password is based on common words, use a wordlist (e.g., rockyou.txt). You can find many pre-made wordlists online.
    • Masks: If you know parts of the password (e.g., it starts with ‘abc’ and is 8 characters long), use a mask.
      hashcat --file-type truecrypt hash.txt ?a?a?a?a?a?a?a?a

      This example tries all possible combinations where the first three characters are ‘a’. The ?a represents a lowercase letter (a-z). You can use different character sets:

      • ?l: Lowercase letters
      • ?u: Uppercase letters
      • ?d: Digits
      • ?s: Symbols
      • ?a: All characters (lowercase, uppercase, digits, symbols)
  4. Run Hashcat: Start the cracking process.
    hashcat --file-type truecrypt hash.txt rockyou.txt -m 1400

    Replace rockyou.txt with your chosen wordlist or mask, and 1400 with the correct Truecrypt/VeraCrypt hash type (e.g., 1400 for AES-128, 1700 for Twofish). If you’re using a GPU, Hashcat will automatically use it.

    For more complex masks and options, consult the Hashcat Wiki.

  5. Monitor Progress: Hashcat displays progress information in real-time, including the current cracking speed (hashes per second). The higher the speed, the faster it will crack.

    If you have a GPU, check its temperature to ensure it’s not overheating.

  6. Check Results: If Hashcat finds a password, it will display it in the output. It also saves cracked passwords to a file named hashcat.potfile by default.
    cat hashcat.potfile

    This command displays the contents of the potfile, which contains the recovered password(s).

Important Considerations

Exit mobile version