Authentication and password cracking

Lord777

Professional
Messages
2,583
Reputation
15
Reaction score
1,254
Points
113
In this article, we will look at various authentication mechanisms. An authentication mechanism (or method) is a way for you to prove that you have access to something. Passwords were the default authentication method until most of us had to prove to the computer that we were allowed to access it. However, passwords are not the only authentication mechanism.

Authentication method

What you know: Examples of this are your good old password, bank card PIN, or safe word when an emergency company calls you at home; these are all examples of using what you know to authenticate yourself.

You have something: examples of a swipe card to access a secure area code sent to your mobile phone, as part of the login process (to prove that you have your mobile phone) or keys secureid token, which provides the ever-changing code that must be entered in order to access all that you have, which can be used for authentication.

What you are: This is where biometric security comes in. To access our data center, we need to put our index finger on the fingerprint scanner after swiping the card. If you don't steal someone's index finger, you won't be able to access our Data Center, even if you stole a valid swipe card. Other biometric systems include retinal scans (blood vessels in the back of the eye) and iris scans (the colored part of the eye).

Other attributes used for authentication: Some other attributes that you sometimes see are used for authentication:
  • Somewhere you are. For example, on a physical address that can accept snail mail.
  • There's something you can do. For example, accurately reproduce the signature.
  • What you put up. For example, a neurological sign that can be scanned using an MRI scan.
  • Someone you know. For example, this can be confirmed by a social network graph or a chain of trust.
Our focus in this article is passwords. Most of us see them as an inconvenience – something you have to endure in order to be able to use the service you need access to. In this article, we'll explain how computer systems have evolved in how they handle your password, how modern online applications do authentication, and why it's important to choose a strong password. After you finish reading this, you should have a working knowledge of hashing algorithms, how password cracking works, and what “strong password” really means.

Simple Text Passwords

In the early days of computers and mainframes, passwords were stored in a database in plain text. When you want to log in, the gatekeeper app will ask you to enter your password. It would take everything you entered and check if it was equal to what it stored in the database, and if it was true, you were granted access.

As the Internet developed and grew, attackers began to gain unauthorized access to systems. Once they are logged in, they will immediately download a database of plain-text passwords and have instant access to all user passwords. Developers and system administrators had to come up with a solution to this problem, and the solution they came up with was "password hashing".

Introduction to Password Hashing

Hashing algorithm


Think of a hashing algorithm as a machine. At one end, you enter any text or binary data. At the other end, you get a number of a certain length – say, 32 digits long in our example. The data you enter can be of any size, from a few bytes to many terrabytes or more. No matter what data you enter, you get a 32-digit number (in this example) that uniquely represents the data.

What's amazing about the hash algorithm machine is that if you feed something identical, you get the same 32-digit number. If you feed in war and peace, you get a number. If you copy the book verbatim and enter exactly the same text, you get the same number. If you change one character in a novel, you'll get a completely different number.

Hashing algorithms differ in how they work, and the most noticeable difference is the length of the number that each spits out.
  • MD5, which is extremely popular, spits out 128 binary digits.
  • SHA2 spits out 256 bits (or binary digits).
When system administrators and developers first encountered problems with the security of password databases stored in plain text, they turned to hashing algorithms for help. What they came up with is, instead of storing your password in a database, they will just store a hash of your password. That is, the number that the hashing algorithm generates when it works with your password.

When a user changes their password, or when a user account is created and a new password is entered for the first time, the computer security application takes that password and runs it through a hashing algorithm and stores the resulting number in a database. The next time you try to log in and enter a password, the security system runs the entered password using the same hashing algorithm and checks whether the resulting hash matches the hash in the database (hash is the number that the hashing algorithm outputs). If they match, you will be allowed to enter.

Passwords are no longer stored in plaintext in the database. If a hacker steals a database of user accounts, they won't automatically have all the passwords, all they have is a list of hashes.

Hashes are not perfect

Storing password hashes instead of the passwords themselves was a major breakthrough in information security. Unfortunately, the story doesn't end there. Now that hashes are typically used to authenticate users instead of plain text passwords, a hacker doesn't immediately get a list of all passwords when they steal a database of user accounts. However, there is a way for a hacker to steal the hashes and turn them back into passwords.

This method is relatively simple. When a hacker steals a database of hashed passwords, to reverse engineer the hashes (convert them back to passwords), the hacker generates hashes from a dictionary of words that he thinks may be the passwords that were used. If any of these hashes match what it has in the database, it has managed to reverse engineer the hash and now knows what the original password is.

For example, let's say you stole a password database and you have a password hash that uses 'mark'. You want to know the actual password for the’ mark 'account, so you take the word 'banana' and run it through the same hashing algorithm that the password database uses. You end up with a number, and if the number matches the hash in the password database for the user "Mark", you now know his password. If it doesn't match, then I try "pear" and "apple" and "ApplePear435" and gradually more words and more complex word combinations.

So, to crack a password, you need to take a very large dictionary of passwords and hash each one, then compare those hashes with what's in the password database you stole, and when you get a match, you know the original password.

The problem is that creating word hashes takes time. Each word can take several milliseconds to hash. So you need a very fast computer to do this. Alternatively, you can take a very large dictionary of known passwords, generate hashes from all the words, and store the words and their hashes. Then, every time you steal the password database, you can simply reuse that list of words and their hashes. You don't need to recreate the hashes every time. All you have to do is match your list of hashes to the hashes in the password database, and where you will get the match that you cracked the password.

What we have just described is called “Rainbow Table”. Rainbow tables are a technique commonly used by hackers to crack password databases that use normal hashing without any additional security. Rainbow table attacks on hashed password databases are very effective because they are fast. To help protect against this type of attack, developers and system administrators have come up with a method called "salting" passwords.

Understanding Password Hash-Salt

How do Salts work?


The rainbow table attack is based on the fact that a hacker can take a dictionary and pre-computed hashes of words in this dictionary and compare these hashes with the hashes in the password database. To defeat rainbow tables, the information security community has invented “salted hashes". The concept is relatively simple:

When you create a new password, instead of just running the password yourself through a hashing algorithm, you do the following: generate a random small piece of text. Put this text at the beginning of the password. Then run the combination of a small piece of text and a password through the hashing algorithm. Then you save a small piece of text (as plain text) and the resulting hash. This small piece of text is called a "salt".

f1cfuauy7OA.jpg

When someone wants to log in, they enter their password. The security app takes a saved piece of text or salt, places it in front of the entered password, and runs it through the same hashing algorithm to get the hash. It compares the resulting hash with the hash stored in the database, and if they match, you are granted access.

It is important to note that a salt or "small piece of text" is stored as plain text with a hash. It is also important to note that the salt is random for each password. In other words, each password has its own little piece of text.

This is a relatively simple concept, but it makes it much harder to crack hashed passwords.

Why do salts make hacking difficult?

Recall that rainbow tables are a dictionary of words and hashes of these words. In the example above, we used salts (a small piece of text) in combination with our password to create hashes. If a hacker wants to crack passwords, they can't use their rainbow table, because the rainbow table is just a hash of individual words. It needs to combine these words with the stored salt to get the actual hash that is stored in the database.

This makes password cracking much harder, because it means that the hacker's rainbow table is useless, and it forces him to recalculate the hashes for each word in his dictionary.

Here is an example of a password being created for someone called "good-guy”:
  1. The system administrator creates a new account in the system for a user called good-guy with the password "apple".
  2. The system automatically generates a short text fragment "yrtZd".
  3. The system takes a short text and combines it with 'apple' to create the text 'yrtZdapple'.
  4. Then it runs "yrtZdapple" through the hashing algorithm and gets a 128-bit number.
  5. The system stores this number as a hashed password for the good guy's account.

Here's how "good-guy" signs up:
  1. "good-guy" comes to work and tries to register. He types 'Apple' as the password.
  2. The system retrieves the entry for the "good-guy" account. This record is a hash and the text " yrtZd”, which is a salt.
  3. The system combines the word "apple” that the nice guy just typed with a salt to make the text" yrtZdapple " and runs a hashing algorithm on that.
  4. The system checks if the hash it extracted matches the hash it just generated, it matches and allows the "good-guy" to access the system.

Here are the steps a hacker takes to crack the good guy's salted password:
  1. A hacker arrives and manages to break into the system, and he steals a database of password hashes and salts.
  2. A hacker is trying to use pre-computed hashes of words in their English dictionary. One of the hashes has the word "apple", but this doesn't work because the hacker has to combine the salt that is "yrtZd" with the word apple before he hashes it.
  3. The hacker realizes that his precomputed rainbow table is useless. It needs to combine the salt for the good guy's password with each word in its dictionary, and then see which hash matches. This means that it needs to recalculate the hashes for its entire dictionary, which will take significantly longer.
As you can see from the example above, it is possible to crack passwords that use salts. It just takes a lot longer and requires more processing time.

Hashed passwords that use salts are what most modern authentication systems use. This doesn't make the password uncrackable, but it slows down the hacking process because it forces the hacker to hash every password they want to guess.

Now you have a working understanding of how modern password authentication works on systems such as WordPress, Linux, Windows, and many other systems. You also understand why salts are useful – because they prevent a hacker from cracking password hashes very quickly with rainbow tables. Now that you understand the benefits of salted hashes, it may seem obvious to you that everyone should use them when creating authentication systems. Unfortunately, they don't – there are many examples of purpose-built web applications that didn't use salts – they just used plain old hashes, and when they're cracked, it's relatively easy to reverse engineer passwords with rainbow tables.

GPUs and a home supercomputer

Since modern password cracking uses salts, if you want to use a dictionary of words to try to crack a password database, this means that you will hash each of these words with a salt every time you want to make a guess. So it becomes useful to be able to do hashing quickly.

It turns out that modern graphics hardware (GPU or GPUs) is very good at hashing and can do it in parallel. Using an out-of-the-box, high-quality gaming graphics card, you can hash passwords thousands of times faster than even the fastest processor on the market. This has led most competent hackers to buy GPUs for password cracking or use an online GPU accelerated password cracking cluster.

In just a few seconds, a modern GPU can allow a hacker to make several million attempts to guess a password.

Many of the algorithms that are used for hashing, such as MD5, were developed decades ago, when CPUs were very slow and GPUs didn't exist yet. To try to compensate for the increase in computing power that we experienced, the developers of authentication systems came up with something called “stretching”. What this does is take a hashing algorithm like MD5, and instead of running it once on the password and salt, it runs it thousands of times. In other words, the system will generate a hash, then generate a hash hash, then generate a hash hash hash, and so on for thousands of loops.

As a result, when a password cracker wants to try to guess a password, they don't just need to create one hash for each guess, but thousands of hashes. This has the effect of slowing things down, but it's still not enough.

WordPress uses salted hashes to store passwords using the MD5 hashing algorithm. It stretches MD5 by doing over 8000 MD5 rounds to try and make password guessing more computationally intensive. But a modern GPU can guess WordPress passwords at 3.2 million guesses per second. This is quite surprising in terms of performance. When MD5 was developed and when salts were first invented, hashing many words to try to guess the password took a long time. You can get multiple guesses every second. We can now reach 3.2 million guesses per second.

Now you have a good understanding of how passwords are used on services like Gmail, Yahoo, WordPress websites, and most other services that use a password for authentication. You also have a reasonable understanding of how to crack passwords.

Why Strong passwords are important

If one of the services you use is hacked and hashed passwords are stolen, even a teenager in their bedroom with a $ 2,000 gaming computer can try to turn your hashed password into a plain text password at 3.2 million guesses per second and possibly much faster. If you consider that eHarmony, LinkedIn, Google, and many other well-known brands have been successfully hacked over the past few years, it is likely that the service you are using will have their hashed passwords stolen soon.

This means that it is important to use passwords that are very difficult to crack. Any password with less than 12 characters is considered weak.

Why Strong passwords are important

If one of the services you use is hacked and hashed passwords are stolen, even a teenager in their bedroom with a $ 2,000 gaming computer can try to turn your hashed password into a plain text password at 3.2 million guesses per second and possibly much faster. If you consider that eHarmony, LinkedIn, Google, and many other well-known brands have been successfully hacked over the past few years, it is likely that the service you are using will have their hashed passwords stolen soon.

This means that it is important to use passwords that are very difficult to crack. Any password with less than 12 characters is considered weak.

How to crack this password

You should assume that the service you are using is managed by fairly competent system administrators and that they at least store hashed passwords, not plain text. For security reasons, let's assume that they use a weak hashing algorithm. In this case, we will count 1 round of salted MD5. Note that we give them the benefit of the doubt that they are actually salting their passwords.

If your password consists of 9 characters of lowercase numbers and letters, this gives you 101,559,956,668,416 possible passwords. (36 to the power of 9).

In Wordfence, we have an 8 GPU cluster that can crack salted MD5s at a rate of 90.6 billion salted MD5 guesses per second. It will take us 1128 seconds or 18 minutes to crack your password if we guess every combination of letters and numbers that are 9 characters long. We can do this faster if we exclude certain patterns.

Now you're starting to understand why longer passwords are better. You also begin to understand why you should use special characters as well as letters and numbers. Any password that uses only letters and numbers is weak. That's why:

If you have a password consisting of just 1 and 0, and it is 4 digits long, you will have:

2 to the power of 4 possible passwords or 16 possible passwords.

If you have a password consisting of digits from 0 to 9 (i.e. 10 possible characters) and it is 4 digits long you have:

10 to the power of 4, which is 10,000 possible combinations.

Now, if you instead create your password from all lowercase letters, uppercase letters, numbers, and a set of 10 characters, you have 26 + 26 + 10 + 10 = 72 possible characters. So if you have a password that is only 4 characters long now you have:

72 to the power of 4 possible passwords, which is 26,873,856 possible passwords.

As you can see, every time you increase the number of characters that make up your password, you get a huge increase in the number of possible passwords, even if you keep the length at just 4 characters in our example.

You get 26 million possible passwords of just 4 characters if you use a wider range of characters in your password. This really illustrates how important it is to use upper and lower case, numbers, and symbols in your password.

If you now extend the length of your password to 12 characters, you have 72 to the power of 12 or 19,408,409961,765,342,806,016. Even with our 8 GPU cluster, it will take us 2495937 days or 6838 years to guess your password if we try all possible combinations.

We are considering a 12-character password that uses

random (see next paragraph)

uppercase letters, lowercase letters, numbers, and symbols to be a strong password. And to be clear, this is a strong password, even if the service you are using stores passwords using 1 salted MD5 round, which is relatively weak. By comparison, WordPress uses over 8,000 rounds of salted MD5, which of course makes it 8,000 times slower for a hacker to crack WordPress passwords.

It is important to note that your password must be random characters and not consist of patterns such as the beginning or ending of a number or dictionary words. Once you enter dictionary words and predictable patterns into passwords, they become significantly easier to guess, because a password cracker can simply exclude anything that doesn't match the predictable pattern.

As computers become faster at hashing, what will developers do?

If the trend over the past few years is anything to go by, reverse engineering hashed passwords back into their plain text will continue to accelerate at an increasing rate. The GPU cluster we built to audit passwords for Wordfence clients is faster at hashing than the fastest computer on Earth in 2003. This is an illustration of how fast computing power increases.

Over the last 5 years, there has been an explosion in purpose-built hardware that does things that a CPU would have been used for before. The difference is that this hardware runs in parallel and is therefore much faster. The consumer gaming GPUs we discussed above contain more than 2,000 cores that can perform calculations in parallel. Another area that has been fueling innovation in parallel computing is bitcoin mining hardware. You can buy ASICs and FPGAs, which are both ways to build an application on a chip-and both can perform tasks like hashing in a massively parallel way. Bitcoin miners use ASICs and FPGAs for mining and have lowered the price of this hardware. It can also be used to crack passwords in parallel and at very high speed.

If we assume that the hardware will continue to accelerate at an increasing rate, we need to focus on how we store passwords. The use of hashing to store passwords is widespread and is the accepted solution at the moment.

Can we use better hashing algorithms?

In computer science, we usually aim to make algorithms faster. Paradoxically, the best password hashing algorithm is the one that is slower or computationally more expensive.

The advantage of a more expensive and slower hashing algorithm is that if you can slow down the time it takes to hash a password, you slow down the speed at which hackers can guess passwords. Algorithms such as bcrypt allow you to specify "complexity”, which affects the speed at which hashing occurs, and therefore the speed at which guessing occurs.

Another useful algorithm is scrypt, which is designed to make parallel computing more difficult. This means that a hacker can no longer use the 2000 cores in their GPU to try to crack your password at the same time. Instead, they need to make one guess at a time.

These options are not without problems. App developers like Facebook and Google want to provide you with useful services. They are becoming popular and have 10k customers who want to log in. If they use a hashing algorithm that takes, say, 5 seconds to hash the password on the server, that means they need 5 servers just to allow 1 user per second. They will need 50,000 servers to allow 10,000 users to log in per second. This may not be acceptable for Facebook, and they may choose a faster but weaker hashing algorithm.

There are several interesting ways to slow down hashing without overloading servers, which are discussed in the information security community. One of them is quite simple and is called "server-terrain". A way to make the server easier is that it uses a slower hashing algorithm, such as bcrypt or scrypt, and actually does most of the hashing in your web browser when you log in. This uses your workstation's CPU instead of the processing power of servers belonging to the service you are logged in to.

The hash that took longer to calculate is then sent by your web browser to the server you are logging in to, which turns it into a salted SHA256 hash and stores it. The effect is that you used a CPU-intensive hashing algorithm, which can be difficult to parallelize and slower. Your web browser did most of the computing, which saved valuable CPU cycles on the server you're logging in to. This will allow the authentication server to handle a large number of clients logging in and use a computationally expensive hashing algorithm without overloading.

Conclusion

This is where our introduction to hashing and passwords ends. We looked at the history of password storage, why password hashing is used, what rainbow tables are, and how salted passwords defeat rainbow table attacks. We also discussed how password cracking occurs and how hardware such as GPU ASICs and FPGAs can speed up the hacking process. We also gave you a brief introduction to algorithms that make it harder to crack passwords and a performance architecture that allows you to use a strong hashing algorithm without overloading servers.
 

dunkelh3it

BANNED
Messages
547
Reputation
37
Reaction score
1,101
Points
93
Telegram
@Dunkelh3it
Please note, if you want to make a deal with this user, that it is blocked.
In this article, we will look at various authentication mechanisms. An authentication mechanism (or method) is a way for you to prove that you have access to something. Passwords were the default authentication method until most of us had to prove to the computer that we were allowed to access it. However, passwords are not the only authentication mechanism.

Authentication method

What you know:
Examples of this are your good old password, bank card PIN, or safe word when an emergency company calls you at home; these are all examples of using what you know to authenticate yourself.

You have something: examples of a swipe card to access a secure area code sent to your mobile phone, as part of the login process (to prove that you have your mobile phone) or keys secureid token, which provides the ever-changing code that must be entered in order to access all that you have, which can be used for authentication.

What you are: This is where biometric security comes in. To access our data center, we need to put our index finger on the fingerprint scanner after swiping the card. If you don't steal someone's index finger, you won't be able to access our Data Center, even if you stole a valid swipe card. Other biometric systems include retinal scans (blood vessels in the back of the eye) and iris scans (the colored part of the eye).

Other attributes used for authentication: Some other attributes that you sometimes see are used for authentication:
  • Somewhere you are. For example, on a physical address that can accept snail mail.
  • There's something you can do. For example, accurately reproduce the signature.
  • What you put up. For example, a neurological sign that can be scanned using an MRI scan.
  • Someone you know. For example, this can be confirmed by a social network graph or a chain of trust.
Our focus in this article is passwords. Most of us see them as an inconvenience – something you have to endure in order to be able to use the service you need access to. In this article, we'll explain how computer systems have evolved in how they handle your password, how modern online applications do authentication, and why it's important to choose a strong password. After you finish reading this, you should have a working knowledge of hashing algorithms, how password cracking works, and what “strong password” really means.

Simple Text Passwords

In the early days of computers and mainframes, passwords were stored in a database in plain text. When you want to log in, the gatekeeper app will ask you to enter your password. It would take everything you entered and check if it was equal to what it stored in the database, and if it was true, you were granted access.

As the Internet developed and grew, attackers began to gain unauthorized access to systems. Once they are logged in, they will immediately download a database of plain-text passwords and have instant access to all user passwords. Developers and system administrators had to come up with a solution to this problem, and the solution they came up with was "password hashing".

Introduction to Password Hashing

Hashing algorithm


Think of a hashing algorithm as a machine. At one end, you enter any text or binary data. At the other end, you get a number of a certain length – say, 32 digits long in our example. The data you enter can be of any size, from a few bytes to many terrabytes or more. No matter what data you enter, you get a 32-digit number (in this example) that uniquely represents the data.

What's amazing about the hash algorithm machine is that if you feed something identical, you get the same 32-digit number. If you feed in war and peace, you get a number. If you copy the book verbatim and enter exactly the same text, you get the same number. If you change one character in a novel, you'll get a completely different number.

Hashing algorithms differ in how they work, and the most noticeable difference is the length of the number that each spits out.
  • MD5, which is extremely popular, spits out 128 binary digits.
  • SHA2 spits out 256 bits (or binary digits).
When system administrators and developers first encountered problems with the security of password databases stored in plain text, they turned to hashing algorithms for help. What they came up with is, instead of storing your password in a database, they will just store a hash of your password. That is, the number that the hashing algorithm generates when it works with your password.

When a user changes their password, or when a user account is created and a new password is entered for the first time, the computer security application takes that password and runs it through a hashing algorithm and stores the resulting number in a database. The next time you try to log in and enter a password, the security system runs the entered password using the same hashing algorithm and checks whether the resulting hash matches the hash in the database (hash is the number that the hashing algorithm outputs). If they match, you will be allowed to enter.

Passwords are no longer stored in plaintext in the database. If a hacker steals a database of user accounts, they won't automatically have all the passwords, all they have is a list of hashes.

Hashes are not perfect

Storing password hashes instead of the passwords themselves was a major breakthrough in information security. Unfortunately, the story doesn't end there. Now that hashes are typically used to authenticate users instead of plain text passwords, a hacker doesn't immediately get a list of all passwords when they steal a database of user accounts. However, there is a way for a hacker to steal the hashes and turn them back into passwords.

This method is relatively simple. When a hacker steals a database of hashed passwords, to reverse engineer the hashes (convert them back to passwords), the hacker generates hashes from a dictionary of words that he thinks may be the passwords that were used. If any of these hashes match what it has in the database, it has managed to reverse engineer the hash and now knows what the original password is.

For example, let's say you stole a password database and you have a password hash that uses 'mark'. You want to know the actual password for the’ mark 'account, so you take the word 'banana' and run it through the same hashing algorithm that the password database uses. You end up with a number, and if the number matches the hash in the password database for the user "Mark", you now know his password. If it doesn't match, then I try "pear" and "apple" and "ApplePear435" and gradually more words and more complex word combinations.

So, to crack a password, you need to take a very large dictionary of passwords and hash each one, then compare those hashes with what's in the password database you stole, and when you get a match, you know the original password.

The problem is that creating word hashes takes time. Each word can take several milliseconds to hash. So you need a very fast computer to do this. Alternatively, you can take a very large dictionary of known passwords, generate hashes from all the words, and store the words and their hashes. Then, every time you steal the password database, you can simply reuse that list of words and their hashes. You don't need to recreate the hashes every time. All you have to do is match your list of hashes to the hashes in the password database, and where you will get the match that you cracked the password.

What we have just described is called “Rainbow Table”. Rainbow tables are a technique commonly used by hackers to crack password databases that use normal hashing without any additional security. Rainbow table attacks on hashed password databases are very effective because they are fast. To help protect against this type of attack, developers and system administrators have come up with a method called "salting" passwords.

Understanding Password Hash-Salt

How do Salts work?


The rainbow table attack is based on the fact that a hacker can take a dictionary and pre-computed hashes of words in this dictionary and compare these hashes with the hashes in the password database. To defeat rainbow tables, the information security community has invented “salted hashes". The concept is relatively simple:

When you create a new password, instead of just running the password yourself through a hashing algorithm, you do the following: generate a random small piece of text. Put this text at the beginning of the password. Then run the combination of a small piece of text and a password through the hashing algorithm. Then you save a small piece of text (as plain text) and the resulting hash. This small piece of text is called a "salt".

f1cfuauy7OA.jpg

When someone wants to log in, they enter their password. The security app takes a saved piece of text or salt, places it in front of the entered password, and runs it through the same hashing algorithm to get the hash. It compares the resulting hash with the hash stored in the database, and if they match, you are granted access.

It is important to note that a salt or "small piece of text" is stored as plain text with a hash. It is also important to note that the salt is random for each password. In other words, each password has its own little piece of text.

This is a relatively simple concept, but it makes it much harder to crack hashed passwords.

Why do salts make hacking difficult?

Recall that rainbow tables are a dictionary of words and hashes of these words. In the example above, we used salts (a small piece of text) in combination with our password to create hashes. If a hacker wants to crack passwords, they can't use their rainbow table, because the rainbow table is just a hash of individual words. It needs to combine these words with the stored salt to get the actual hash that is stored in the database.

This makes password cracking much harder, because it means that the hacker's rainbow table is useless, and it forces him to recalculate the hashes for each word in his dictionary.

Here is an example of a password being created for someone called "good-guy”:
  1. The system administrator creates a new account in the system for a user called good-guy with the password "apple".
  2. The system automatically generates a short text fragment "yrtZd".
  3. The system takes a short text and combines it with 'apple' to create the text 'yrtZdapple'.
  4. Then it runs "yrtZdapple" through the hashing algorithm and gets a 128-bit number.
  5. The system stores this number as a hashed password for the good guy's account.

Here's how "good-guy" signs up:
  1. "good-guy" comes to work and tries to register. He types 'Apple' as the password.
  2. The system retrieves the entry for the "good-guy" account. This record is a hash and the text " yrtZd”, which is a salt.
  3. The system combines the word "apple” that the nice guy just typed with a salt to make the text" yrtZdapple " and runs a hashing algorithm on that.
  4. The system checks if the hash it extracted matches the hash it just generated, it matches and allows the "good-guy" to access the system.

Here are the steps a hacker takes to crack the good guy's salted password:
  1. A hacker arrives and manages to break into the system, and he steals a database of password hashes and salts.
  2. A hacker is trying to use pre-computed hashes of words in their English dictionary. One of the hashes has the word "apple", but this doesn't work because the hacker has to combine the salt that is "yrtZd" with the word apple before he hashes it.
  3. The hacker realizes that his precomputed rainbow table is useless. It needs to combine the salt for the good guy's password with each word in its dictionary, and then see which hash matches. This means that it needs to recalculate the hashes for its entire dictionary, which will take significantly longer.
As you can see from the example above, it is possible to crack passwords that use salts. It just takes a lot longer and requires more processing time.

Hashed passwords that use salts are what most modern authentication systems use. This doesn't make the password uncrackable, but it slows down the hacking process because it forces the hacker to hash every password they want to guess.

Now you have a working understanding of how modern password authentication works on systems such as WordPress, Linux, Windows, and many other systems. You also understand why salts are useful – because they prevent a hacker from cracking password hashes very quickly with rainbow tables. Now that you understand the benefits of salted hashes, it may seem obvious to you that everyone should use them when creating authentication systems. Unfortunately, they don't – there are many examples of purpose-built web applications that didn't use salts – they just used plain old hashes, and when they're cracked, it's relatively easy to reverse engineer passwords with rainbow tables.

GPUs and a home supercomputer

Since modern password cracking uses salts, if you want to use a dictionary of words to try to crack a password database, this means that you will hash each of these words with a salt every time you want to make a guess. So it becomes useful to be able to do hashing quickly.

It turns out that modern graphics hardware (GPU or GPUs) is very good at hashing and can do it in parallel. Using an out-of-the-box, high-quality gaming graphics card, you can hash passwords thousands of times faster than even the fastest processor on the market. This has led most competent hackers to buy GPUs for password cracking or use an online GPU accelerated password cracking cluster.

In just a few seconds, a modern GPU can allow a hacker to make several million attempts to guess a password.

Many of the algorithms that are used for hashing, such as MD5, were developed decades ago, when CPUs were very slow and GPUs didn't exist yet. To try to compensate for the increase in computing power that we experienced, the developers of authentication systems came up with something called “stretching”. What this does is take a hashing algorithm like MD5, and instead of running it once on the password and salt, it runs it thousands of times. In other words, the system will generate a hash, then generate a hash hash, then generate a hash hash hash, and so on for thousands of loops.

As a result, when a password cracker wants to try to guess a password, they don't just need to create one hash for each guess, but thousands of hashes. This has the effect of slowing things down, but it's still not enough.

WordPress uses salted hashes to store passwords using the MD5 hashing algorithm. It stretches MD5 by doing over 8000 MD5 rounds to try and make password guessing more computationally intensive. But a modern GPU can guess WordPress passwords at 3.2 million guesses per second. This is quite surprising in terms of performance. When MD5 was developed and when salts were first invented, hashing many words to try to guess the password took a long time. You can get multiple guesses every second. We can now reach 3.2 million guesses per second.

Now you have a good understanding of how passwords are used on services like Gmail, Yahoo, WordPress websites, and most other services that use a password for authentication. You also have a reasonable understanding of how to crack passwords.

Why Strong passwords are important

If one of the services you use is hacked and hashed passwords are stolen, even a teenager in their bedroom with a $ 2,000 gaming computer can try to turn your hashed password into a plain text password at 3.2 million guesses per second and possibly much faster. If you consider that eHarmony, LinkedIn, Google, and many other well-known brands have been successfully hacked over the past few years, it is likely that the service you are using will have their hashed passwords stolen soon.

This means that it is important to use passwords that are very difficult to crack. Any password with less than 12 characters is considered weak.

Why Strong passwords are important

If one of the services you use is hacked and hashed passwords are stolen, even a teenager in their bedroom with a $ 2,000 gaming computer can try to turn your hashed password into a plain text password at 3.2 million guesses per second and possibly much faster. If you consider that eHarmony, LinkedIn, Google, and many other well-known brands have been successfully hacked over the past few years, it is likely that the service you are using will have their hashed passwords stolen soon.

This means that it is important to use passwords that are very difficult to crack. Any password with less than 12 characters is considered weak.

How to crack this password

You should assume that the service you are using is managed by fairly competent system administrators and that they at least store hashed passwords, not plain text. For security reasons, let's assume that they use a weak hashing algorithm. In this case, we will count 1 round of salted MD5. Note that we give them the benefit of the doubt that they are actually salting their passwords.

If your password consists of 9 characters of lowercase numbers and letters, this gives you 101,559,956,668,416 possible passwords. (36 to the power of 9).

In Wordfence, we have an 8 GPU cluster that can crack salted MD5s at a rate of 90.6 billion salted MD5 guesses per second. It will take us 1128 seconds or 18 minutes to crack your password if we guess every combination of letters and numbers that are 9 characters long. We can do this faster if we exclude certain patterns.

Now you're starting to understand why longer passwords are better. You also begin to understand why you should use special characters as well as letters and numbers. Any password that uses only letters and numbers is weak. That's why:

If you have a password consisting of just 1 and 0, and it is 4 digits long, you will have:

2 to the power of 4 possible passwords or 16 possible passwords.

If you have a password consisting of digits from 0 to 9 (i.e. 10 possible characters) and it is 4 digits long you have:

10 to the power of 4, which is 10,000 possible combinations.

Now, if you instead create your password from all lowercase letters, uppercase letters, numbers, and a set of 10 characters, you have 26 + 26 + 10 + 10 = 72 possible characters. So if you have a password that is only 4 characters long now you have:

72 to the power of 4 possible passwords, which is 26,873,856 possible passwords.

As you can see, every time you increase the number of characters that make up your password, you get a huge increase in the number of possible passwords, even if you keep the length at just 4 characters in our example.

You get 26 million possible passwords of just 4 characters if you use a wider range of characters in your password. This really illustrates how important it is to use upper and lower case, numbers, and symbols in your password.

If you now extend the length of your password to 12 characters, you have 72 to the power of 12 or 19,408,409961,765,342,806,016. Even with our 8 GPU cluster, it will take us 2495937 days or 6838 years to guess your password if we try all possible combinations.

We are considering a 12-character password that uses

random (see next paragraph)

uppercase letters, lowercase letters, numbers, and symbols to be a strong password. And to be clear, this is a strong password, even if the service you are using stores passwords using 1 salted MD5 round, which is relatively weak. By comparison, WordPress uses over 8,000 rounds of salted MD5, which of course makes it 8,000 times slower for a hacker to crack WordPress passwords.

It is important to note that your password must be random characters and not consist of patterns such as the beginning or ending of a number or dictionary words. Once you enter dictionary words and predictable patterns into passwords, they become significantly easier to guess, because a password cracker can simply exclude anything that doesn't match the predictable pattern.

As computers become faster at hashing, what will developers do?

If the trend over the past few years is anything to go by, reverse engineering hashed passwords back into their plain text will continue to accelerate at an increasing rate. The GPU cluster we built to audit passwords for Wordfence clients is faster at hashing than the fastest computer on Earth in 2003. This is an illustration of how fast computing power increases.

Over the last 5 years, there has been an explosion in purpose-built hardware that does things that a CPU would have been used for before. The difference is that this hardware runs in parallel and is therefore much faster. The consumer gaming GPUs we discussed above contain more than 2,000 cores that can perform calculations in parallel. Another area that has been fueling innovation in parallel computing is bitcoin mining hardware. You can buy ASICs and FPGAs, which are both ways to build an application on a chip-and both can perform tasks like hashing in a massively parallel way. Bitcoin miners use ASICs and FPGAs for mining and have lowered the price of this hardware. It can also be used to crack passwords in parallel and at very high speed.

If we assume that the hardware will continue to accelerate at an increasing rate, we need to focus on how we store passwords. The use of hashing to store passwords is widespread and is the accepted solution at the moment.

Can we use better hashing algorithms?

In computer science, we usually aim to make algorithms faster. Paradoxically, the best password hashing algorithm is the one that is slower or computationally more expensive.

The advantage of a more expensive and slower hashing algorithm is that if you can slow down the time it takes to hash a password, you slow down the speed at which hackers can guess passwords. Algorithms such as bcrypt allow you to specify "complexity”, which affects the speed at which hashing occurs, and therefore the speed at which guessing occurs.

Another useful algorithm is scrypt, which is designed to make parallel computing more difficult. This means that a hacker can no longer use the 2000 cores in their GPU to try to crack your password at the same time. Instead, they need to make one guess at a time.

These options are not without problems. App developers like Facebook and Google want to provide you with useful services. They are becoming popular and have 10k customers who want to log in. If they use a hashing algorithm that takes, say, 5 seconds to hash the password on the server, that means they need 5 servers just to allow 1 user per second. They will need 50,000 servers to allow 10,000 users to log in per second. This may not be acceptable for Facebook, and they may choose a faster but weaker hashing algorithm.

There are several interesting ways to slow down hashing without overloading servers, which are discussed in the information security community. One of them is quite simple and is called "server-terrain". A way to make the server easier is that it uses a slower hashing algorithm, such as bcrypt or scrypt, and actually does most of the hashing in your web browser when you log in. This uses your workstation's CPU instead of the processing power of servers belonging to the service you are logged in to.

The hash that took longer to calculate is then sent by your web browser to the server you are logging in to, which turns it into a salted SHA256 hash and stores it. The effect is that you used a CPU-intensive hashing algorithm, which can be difficult to parallelize and slower. Your web browser did most of the computing, which saved valuable CPU cycles on the server you're logging in to. This will allow the authentication server to handle a large number of clients logging in and use a computationally expensive hashing algorithm without overloading.

Conclusion

This is where our introduction to hashing and passwords ends. We looked at the history of password storage, why password hashing is used, what rainbow tables are, and how salted passwords defeat rainbow table attacks. We also discussed how password cracking occurs and how hardware such as GPU ASICs and FPGAs can speed up the hacking process. We also gave you a brief introduction to algorithms that make it harder to crack passwords and a performance architecture that allows you to use a strong hashing algorithm without overloading servers.
Congratulations, you share good methods, I added +1 reputation
I wish you continued success.
 
Top