Encrypting passwords is generally a bad idea. So is DES. I assume your key is stored in a file or hardcoded in your app, this provides very little security, just the illusion of such. You are probably required to do so, I guess, but still. Do consider at least a longer key (3DES) or a more modern encryption algorithm AES.
That said, add a transient property to your entity and set the decrypted password there.
Thanks for replying.
I already have getter and setter methods for the property 'password' in the entity.java file. So is it enough if i just add @Transient annotation above the getter method or should i do anything more? Please explain me in detail.
Add @Transient get/setDecryptedPassword() to your entity. Than do something like this after you fetch from DB and before displaying:
String decryptedPass = DesDecryptor.decrypt(device.getPassword()); device.setDecryptedPassword(decrytpedPass);
After this, you can display the decryptedPassword property.