Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can we password protect a File / folder / Windows Drive using java?  RSS feed

 
Lokendra Shekhawat
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends....

I have questions...

Can we password protect a file / folder / drive (Pen drive or c: / d: drive of windows) using java?

I can zip and password protect a file and folder, but its actually creating the copy of original data....

can we password protect file / folder without zipping them?
can we password protect pen drive or windows drive?

Awaiting your response...

Thank you..

 
Campbell Ritchie
Sheriff
Posts: 53732
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Too difficult a question for “beginning”. Moving discussion. Let’s try general computing.
 
Ivan Jozsef Balazs
Rancher
Posts: 992
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you want to use a service provided by the OS or roll out something own?
 
Peter Johnson
author
Bartender
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why write something in Java to do this when there are many free tools available that already do this?

And yes, you can password protect a file in Java. Here is a simple example with strings but you can apply the same principles to an entire file:
http://docs.oracle.com/javase/7/docs/technotes/guides/security/crypto/CryptoSpec.html#SimpleEncrEx
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!