• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Tim Cooke
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
Saloon Keepers:
  • Piet Souris
Bartenders:

Using SealedObject , Encryption & Decryption

 
Ranch Hand
Posts: 51
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 237
MyEclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
our jvm has default encoder and encoder which is simple why dont you use that one

 
Sheriff
Posts: 22907
132
Eclipse IDE Spring TypeScript Quarkus Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic