Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1007
  • Last Modified:

How to encrypt data in Java

This might be a dumb question, but can someone provide some sample code that encrypts data in Java?  I have a public key that I'm suppose to use if that helps.  thanks
0
jhughes4
Asked:
jhughes4
2 Solutions
 
Kevin CrossChief Technology OfficerCommented:
There are some API's for doing this including the javax.crypto package.

http://java.sun.com/j2se/1.4.2/docs/api/javax/crypto/package-summary.html

Take a look at KeyGenerator and Cipher classes to get started.

Here is an example of another method provided by the Java Cryptography Extensions (JCE):
http://archive.javapronews.com/javapronews-47-20040625EncryptSensitiveConfigurationDatawithJava.html

Regards,
Kevin



Regards,
Kevin
0
 
Ajay-SinghCommented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now