Tagged Questions

A cryptographic hash algorithm is a function which takes a variable size input and produces a fixed size output. The algorithm makes it difficult to predict the output for a given input, find two inputs with the same output, or reconstruct the input from the output.

67 views

How bad is it to use the identity function as hash for ECDSA?

I was recently asked whether a certain library supports the ECDSAwithNone Signature algorithm. Clearly this would mean ECDSA with the identity function as the hash function. I know this is a really ...
103 views

Small Quantum Signatures - Reality check needed

I've been thinking a bit lately about how to get quantum resistant signatures fast and (relatively) small. One idea I've been keen on exploring is finding a crypto PRNG that allows fast-forwarding, ...
52 views

Let's say we have Alice and Bob sharing a symmetric key $k$. Alice wants to leave a number of messages for Bob on an untrusted server (honest-but-curious model) that is also used by many other people ...
53 views

Triple DES as cryptographic hash function

I need to generate a hash for a small piece of data (~50 bytes). I'd normally use MD5 or SHA but that's not available in the platform I'm programming for. Luckily, it provides Triple DES and I ...
102 views

How is wpa2 authentication structured

I would like to understand the cryptography behind Wpa2. As far as I know, there are 4 messages on the 4-way handshake and three of them are values concatenated with hashes. First, I am trying to ...
92 views

Can the round function $F$ in a Feistel Network be practically any non-invertible function?

This question might seem silly, but how true is the fact that the round function $F$ does not have to be invertible? I am curious to know this, because non-invertible functions can be very lossy, ...
598 views

Toy hash algorithm that can be broken

I'm looking for a toy hash function, where the idea is to have high school students break (i.e. find a collision) a hash function by hand, in order to teach them how one way functions and hashing ...
151 views

Why have round constants in hashes?

This may seem like basic crypto knowledge, but why do hash functions like SHA-2 and Whirlpool have round constants that are absorbed into their respective states? I can understand that in a cipher ...
47 views

What level of security is provided when a Feistel Cipher is used as a round function of another Feistel Cipher?

Recently, I was reading: Are there any specific requirements for the function F in a Feistel cipher?, and the answer posted mentions a Feistel Cipher named Turtle, which uses a four-round Feistal ...
47 views

How to detect changes in data while preserving confidentiality (under constraints)?

Suppose party $A$ has two pieces of data, $X$ and $Y$, either of which may change separately, or they may change together. Given the following constraints: $A$ knows its current $X$ and $Y$ but has ...
53 views

Detecting Software Changes - Verifying untampered code

This question assumes an environment devoid of any internet connections, the software in questions operates in a non-connected environment on a single machine. I have a piece of software that may be ...
799 views

Why does AES-GCM need a hash/MAC in TLS?

"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" is just one example for a cipher suite, as far as I'm concerned it means this: It uses the TLS protocol, exchanges keys with Elliptic Curve Diffie Hellman ...
82 views

SHA256: Padding a 512 bits length message

I am currently implementing the SHA256 hash-algorithm for a "custom-built" embeded-device. Obviously I have a problem with message padding. The routine I wrote does not work with message whose size ...
31 views

Number of qubits and breaking hashes [duplicate]

Noting D-Wave's press release on a 1000 qubits quantum computer had me wondering... Does the number of qubits nonlinearly change the speed/rate at breaking a SHA256 hash? If someone makes a say ...
284 views

Does the position of the salt improve its effectiveness when hashing?

Seems most documentation I have read suggests the salt should prefix the value to be hashed. Is this just for consistency, or is the salt more effective when prefixed?
62 views

Why does TLS 1.2 use GCM with additional SHA hash? [duplicate]

I am studying the cipher suites provided by TLS 1.2 and found an interesting question. TLS 1.2 adopts GCM for encryption and SHA256 or SHA384 for hash (e.g. TLS_RSA_WITH_AES_128_GCM_SHA256). But, GCM ...
55 views

The benefit of PBKDF2 for big keyfile?

The man page of cryptsetup says: Whenever a passphrase is added to a LUKS header (luksAddKey, luksFormat), the user may specify how much the time the passphrase processing should consume. The ...
966 views

Is it theoretically possible to construct a string that contains its own hash value?

After saw the xkcd comic Self-Description, I wonder if it is theoretically possible to construct a self-descriptive string that contains its own hash value? Let's say the string's MD5 value is ...
812 views

For any hash value, is there an infinite number of inputs that hash to it?

Bruce Schneier writes (back in 2005) in a post on cryptanalysis of SHA-1: SHA-1 produces a 160-bit hash. That is, every message hashes down to a 160-bit number. Given that there are an ...
3k views

What is a “freestart collision”?

In their work on SHA-1 collisions (cf. the currently unpublished paper “Freestart collision on full SHA-1” by Stevens, Karpman, and Peyrin) Stevens et al show that they are able to generate "freestart ...
84 views

MD5 Collision Attack Explained

In one of my assignments, I came across this line Due to MD5’s length-extension behavior, we can append any suffix to both messages and know that the longer messages will also collide. This lets ...
1k views

SHA-1 collisions - what about practical attacks?

I understand the theoretical problem with hash collision but when it comes to practice, I get very confused. Suppose a attacker would like to forge a certificate (or any kind of structured piece of ...
74 views

Are there full cycle cryptographic/one-way hash primitives?

I'm looking for behavior similiar to that of LCGs, (i.e. input and output sizes are same). Full cycle of $2^{32}$ different inputs generates full cycle of $2^{32}$ different outputs, distribution of ...
70 views

Encrypt hash using hash of hash?

I wonder what is wrong with this scheme for authentication. Server sends random challenge, C Client returns (C, B(P)) encrypted in H(B(P)) where B(P) is high work factor salted hash of the user ...
2k views

Why does SHA-1 have 80 rounds?

Why does SHA-1 algorithm have exactly 80 rounds? Is it to reduce collisions? If yes, then why do SHA-2 and SHA-3 have a lower number of rounds?
88 views

How does perfect hash function works?

According to wikipedia, a perfect hash function is a hash function that uses algorithms that has a certain random aspect to their logic. It is suppose to be collision-free. However due to the pigeon ...
47 views

Hash functions vs. keyed hash functions in the context of private key generation

I'm designing a key distribution mechanism and have thought of using a securely generated/acquired private key as a seed for a sequence of private keys to be distributed to a number of users using a ...
32 views

For the scrypt HMAC storage format, why run the input of the hash and the hash itself into the HMAC

Generally if the body is hashed, why provide the body and the hash as input into the HMAC. Instead wouldn't the same security be achieved by hashing the body and providing only the hash as input into ...
52 views

So I'm reading this question to learn more about length extension attack, and I want to make sure I understand the basics of padding. It says in the post that given the hash and the length of the ...
116 views

How have MD5 constants been determined?

For instance, the per round shift amounts, ...
34 views

MD5 SSL Collision Attack

I want to create fake certificate for test purposes. I have read about the http://marc-stevens.nl/p/hashclash/index.php project but I am unable to understand the two files that I have to put as input ...
95 views

Are there MD5 collisions for inputs of different length?

There are many examples of MD5 collisions (some of them can be found here Are there two known strings which have the same MD5 hash value?). But as far as I know two inputs should have the same length ...
97 views

SHA-256 “almost unique”?

I have seen numerous references on the internet of people describing SHA-256 as generating an "almost unique" hash. Exhibit A. there are more. Is there some mathematical basis to the almost ...
26 views

Is a timing side channel attack effective when the leaked information is related to the result of a hash?

I'm writing a function to act as a cryptographic hash of a number within a range that returns another number of the same range. The catch is that the result needs to have certain properties. I run a ...
441 views

Can an encryption method be used as a hash function?

As I understand, there are a few requirements for a good hash function. Hard to find any message from a given hash Hard to find any 2 messages which give the same hash A single bit change in the ...
263 views

Quantum on hash

Perhaps this has been answered before. Grover's algorithm should result in a 256 bit hash being complexity 128 bits to crack. I was wondering, what if you had a 512 bit hash , and xor'd the lower 256 ...
71 views

Elliptical curve cryptography Determine if a public key point y is negative or positive, odd or even?

Take a Elliptical curve cryptography public key (x, y) and its additive inverse (x, -y). How do you identify which is the positive point and which is the negative point? Example Private key 1 -> (x, ...
94 views

Is this client-side password hash scheme secure?

I want to build an app that uses client-side encryption for storing encrypted data on the server. A user-specific master key would be used, so to easily share it between devices a encrypted version of ...
72 views

How does the small n attack work?

I'm studying the Lamport's Hash one-time password scheme. This is the scheme: Alice wants to authenticate herself to Bob from a workstation that knows nothing about her. Alice only knows her ...
88 views

If I compute the SHA-1 of all possible 40 digits hexadecimal strings, will I get all possible sha1 hashes? [duplicate]

Wikipedia says sha1 produces a 160-bit (20-byte) hash value. So if I compute the SHA-1 of all possible SHA-1 values, which as far as I understand is at current time impossible both to calculate and ...
2k views

Are common cryptographic hashes bijective when hashing a single block of the same size as the output?

It's been said that CRC-64 is bijective for a 64-bit block. It the corresponding statement true for typical cryptographic hashes, like MD5, SHA-1, SHA-2 or SHA-3? For example, would SHA-512 be ...
76 views

Chance to find HMAC key/salt when having knowledge of the hashed data?

I'm not sure how to word this... I'm working with a HMAC (I think of it being a "salted hash"). I know the entire string being hashed, I do NOT know the salt. I also know the first 8 characters of the ...
69 views

Bobcat hash, trying to find a 48-bit hash collision for x

I am trying to find a collision with the Bobcat hash of the 48-bit hash. I am a beginner coder so please point out any flaws in my modification of the bobcat program. It does find a truncated 12-bit ...
110 views

Encrypt a message with hash function, shared symmetric key, but no cipher

I am very new to Crypto and need some clarification or input. The question is: Suppose that Alice wants to encrypt a message for Bob, where the message consists of three plaintext blocks, $P_0$, ...
110 views

Would it matter if my miner was hashing random vs incremental values?

I'm working on my miner for my "game" site that's basically a pre-image attack from a hash posted online. You submit a hash input, it's hashed, and your score is the hamming distance (the number of ...
90 views

How much can I shorten a password hash before it begins to impact security? Suppose that I use PBKDF2 (correctly salted) with HMAC-SHA256 as the PRF. From what I've seen, it's typical to use 256 ...
86 views

Are there any algorithms/protocols that let you produce a specific length of random tokens/bits in such a way that you can cryptographically determine which 2 or more tokens/bitstrings where produced ...
92 views

How does DSA provide non-repudiation in proving a document was properly displayed (not altered or displayed incorrectly)?

I am building an iOS app that allows the user to sign a document served to them by a web server. So that page of the app simply has a document in the top pane, and at the bottom pane, a place to sign ...