This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes java program to retrieve the encrypted data from database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "java program to retrieve the encrypted data from database" Watch "java program to retrieve the encrypted data from database" New topic
Author

java program to retrieve the encrypted data from database

sagar shiraguppi
Ranch Hand

Joined: Jul 16, 2007
Posts: 74
I want to read the encrypted data from the database and display it in the decrypted form, please help
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19649
    
  18

First we need to know how the data was encrypted. If it wasn't encrypted but hashed instead, like it's usually done with passwords, you can't get the original value back.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Ove Lindström
Ranch Hand

Joined: Mar 10, 2008
Posts: 326

removed. as mentioned, invalid answer.
sagar shiraguppi
Ranch Hand

Joined: Jul 16, 2007
Posts: 74
thank you
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

That isn't encryption. It is hashing. See hashing as one-way encryption. You can't get the original input back.


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Ove Lindström
Ranch Hand

Joined: Mar 10, 2008
Posts: 326

Wouter Oet wrote:That isn't encryption. It is hashing. See hashing as one-way encryption. You can't get the original input back.


True, but the principle is somewhat the same.

I've used http://www.jasypt.org/ in some of our projects and that normally i enough. Quite easy to work with also.

Also, we should not forget the Security FAQ here at the Ranch.
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

Ove Lindström wrote:True, but the principle is somewhat the same.

No, it isn't - hashing is a one-way algorithm; it is not possible to get the original data back from a hash. Encryption is a two-way algorithm: you can get the original data back, if you have the key to decrypt it.

Many people are confused about this, and think that hashing is some sort of encryption. Showing an example that does hashing when the question is about encryption only makes the confusion worse.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
sagar shiraguppi
Ranch Hand

Joined: Jul 16, 2007
Posts: 74
Still keeping fingurs crossed! :P Thank you guys for your inputs
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java program to retrieve the encrypted data from database
 
Similar Threads
JSF Request Scope security
Encryption /Decryption
RSA decryption, BadPaddingException: Data must start with zero
WA #1.....word association
Password Encryption using java