Tuesday, February 7, 2012 8:37

Encryt file in java

Tagged with: ,
Posted by on Thursday, November 13, 2008, 22:12
This news item was posted in Java category and has 0 Comments so far.

We can use both Key and Password to encryt file.

  1. Use the Key I rewrited the DESEncryptUtil got from internet.
  2. PBE the third party utility – Jasypt is used to encrypt/decryt the file.

Some useful references:

Key storage and Password-Based Encryption in Java Security Handbook

Keys can be stored in a number of ways: you can write them down or print them, you can store them ina file, you can store them in a smart card, or you can store them in a tamperproof electronic keying device. The obvious countermeasure to storing your keys on dick is to encrypt them. But this solution tends to be a circular one. What do you do with the key that you used to encrypt the keys that are stored on your computer? The answer to this dilemma is to use password-based encryption(PBE) .

The javax.crypto.spec Package of Java in a nutshell

Generating a Key from a Password http://blogs.msdn.com/shawnfa/archive/2004/04/14/113514.aspx

Please feel free to contact me if you want those two utility files.

Leave a Reply

You can leave a response, or trackback from your own site.