0

I have MySQL database in which data comes from codeigniter, hence in the user table the password is stored in hashes. I have to make a panel in asp.net using this database. The problem is that whenever I return the password, it shows the hashes. How do I authenticate the user at login?

What have i tried

I tried to decrypt the password with the method given at MSDN. I googled a lot for this. Is it possible to convert hash into a string? One of my passwords is
7c4a8d09ca3762af61e59520943dc26494f8941b In real it is 123456. How can I decrypt this? I tried to use Asp.Net Authentication, but it did not succeed. I need to decrypt the password because I have to use it in the change password form.

7
  • Hashed Password can not be decrypt only an Encrypted password can be decrypt to the correct value Commented Jun 9, 2014 at 9:03
  • are you sure that the data that comes from codeigniter is encrypted with md5 (it could be sh1)? and is the key when encrypting from .net the same? Commented Jun 9, 2014 at 9:03
  • what type of encryption you have used to get that hash ? got its, its sha1. most of the sites use reset password and not change password if you want change password. you need to encrypt password where reversible is possible Commented Jun 9, 2014 at 9:03
  • @ArijitMukherjee I know hashed password is forward only and can not be decrypted. Is there any way to compare a textbox value with orignal sreing of hash Commented Jun 9, 2014 at 9:06
  • @YuliamChandra I am not sure and as i written in question MD5 is not working. Commented Jun 9, 2014 at 9:07

1 Answer 1

1

Hashed Password can not be decrypt, only an Encrypted password can be decrypt to the correct value.

To solve your issue:

You need to check by which technique is used to Hash the password while strong it in Database like MD5 or SHA1 etc.

Then perform the same hashing either in your server or I would rather choose/suggest Javascript (In that manner your password hashing will actually serve the purpose also to enhance the security you can add a salt key, so that the hashed password is also not open to anyone while travelling) and then match the Hashed textbox value with the stored Hashed value.

Sample for your Problem:

String password = "123456";

Outputs:

Original text   123456
Original bytes  31:32:33:34:35:36 (length=6)
Adler32 042e0136
CRC32   0972d361
Haval   1d8071d4a59f25a2a92a9a4844ba1e05
MD2 d4541250b586296fcce5dea4463ae17f
MD4 585028aa0f794af812ee3be8804eb14a
MD5 e10adc3949ba59abbe56e057f20f883e
RipeMD128   d6d56cab46e0f3af2c756289f2b447e0
RipeMD160   d8913df37b24c97f28f840114d05bd110dbb2e44
SHA-1   7c4a8d09ca3762af61e59520943dc26494f8941b
SHA-256 8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92
SHA-384 0a989ebc4a77b56a6e2bb7b19d995d185ce44090c13e2984b7ecc6d446d4b61ea9991b76a4c2f04b1b4d244841449454
SHA-512 ba3253876aed6bc22d4a6ff53d8406c6ad864195ed144ab5c87621b6c233b548baeae6956df346ec8c17f5ea10f35ee3cbc514797ed7ddd3145464e2a0bab413
Tiger   5b2715f7cb7488ce2deb8544f0aa91b6f0eec76fb3b74265
Whirlpool   f30d7ab2a27f7e64da1a506c4ed99e1d89b3592d98376e3eeb28668552ab72697998f05a16007df8d72eb4f0e1ad2c2b1f47f3e86c4267f64e1314e616e002a1

Here you can see the SHA-1 7c4a8d09ca3762af61e59520943dc26494f8941b is the given/desired output by you.

Reference for String to Hash

Hope it helps.

Sign up to request clarification or add additional context in comments.

9 Comments

do you know default hashing technique of codeigniter without using any salt. or it use any salt while hashing?
FIrst time Hash never use a Salt as far as Encryption technique is concerned ellislab.com/codeigniter/user-guide/libraries/encryption.html I think this doc says it uses SHA1
I check it with SHA1, SHA256 and MD5 but hash is coming differant?
ok what is the password 123456? and the Hashed is 7c4a8d09ca3762af61e59520943dc26494f8941b right?
check my edited answer, It is SHA-1 7c4a8d09ca3762af61e59520943dc26494f8941b
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.