Hot answers tagged

259

The output of MD5 is binary: a sequence of 128 bits, commonly encoded as 16 bytes (technically, 16 octets, but let's use the common convention of bytes being octets). Humans don't read bits or bytes. They read characters. There are numerous code pages which tell how to encode characters as bytes, and, similarly, to decode bytes into characters. For almost ...


203

This approach is fundamentally flawed. Anything on the client side can and will be tampered with by players. It is the same problem which makes DRM untenable - the user owns the machine and all the data on it, including your executables, data in memory, etc. Keeping algorithms secret doesn't work (see Kerckhoffs's principle) because it only takes a small ...


108

... in which it clearly states that these two strings ... No. It clearly states "... two different sequences of 128 bytes ...". There is a huge difference in these statements. In the first the strings are taken as they are. In the second one will hopefully realize that these are 256 character long strings which consist of hexadecimal characters ...


93

The size of the input is irrelevant. In fact, because of the birthday paradox, collisions are guaranteed as soon as the size of the message exceeds that of the hash. The best way to avoid collisions is to use a stronger hash which is not vulnerable to them, such as SHA-2. However, you are describing a more difficult attack than a collision attack, called a ...


90

As a password cracker, I encourage all of my targets to use this technique. 😉 This (understandably!) seems like a good idea, but it turns out that against real-world attacks, wrapping an unsalted hash with bcrypt is demonstrably weaker than simply using bcrypt. (EDIT: First, to be clear up front, bcrypt(md5($pass)) is much better than md5($pass) alone - so ...


67

Yes, they were likely able to crack many of the passwords in a short time. From the official Yahoo statement: For potentially affected accounts, the stolen user account information may have included names, email addresses, telephone numbers, dates of birth, hashed passwords (using MD5) and, in some cases, encrypted or unencrypted security questions and ...


61

My question is: Does every hash value H have a value V? For example, given md5 hash value f2c057ed1807c5e4227737e32cdb8669 (totally random), can we find what it was from? These are actually two very different questions: whether there is an input for each output, and whether we can find an input for each output. For your first question: we do not know. ...


59

Try sending a HEAD request. I'm assuming that with ascii.txt included, the output of the script is just over a nice number like 4096 bytes, a common output_buffering value. Once the script has written output_buffering bytes, it needs to flush the output buffer before continuing. Normally this works fine and the script continues, but if the request type is ...


45

The password format in the userpassword attribute looks like the standard format used by various unix services, such as the default system password service which stores hashed passwords in /etc/shadow. The format is basically: $ type $ salt $ hash In your example, the type is 1, which designates an md5 hash. There are other well-known types, such as ...


43

Hash functions output binary data, usually as a byte array. This cannot be displayed correctly, therefore, you need encoding. Transmitting binary data can create problems, especially in protocols that are designed to deal with textual data. To avoid it altogether, we don't transmit binary data. Many of the programming errors related to encryption on Stack ...


40

There are three problems here: What you're trying to do is fundamentally misguided in several ways, as described in Polynomial's answer. If you insist on doing it anyway, then you're not even using the right primitive! Authenticating messages requires a MAC, not a hash. It's possible to build a MAC out of a hash -- this is what HMAC does -- but it's not as ...


40

The attacker is trying to exploit Joomla component called com_s5clanroster which is vulnerable to SQL Injection. An SQL injection vulnerability has been reported in Joomla Com S5clanroster. Successful exploitation of this vulnerability would allow a remote attacker to execute arbitrary SQL commands on the affected system. https://www.checkpoint.com/...


40

As pointed out in the other answers, the hexadecimal strings must be decoded to raw bytes first, then the raw bytes should be fed into the MD5 hash function. If you do this, both produce a hash of 79054025255fb1a26e4bc422aef54eb4. This can be done easily on the command line: echo -n '...


38

SHA-1 and MD5 are broken in the sense that they are vulnerable to collision attacks. That is, it has become (or, for SHA-1, will soon become) realistic to find two strings that have the same hash. As explained here, collision attacks do not directly affect passwords or file integrity because those fall under the preimage and second preimage case, ...


37

Short answer: collisions don't matter for password verification. The length of the input is irrelevant. I understand that md5 and sha512, etc... are insecure because they can have collisions. No, this is wrong. MD5 and SHA-1 are insecure because it is possible in practice to find collisions. SHA-512 and the other SHA2 variants (SHA-256, SHA-384, etc.) have ...


36

While Royce's answer is correct in that wrapped hashes are weaker than unwrapped pure bcrypt hashes, it must be noted that they are nevertheless significantly stronger than your current implementation with a weak hash algorithm and no salt, since an attacker would have to go through the effort of individually attacking each hash, instead of simply using ...


32

There are lots of known cryptographic weaknesses in MD5 which make it unusable as a message digest algorithm, but not all of these also apply in the context of password hashing. But even when we assume that these do not exist, MD5 is still a bad password hashing algorithm for one simple reason: It's too fast. In any scenario where an attacker obtained the ...


30

The definition of a cryptographic hash function includes resistance to preimages: given h(x), it should be infeasible to recover x. A hash function being "reversible" is the exact opposite of that property. Therefore, you can have no more a "reversible hash function" than you can have a fish allergic to water. Possibly you might want a hash function which, ...


30

This password hash seems to use the crypt() format (which, despite its name and what some documentations say, including that very man page, has absolutely nothing to do with encryption; it is hashing). When it starts with $1$, this means that it is a password hashing function based on MD5. Its exact specification is "whatever glibc does". A look at the ...


28

First, there's Kerckhoffs's principle which is always desirable: A cryptosystem should be secure even if everything about the system, except the key, is public knowledge. where in this case the password is the key. So its not a goal to keep the cryptosystem secret. Second, you are wrong about those being md5 or sha512 hashes; the values stored in your /...


28

'face2face' is only 9 characters, i.e. 36 bits since we are using hexadecimal encoding. It suffices to generate many pictures with some internal variations (subtle variations that do not impact the graphical output) and hash them all until the target string is obtained. Since we are looking for a 36-bit pattern and accept that pattern wherever it appears in ...


27

The security flaw isn't in MD5 in this case. And the idea isn't to get if (!isset($_POST['pass']) || md5($_POST['pass'])!='castle') to evaluate in favor of the hacker. The vulnerability appears when you crash the script. The admin privileges are not conditional. No matter what the user gets their permission elevated by setting 1 to $_SESSION['admin_level']. ...


27

Edit: To clarify, I can't speak to the security of your approach, only the hash portion. There are some strong comments here discouraging your approach. (i.e. a good hash can be part of a secure approach or an insecure approach, just like a good lock can be used on either a good door/frame, or a flimsy door/frame) In response to your TL;DR I can say quite ...


24

And it is longer than the input string, with 288bit instead of 256bit. So did we actually increased the entropy? No, you did not increase the entropy. In this context, "entropy" basically refers to the probability of any particular guess about the content or value being correct. If I tell you that I have hashed a single lowercase US English letter's ASCII ...


23

First of all, MD5 is not an encryption algorithm. It is a hash function. Encryption generally implies decryption, which you cannot do with a hash function. Who said MD5 is good or unbreakable? It is 'breakable'. The complexity of obtaining a collision for MD5 is around 2^64. This is the equivalent of an exhaustive key search of 64 bits, quite weak for ...


22

Stop. Go no further. Do no more testing, demonstration, etc. until you have been explicitly asked to do so in writing, and even then beg off and suggest that there are many more qualified people than you to do an audit/pentest/etc. I know of 2 people who did similar with less information (no passwords, just details that they didn't need access to and ...


22

It depends. There is not enough information in your question to give specific answers, and probably without knowing the server side, it will be hard to evaluate. Isn't this a breach? I would not call it a breach just yet, because simply knowing the fact that the client hashes the password does not reveal any sensitive information about this or other accounts....


21

(Summary is in the last paragraph.) How long will it take to crack 1 password? Is the time to crack 1 billion, just 1e9 * t? Imagine I have this hashing algorithm: function hash(password): hash = 0 foreach character in password: hash = hash + toNumber(character) return hash If you call hash("ab") it might return 3, since the first ...


20

Those are byte values not strings. Use https://cryptii.com/pipes/md5-hash and change input to bytes. Both byte arrays produce equal hash 79054025255fb1a26e4bc422aef54eb4.


19

It's not MD5 (which is a message digest algorithm, not an encryption algorithm), and it's not even base 64. It's just ASCII encoded as hex. It contains http://imgur.com/EUJCsGB which is a link to an image of a bird. The image was uploaded by someone named MD5, that's as close as it gets.


Only top voted, non community-wiki answers of a minimum length are eligible