We can use both Key and Password to encryt 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.