An Interactive Password Cracker Test in PHP

An Interactive Test to Crack Your Password

“All the passwords should be stored as MD5 hash codes.” It is classic knowledge of any article on information security. But unfortunately, in 2016, it has lost its relevance, and everything is not so simple. The md5 ( ‘password’), md5 (md5 ( ‘password’)) code, and even the md5 (md5 (md5 ( ‘password’))) code will not save you from hackers.

The so-called rainbow table is a hash-breaking tool, which is now available to anyone who will type these words in Google. Keeping a comparison of the original string and its hash, they make it easy to recover any “irrecoverable” hash function.

The modern rainbow table stores every word and all its forms ever met on forums, Wikipedia, and the entire Internet.

Let’s perform a little test. For example, I have “jason” as a password. I will hash it and then try to crack it. I will use http://www.md5.cz/ to hash my password, and https://crackstation.net/ to encrypt it.

Hashing the password:

Encrypting the hash:

As we can see, I needed a few seconds to crack the password.

What to do in such a situation?

A good way to protect yourself is to use salt when hashing. It adds a random string to your password before hashing it.

A simple example in PHP:

$password = 'password'; // your password
$hash = md5($password); // hasging
$salt = 'sflprt49fhi2'; // salt
 
// salting the password: concatenate the old hash with the salt and hash it one more time:
$saltedHash = md5($hash1 . $salt);

In this example, the salt is a static string. You should use a dynamic (random) salt in real projects.
A better example using STL in PHP language:

A better example using STL in PHP language:
$hash = crypt('password');// crypt extracts the salt from the existing hash and hashes the incoming password using it.
if (crypt($password, $hash) == $hash) {
   // password is correct
}

Thanks for your attention!

Where to Find Help With Computer Science Assignments

Do you need to complete an assignment on an interesting topic? You can use our password cracker test example with PHP code as a source of inspiration. We hope that our example will help you in some way to deal with your assignments. Still, you can do this assignment more easily: order it from AssignmentShark.com. Our experts can handle any technical and non-technical assignment.

We have put together a team of experts in engineering, IT/web, aviation, and other disciplines which are accredited with academic degrees; all of our experts have profound knowledge in particular spheres. Due to this fact, we can claim that our company offers only high-quality works.

If you need a paper similar to this password cracker test example, it doesn’t matter where you are, whether you are in the US or Australia. We provide worldwide assistance to students who need professional help with their assignments 24/7. Read our testimonials and make sure that you are going to make the right choice! Also, you are welcome to leave your own testimonial here after you receive the completed order from us.

The AssignmentShark.com team takes great care of the quality of work, and pays attention to the pricing policy. We strive to make our service affordable to every student seeking help with assignments. Every order is performed strictly in accordance with your requirements, so be confident that you will be fully satisfied with our service!

Leave a Reply

Your email address will not be published. Required fields are marked *

Customer testimonials

Submit your instructions to the experts without charge.