Go Back   CodeCall Programming Forum > Software Development > Java Help
Register Blogs Search Today's Posts Mark Forums Read

Java Help Java Help forum discussing all Java platforms - J2ME, J2SE and J2EE - as well as relevant standards, APIs and frameworks such as Swing, Servlets, JSPs, Applets, Struts, Spring, Hibernate, ANT, EJB, and other Java-related topics.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-10-2009, 11:59 AM
BlaineSch's Avatar
Code Warrior
 
Join Date: Apr 2009
Location: Trapped in my own little world.
Age: 19
Posts: 2,169
BlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of light
Send a message via MSN to BlaineSch
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-10-2009, 01:05 PM
BlaineSch's Avatar
Code Warrior
 
Join Date: Apr 2009
Location: Trapped in my own little world.
Age: 19
Posts: 2,169
BlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of light
Send a message via MSN to BlaineSch
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.
Quote:
...
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();
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-10-2009, 02:34 PM
BlaineSch's Avatar
Code Warrior
 
Join Date: Apr 2009
Location: Trapped in my own little world.
Age: 19
Posts: 2,169
BlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of light
Send a message via MSN to BlaineSch
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!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tutorial: Starting Java Using Netbeans Jordan Java Tutorials 2 01-13-2010 05:55 PM
Conficker??? real or fake cabalsun Software Security 19 08-30-2009 12:09 AM
Kill process by command name mop Linux Installation & Configuration 4 02-16-2009 08:21 PM
Windows XP Tricks & Tips!!!!..new ones. pranky Tutorials 9 08-23-2008 04:22 PM
Windows Shortcut List - Saves Time 2stamlers The Lounge 6 04-10-2008 07:58 AM


All times are GMT -5. The time now is 09:28 AM.


vBulletin v3.8.0 ©2010, Jelsoft Enterprises Ltd.


no new posts

LinkBacks Enabled by vBSEO 3.1.0