• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Encryption/decryption using core java and then insert into database  RSS feed

 
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, i want to use encryption like RSA algorithm in java.
For e.g - during a registeration process in my application, whenever the user inputs a password, i want to encryp that password and pushed that encrypted key into database.
During login process, user will enter his/her username and password, this password will be matched with the decrypted password(encrypted in db) and once validated, it can go through.

Now i have no idea about it. Kindly provide me how to do that using core java ?

Thanks in advance.
 
Rancher
Posts: 42973
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The proper approach is not to encrypt passwords, but to hash (or digest) them using an algorithm like SHA-2 (or SHA-256/SHA-384/SHA-512, as it is known in the Java world). That way you can be sure that a password is never exposed. See the SecurityFaq for more information.
 
Sheriff
Posts: 21503
96
Chrome Eclipse IDE Java Spring Ubuntu VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javax.crypto.Cipher for encrypting
java.security.MessageDigest for hashing
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!