+ Reply to Thread
Results 1 to 3 of 3

Thread: Java + Truecrypt + Windows

  1. #1
    Code Warrior BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch's Avatar
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Age
    20
    Posts
    2,223
    Blog Entries
    8

    Java + Truecrypt + Windows

    Basically I am trying to make a program using Java to mount a Truecrypt container. I am basically using this code now to actually do that part:

    Code:
            Process p = Runtime.getRuntime().exec("C:\\\\Program Files\\truecrypt\\truecrypt /s /v "+container+" /p "+password+" /q");
    Where container is obviously the .tc file and password is the password.

    Right now it has the /s command which means its silent - If I put in the wrong password it wont prompt me to enter in a new one. Which is what I want since its basically going to true a few different passwords. I want it to handle all the errors. But If I have the /s it wont give me anything hince the "silence" part of it. But I want it to let me know if it worked or not. If I use /s it does nothing either way. If I dont use it it will work and then do nothing or prompt me with the truecrypt program.

    My idea now is to set the drive to a known letter and check if the drive exists or something. But that might take too long when you get to 1 billion checks.

  2. #2
    Code Warrior BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch's Avatar
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Age
    20
    Posts
    2,223
    Blog Entries
    8

    Re: Java + Truecrypt + Windows

    Well I tried a few things:
    • Dir
    • cd
    • chdsk

    I finally found one that gave me something close to what I needed and that was "find" lol

    Basically I search for a string in "Z:\\" which is the directory I specify the container to mount to. If it returns "File not found" it does not work if it contains something else it worked.

    It does work sorta... I did a test run and the password being "hello" it got the correct password but didnt get anything until about 10 passwords later.
    ...
    hello
    hell
    heloh
    heloe
    helol
    heloo
    helo
    hel
    heohh
    heohe
    heohl
    heoho
    Password: heoho
    Code:
    try {
    	this.p = Runtime.getRuntime().exec("C:\\\\Program Files\\truecrypt\\truecrypt /s /lz /v G:\\hello.tc /p "+password+" /q");
    	this.p = Runtime.getRuntime().exec("find \"hello\" Z:\\\\");
    	this.stdError = new BufferedReader(new 
    		 InputStreamReader(p.getErrorStream()));
    	if(!this.stdError.readLine().equals("File not found - Z:\\\\")) {
    		System.out.println("Password: "+password);
    		System.exit(1);
    	}
    } catch (IOException e) {
    	e.printStackTrace();
    } catch (NullPointerException e) {
    	e.printStackTrace();
    }

  3. #3
    Code Warrior BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch's Avatar
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Age
    20
    Posts
    2,223
    Blog Entries
    8

    Re: Java + Truecrypt + Windows

    Well I think I found a decent way to do it so I will go ahead and run it. I am moving tonight. So I will be gone for a few days until I get a computer setup.

    Later!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Tutorial: Starting Java Using Netbeans
    By Jordan in forum Java Tutorials
    Replies: 4
    Last Post: 02-27-2010, 05:20 PM
  2. Conficker??? real or fake
    By cabalsun in forum Software Security
    Replies: 19
    Last Post: 08-29-2009, 11:09 PM
  3. Kill process by command name
    By mop in forum Linux Installation & Configuration
    Replies: 4
    Last Post: 02-16-2009, 07:21 PM
  4. Windows XP Tricks & Tips!!!!..new ones.
    By pranky in forum Tutorials
    Replies: 9
    Last Post: 08-23-2008, 03:22 PM
  5. Windows Shortcut List - Saves Time
    By 2stamlers in forum The Lounge
    Replies: 6
    Last Post: 04-10-2008, 06:58 AM

Bookmarks

Bookmarks

     
        Algorithms and Data Structures

        Java tutorials

        Algorithms Forum

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts