This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Java in General and the fly likes Using SealedObject , Encryption & Decryption Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Using SealedObject , Encryption & Decryption " Watch "Using SealedObject , Encryption & Decryption " New topic

Using SealedObject , Encryption & Decryption

Sathi Krishna
Ranch Hand

Joined: Oct 21, 2007
Posts: 51


I am using the below techinique for encrypting and decrypting the passwords.

Based on the requirement what I get, I've to use SealedObject concept for encryption and decryption.

I've to implement two methods which take String as parameter and String as return value.

public String encrypt(String str) { //new Logic for encrypting using SealedObject }
public String decrypt(String str) { // New logic for decrypting using SealedObject }

1. Original String
2. Get Encrypted String by invoking encrypt(originalStr)
3. Store the encStr in to DB
4. Read the encStr from DB
5. Get Decrypted(originalStr) by invoking decrypt(encStr)

so how do I save SealedObject as String into DB? is it is possible?

Excuse, if any thing wrong in question.

Looking for help
sudheer kiran
Ranch Hand

Joined: Jun 26, 2008
Posts: 237

our jvm has default encoder and encoder which is simple why dont you use that one

Rob Spoor

Joined: Oct 27, 2005
Posts: 19678

Because that may disappear or change completely in a next update. Never use classes that are in packages that start with sun, sunw or com.sun as these all may disappear or change as Sun see fit. That is also why these are not in the Javadoc pages.

How To Ask Questions How To Answer Questions
It is sorta covered in the JavaRanch Style Guide.
subject: Using SealedObject , Encryption & Decryption