is there any encryption library in java ?if there is, please give me some simple program that use it
Check out javax.crypto in the SDK 1.4.2 Documentation
You have already JCE included in the JDK 1.4.Please check this url:java.sun.com/.../API_users_guide.html
Right, but the Bouncy Castle APIs offer quite a bit of code which is notavailable in the JCE...things like PGP and other encryption algorithmsas well as tools for building your own CA.
In addition to the crypto APIs in the JDK you should look at the BouncyCastle libraries: http://www.bouncycastle.org/You can use Bouncy Castle in conjunction with the JDK crypto APIs to doalmost anything. One thing to note though is that the documentation isnot always that good in the Bouncy Castle library.