i used MD5 function to encrypt password .. -
-
PreparedStatement pstmt=con.prepareStatement("insert into regist values(?,MD5(?),MD5(?),?,?,?,?,?,?,?,?,?,?,?,?)");
-
-
pstmt.setString(1,vEmailId);
-
pstmt.setString(2,vPassword);
-
pstmt.setString(3,vConfirmPassword);
-
but i want to Decrypt that password for login condition where it is not match the same password.
what to do.
11 8410
but how to decrypt sha encryption
as us suggest i use sha1 but how to reverse it in plan text for login to compare that encrypted password.
You don't. Hashing algorithms are not reversible.
You never need to decrypt passwords.
When a user logs in just calculate the hash again and compare the hash with what's on the database. No need to get the password from the hash.
THEN how could i retrieve password .
becoz i am match that password during login and becoz of encryption it can't match , condition always false.
what to do to protect password other than this.
It should match.
Here is how it works.
When a new user comes in with their password calculate the hash for that password and store the hash in the database against that user name (also store a salt for it).
When a user wants to log in, take their entered password and use the same algorithm to calculate it's hash and it's salt. Then check the database to see if that hash and salt is against that user in the database. There is on encryption/decryption involved here. Just calculating hashes.
any pages to read this becoz whatever u said
i got that but i want to visualize that all whatever u explain
me. plz tell me.
MySQL AES functions (AES_ENCRYPT() and AES_DECRYPT())
do u know this how to use this.
Yes. But that is not a hashing algorithm. AES and DES are are encryption algorithms and are the ones where you encrypt/decrypt values.
MD5 and SHA are hashing algorithms and when you use those you just calculate hashes and compare the hashes. They are perfect for passwords because there is never a need to compute a user's password.
then plz tell me how to use that.
You shouldn't use a reversible encryption like AES to store passwords. Use the hash, everyone uses the hash. There is absolutely no need to ever need to retrieve the original password that was used to create the hash.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: photoelectric |
last post by:
When trying to run the below script on an apache/1.3.26 with mysql and
php I get the following error message:
Warning: mysql_connect() : Access denied for
user: 'nobody@software-ece.rutgers.edu'...
|
by: Bernard Dhooghe |
last post by:
The information center writes:
"Encryption Algorithm: The internal encryption algorithm used is RC2
block cipher with padding, the 128-bit secret key is derived from the
password using a MD2...
|
by: Flic |
last post by:
Hi,
I have a basic db that I access with MySQL query browser. Everything
seems fine to me but I am using this db as part of a php shopping
basket and when I try to add an item I get:
Notice:...
|
by: rjgalanza |
last post by:
My script was working fine last night but when I tried it again earlier this is the error message I got:Fatal error: Call to a member function mysql() on a non-object in C:\Program...
|
by: ajos |
last post by:
hi evrybdy,
the problem is:-
i had this running before in jsp but when i changed the jsp page using struts tags there occoured a problem...
when i enter values in the 2 text boxes and click enter...
|
by: servo |
last post by:
I created a user "test1" (which then got the username "debscrof_test1" from CPanel), a password for the user "test2", and then added the user to a new database "testdb" with all priviliges
Then a...
|
by: sbettadpur |
last post by:
hello
I am getting following error while connecting to mysql through php
Warning: mysql_connect() : Access denied for user: 'pds@localhost' (Using password: YES)
Actually I hosted one...
|
by: dlite922 |
last post by:
I'm trying to convert an SQLITE database to MySQL syntax and it seems every resource I find on google is only half complete.
I want to create this thread to sum them all up in one central...
|
by: lisles |
last post by:
i have a page funtion.php which hs the function to connect to the db
/* Mysql Connection */
function connect(){
global $db_server,$db_user,$db_pass,$db;//Global Values from the config.php...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
| |