File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


JavaRanch » Java Forums » Java » Java in General
Bookmark "Using SealedObject , Encryption & Decryption " Watch "Using SealedObject , Encryption & Decryption " New topic
Author

Using SealedObject , Encryption & Decryption

Sathi Krishna
Ranch Hand

Joined: Oct 21, 2007
Posts: 51

Hi

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

http://en.allexperts.com/q/Java-1046/2009/3/encryption-decryption-using-java.htm


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

http://www.exampledepot.com/egs/javax.crypto/EncryptObject.html


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 }

Steps
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
SvKrishnaReddy
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


Sudheer
SCWCD, SCJP 5
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19697
    
  20

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
GeeCON Prague 2014
 
subject: Using SealedObject , Encryption & Decryption