|
||||||
| 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. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
||||
|
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");
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.
__________________
![]() Google - I'm Feeling Lucky | Youtube Classes! My Portfolio | Email Me | QuestionBin |
|
||||
|
Re: Java + Truecrypt + Windows
Well I tried a few things:
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:
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();
}
__________________
![]() Google - I'm Feeling Lucky | Youtube Classes! My Portfolio | Email Me | QuestionBin |
|
||||
|
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!
__________________
![]() Google - I'm Feeling Lucky | Youtube Classes! My Portfolio | Email Me | QuestionBin |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| 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.
Amrosama.cc
Arekbulski.cc
Debtboy.cc
Guest.cc
Jaan.cc
James.cc
Mathx.cc
Tsz.cc
Vswe.cc