Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
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
Pie
Posts: 49411
62
  • 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: 979
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: 5852
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic