Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

encrypt and decrypt md5

I am using code $enrypt=md5($pass) and inserting $encrypt to database. I want to find out a way to decrypt them. I tried using a decrypting software but it says the hash should be of exactly 16 bytes. is there any way to decrypt it or to make it a 16 byte md5 hash?

My hash looks like this: c4ca4238a0b923820dcc

like image 939
Tomer Avatar asked Mar 04 '13 04:03

Tomer


People also ask

What is MD5 encryption and decryption?

MD5 is also a cryptographic hash function. A cryptographic hash function allows one to easily verify that some input data matches a stored hash value, but makes it hard to reconstruct the data from the hash alone.

Can you decrypt MD5?

The MD5 cryptographic algorithm is not reversible i.e. We cannot decrypt a hash value created by the MD5 to get the input back to its original value. So there is no way to decrypt an MD5 password. But, we can use something like brute force hacking, which is extremely resource-intensive, not practical, and unethical.

Can you decrypt MD5 with salt?

It is impossible to decrypt it. However, you may be able to crack it using the brute force method to find matching passwords in a dictionary.

What is encrypt MD5?

MD5 (message-digest algorithm) is a cryptographic protocol used for authenticating messages as well as content verification and digital signatures. MD5 is based on a hash function that verifies that a file you sent matches the file received by the person you sent it to.


2 Answers

As already stated, you cannot decrypt MD5 without attempting something like brute force hacking which is extremely resource intensive, not practical, and unethical.

However you could use something like this to encrypt / decrypt passwords/etc safely:

$input = "SmackFactory";  $encrypted = encryptIt( $input ); $decrypted = decryptIt( $encrypted );  echo $encrypted . '<br />' . $decrypted;  function encryptIt( $q ) {     $cryptKey  = 'qJB0rGtIn5UB1xG03efyCp';     $qEncoded      = base64_encode( mcrypt_encrypt( MCRYPT_RIJNDAEL_256, md5( $cryptKey ), $q, MCRYPT_MODE_CBC, md5( md5( $cryptKey ) ) ) );     return( $qEncoded ); }  function decryptIt( $q ) {     $cryptKey  = 'qJB0rGtIn5UB1xG03efyCp';     $qDecoded      = rtrim( mcrypt_decrypt( MCRYPT_RIJNDAEL_256, md5( $cryptKey ), base64_decode( $q ), MCRYPT_MODE_CBC, md5( md5( $cryptKey ) ) ), "\0");     return( $qDecoded ); } 

Using a encypted method with a salt would be even safer, but this would be a good next step past just using a MD5 hash.

like image 123
BIT CHEETAH Avatar answered Oct 18 '22 20:10

BIT CHEETAH


There is no way to decrypt MD5. Well, there is, but no reasonable way to do it. That's kind of the point.

To check if someone is entering the correct password, you need to MD5 whatever the user entered, and see if it matches what you have in the database.

like image 44
Niet the Dark Absol Avatar answered Oct 18 '22 19:10

Niet the Dark Absol