You can download Truecrypt from their website:
TrueCrypt - Free Open-Source On-The-Fly Disk Encryption Software for Windows Vista/XP, Mac OS X and Linux
Made this program to break into a truecrypt container. Started in PHP, then Java, finally C++ lol just thought it would work better.
You need to make sure this is in the truecrypt directory. Make sure to set "charset" and "max"
If you want to change how this works you can check out line 15 and this link
Try using the code below as-is to crack this sample truecrypt container!
Sample File:
http://www.blainesch.com/codecall/file.tc
File passord:
hello
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
//all possible characters in the password
string charset = "helo";
//maximum number of characters in password
int max = 5;
int length = charset.length();
char buffer[60];
char temp[60];
bool check(string password) {
//checks if the password is correct or not
strcpy(temp, password.c_str());
sprintf(buffer, "truecrypt /s /lz /v file.tc /p %s /q", temp);
if(system(buffer)==0) {
cout << "True: " <<password << endl;
return true;
} else {
cout << "False: " << password << endl;
return false;
}
}
bool recurse(int width, int position, string base_string) {
//this just creates the potential passwords recursively
for (int i = 0; i < length; ++i) {
if (position < width - 1) {
if(recurse(width, position + 1, base_string + charset.substr(i, 1))) {
return true;
}
}
//throws it into my test page
if(check(base_string + charset.substr(i, 1))) {
return true;
}
}
return false;
}
main() {
//discounts the Z drive to make sure its not already in use.
system("truecrypt /dz");
recurse(max, 0, "");
int wait;
cout << "Waiting...";
cin >> wait;
}
v1.5
Took an if statement out of "recurse" and put it outside so it only had to check one instead of charset.length() times.
Made it so it guesses 3 passwords at a time. It checks each line just as fast but checks 3 passwords at a time so 3x faster!
#include <iostream>
#include <sstream>
#include <string>
using namespace std;
//all possible characters in the password
string charset = "helo";
int jj = 0;
string jp = "";
int length = charset.length();
char buffer[60];
bool check(string password) {
if(jj == 2) {
jp += " /p "+password;
sprintf(buffer, "truecrypt /q /s /lx /v file.tc %s", jp.c_str());
if(system(buffer)==0) {
cout << "True: " << jp << endl;
return true;
} else {
cout << "False: " << jp << endl;
}
jj = 0;
jp = "";
} else {
jj++;
jp += " /p "+password;
}
return false;
}
bool recurse(int width, int position, string base_string) {
if(position < width - 1) {
for (int i = 0; i < length; ++i) {
if(recurse(width, position + 1, base_string + charset.substr(i, 1))) {
return true;
}
if(check(base_string + charset.substr(i, 1))) {
return true;
}
}
} else {
for (int i = 0; i < length; ++i) {
if(check(base_string + charset.substr(i, 1))) {
return true;
}
}
}
return false;
}
main() {
recurse(5, 0, ""); //insert max width here
int wait;
cout << "Waiting...";
cin >> wait;
}
Attached Files
Edited by BlaineSch, 23 July 2009 - 10:13 PM.


Sign In
Create Account




Back to top









