Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [hash]

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 find two inputs with the same output or reconstruct the input from the output.

2
votes
1answer
46 views

How to encrypt sensitive files in a business application? Is it needed?

I'm currently working on a business Java application, and we store sensitive files related to our users. What is the appropriate approach to store them securely? Is it viable to encrypt/decrypt all ...
3
votes
1answer
58 views

Could we use a more efficient hash for signature generation?

Is it possible to use a more efficient hash - such as one based on GHASH - instead of a cryptographic hash for signature generation? In other words, could a combination of a fast hash and the private ...
0
votes
1answer
50 views

Does hashing an encrypted message suffer from any drawbacks?

I am working on this problem where the set up is like this: There are three hosts: A, B and C. A wants to send a message to C which passes through B. At A the message is hashed, the hash is padded to ...
0
votes
1answer
78 views

Newbie question: one-way functions in cryptography

I'm reading this article on the basics of cryptography and it says that the main principle is about taking such an algorithm that knowing the end result and the algorithm, an eavesdropper wouldn't be ...
2
votes
0answers
56 views

How to derive a hash function from another hash function?

Problem: I'm trying to figure out how to solve this, apparently it's hashing the hash value itself. So G has two rounds of hashing the original message x. I tried searching for the relationship ...
1
vote
0answers
63 views

What lightweight cryptographic hash function for short input could I use for HMAC?

I am looking for a cryptographic hash function that I can configure for HMAC. The input that I will hash is around 50 bytes. The function must be fast, and computationally lightweight.
1
vote
1answer
43 views

Instead of sending a set of random values, send a key for a PRF

Some Protocols require one party to send $n$ random challenges (or random values) to another party. For communication efficiency purpose, one can pick a random key for a pseudorandom function, and ...
3
votes
2answers
83 views

KDF Salt: How/When is it Okay for it to be public?

Post Structure: Prior source material studied Question & Details Assumed threat model Example Assumptions Clarifications Prior source material studied 0.1. RFC 2898 0.2. HAC (Handbook of ...
-2
votes
2answers
93 views

How to determine if a Hash function is preimage resistant?

So I'm trying to solve this problem. There are of course more but I'm trying to figure out how would I even solve this first one in order to do the rest. Any hints or help in the steps would be ...
0
votes
1answer
52 views

Why do m and m' both hash to H2?

I'm trying to understand the following text: I'm having trouble understanding why $m$ and $m'$ both hash to $H_2$. I tried doing truth tables for $m_1'$ and $m_2'$ given the equations but I don't ...
0
votes
1answer
56 views

How long would it take to crack a double hash if salt and final hash are public?

I have a hash of a file $H_1$ and then I add salt and rehash it: $H_2$. I make my $H_2$ and salt public and I use my $H_1$ as a password. How long would it take for this to be cracked with someone ...
1
vote
0answers
56 views

Private Key Sharding - How is it Secure in a Distributed Network?

In a Distributed Network in order for a private key not to be compromised sharding will have to take place off the network, correct? If so: Why is it when a Distributed Network shards private keys ...
9
votes
5answers
2k views

Hash to prime numbers?

Is there some provably secure hash function to prime numbers? Say, a function $H: \{0, 1\}^* \rightarrow \{e: e \in \{0, 1\}^\lambda \land e$ is prime$\}$ I'm asking because there are some ...
0
votes
1answer
32 views

Secure offline treasure hunt

Say I would like to create an app that would allow users to organize treasure hunts for their parties. The host of the party would create a list of GPS coordinates for each hiding spot and distribute ...
4
votes
1answer
86 views

Need help with NFC Tags and cryptography

I have some NFC-Tags, which will be added to my devices. These NFC Tags are basically EEPROMs with an unique UUID (7-Byte, readonly, public) and some constant parameters (approx. 7-15 Bytes, read and ...
0
votes
1answer
69 views

Practical attack on md5 hashing algorithm?

I have the following conditions: String which consist of "STRING+key+ID+key" is hashed with md5. I have a knowledge of STRING (10 chars), ID is probabilistic (int 15), key is 15 chars long (a-z A-Z 0-...
4
votes
1answer
100 views

Is there any way to check hash of homomorphic encrypted data?

I need some algorithm that satisfies: H - hash function Enc - encryption function (using public key) M - secret data $Enc(H(M)) = H(Enc(M))$ Let this system exist: the First person has a secret ...
3
votes
3answers
382 views

What is different below two Ciphersuites?

I have two questions; I need an explanation for the differences of below two cipher suites. How do they work with SSL/TLS protocol? (my main concern first one doesn't have '...
1
vote
0answers
52 views

Hashing into a supersingular elliptic curve

Is there any way to hash from a string $\in \{0,1\}^{*}$ into a supersingular elliptic curve $E(F_p)$ such that the hash function behaves(provably) like a random oracle, and is efficient? Using ...
3
votes
1answer
119 views

What does Keccak being “efficiently invertible” mean?

Reading through Wikipedia, I saw this: It has been shown that the Merkle–Damgård construction, as used by SHA-2, is collapsing and, by consequence, quantum collision-resistant, but for the sponge ...
2
votes
2answers
429 views

Optimal bit-change-probability of the avalanche effect for hashes

Avalanche effect: The strict avalanche criterion (SAC) is a formalization of the avalanche effect. It is satisfied if, whenever a single input bit is complemented, each of the output bits changes ...
1
vote
0answers
37 views

Why isn't a range proof calculated using size?

For example a Pedersen commitment for an elliptic curve of maximum $2^{64}$, requires every number between $0 \to 2^{64}$ to be checked. Why do range proofs, in the case of a Pedersen commitment, not ...
3
votes
1answer
169 views

MD5 - Chosen Prefix Collision Attack

Given 2 messages $m_1$ and $m_2$, in a chosen prefix attack, we want to find $s_1$ and $s_2$ such that: $\text{MD5}(m_1 || s_1) = \text{MD5}(m_2 || s_2)$ Are $s_1$ and $s_2$ found by brute force ...
0
votes
1answer
85 views

Is there an $n$-bit hash function such that $n$ is equal to the length of input and the collision resistance is close/equal to $2^{n/2}$?

Let $B$ denote a non-empty bitstring of arbitrary length. Then let $n$ denote the length of $B$. The question: does there exist a cryptographic hash function $H$ that outputs a hash $h$ of $B$ such ...
2
votes
2answers
129 views

AES-128 as compression function in Merkle-Damgard construction

Using a compression function $f : A × A → A$. A basic version given by: $W_0 = IV$ $W_1 = f(W_0, m_1)$ $W_2 = f(W_1, m_2)$ ... $W_n = f(W_{n-1}, m_n)$ $W_n$ is the output of the hash function, $...
3
votes
1answer
76 views

Can length extension attacks be avoided by a single bit flip?

It always seemed to me that length extensions are possible simply because no special operation is performed after the last operation - for instance in a Merkle-Damgård construction. Basically the MD ...
0
votes
0answers
28 views

Simplifying the description of the Keccak padding rules

I would like to check if my following understanding of Keccak padding has any flaws and if there are, please feel free to point them out and correct them. The Keccak version I am interested is the ...
0
votes
2answers
70 views

Can I find the IV of a single block of SHA256, given the plaintext and digest?

Each 512-bit block of SHA256 takes an initialization vector (IV) and message schedule and returns a digest. Knowing the message schedule and resulting digest, is it feasible to reverse the algorithm ...
3
votes
2answers
149 views

Are Hash Palindromes Possible?

I'm trying to figure out whether the following is impossible or merely improbable: Does there exist an input, I and its hashed value, ...
0
votes
1answer
87 views

Does hashing a PRNG by a cryptographically secure hashing algorithm result in a CSPRNG?

Or specifically, does ChaCha20 hashing of the xoroshiro128+ random number generator result in a cryptographically secure random number generator?
0
votes
1answer
45 views

Hash ratchets with truncating hash function

I'm working on a forward secret messaging system that relies on hash ratchet. I'm using BLAKE2b as the one-way function, which by default produces 512-bit digests. These digests are truncated by my ...
1
vote
0answers
37 views

Validation of Merkle branch for a root

In the paper of the Honey Badger BFT link, which is a BFT algorithm, that makes use of cryptography, there is described an algorithm for a reliable broadcast with erasure codes. Following part of the ...
0
votes
2answers
66 views

Clarification of one-way property of hash functions

One-way property: computationally infeasible to find data mapping to specific hash The definition above is a little vague, if we have h(x) = floor(log(x)), ...
0
votes
1answer
52 views

Implementation of MiMC over Edward curve

I'm trying to use MiMC-hash function [1] over Edwards curve, in order acheive an hash function that output a point on Edwards curve. However, in Section 5.1 ([1]), they state that $gcd(3,p-1)=1$, ...
1
vote
0answers
75 views

How does Skype hash the phone number to a fixed length? [closed]

I have a Skype account with a phone number and I noticed that my contacts and I who created the accounts with a phone number have the Skype ID in some form of a hash. But all the Skype IDs have the ...
0
votes
4answers
1k views

Can the same One-Time-Pad be re-used with some tricks

Let’s say I have a message $m$ of $n$ bits. And a predetermined pad of $k*n$ bits. And for every bit $b$ of this message $m$, I’m creating random sequence $s$ of $k$ bits. I also have a predetermined ...
-1
votes
1answer
89 views

finding encoding based collision

For example, If I enter as a sample "hello world" in English, how hashing protocol generates a hash of it? is in the first step, change it to ASCII or Unicode or Binary? What if I find a word in other ...
0
votes
1answer
177 views

Hash-Then-Encrypt or Encrypt-the-Hash?

My question is would it make any difference if I use SHA3 and hash a block of data and then encrypt it using RSA is most secure to do the reverse? The question is about Site-To-Site transmission ...
2
votes
2answers
163 views

Differences between hash- and encryption algorithms?

There is a lot of confusion between hash- and encryption algorithms; I would like to understand: When do we use a hash algorithm and when do we use an encryption algorithm (a cipher)? How difficult ...
0
votes
1answer
78 views

Where should I start to learn cryptography? [duplicate]

I want to learn cryptography. I just wanted to ask people who experienced about the field that where should I start? Any recommendation would be something for me. Thank you in advance.
7
votes
3answers
1k views

Can I hash a secret key and used the hash as key ID?

I am using AES-CBC to provide confidentiality for protocol messages. I want to allow the receiver to know the secret key by using a key ID. For this I hash the secret key to generate a key ID. Every ...
7
votes
2answers
191 views

Why aren't hash values for “nothing” (empty) defined as all zeros?

Any decent hash algorithm will produce basically "random like" values for any given input including the empty input. For example MD5 produces d41d8cd98f00b204e9800998ecf8427e on an empty input. I ...
0
votes
1answer
232 views

Birthday Attack against Cryptocurrency

One of my friends is creating his own cryptocurrency, just as a fun project, and he made some design choices that I think are insecure, but I personally don't have enough expertise to evaluate. ...
1
vote
1answer
56 views

For ElGamal-based key encapsulation, is it necessary to hash before using as AES key?

I'm working with SJCL, specifically using ElGamal to encrypt messages. Behind the scenes, this is doing something similar to what's described in this SO post (emphasis mine): Regardless how big ...
2
votes
1answer
134 views

HMAC-SHA512 output randomness?

This is regarding an online roulette game that claims to be fair. Here is the explanation: Two strings are created: ...
-2
votes
2answers
147 views

VeraCrypt a weak point [closed]

Biggest flaw in VeraCrypt(or other Encryption programs) is Hash Algorithm. VeraCrypt hashes (SHA,Whirlpool,Streebog) it is the only point where can break an encrypted disk. Because break algorithm (...
4
votes
0answers
45 views

Why does FS&K's SHAd-256 construction zero-prefix the inner message?

Ferguson, Schneier and Kohno's Cryptography Engineering §5.4.2 describes a construction, $SHA_d\text-X(m)$, which is just $SHA\text-X(SHA\text-X(0^b\mathbin\|m))$ (where $SHA\text-X$ is any particular ...
2
votes
0answers
46 views

Secure hashing when the input comes from a small space

I have a problem that I'll simplify here. Let's say I want to store a table of {person, fav color}. Only, I don't want anyone to ever be able to look up a person't favorite color; the only thing ...
1
vote
1answer
71 views

Efficient arithmetic Hash function

Modern hash functions are considered to be efficient to calculate by boolean circuits (i.e their implementation are using bits- operations). I'm looking for a cryptographic hash function, that can be ...
1
vote
0answers
34 views

Is “hash-then-XOR” a good way of incrementally hashing an unordered set? [duplicate]

Is hashing the individual items, and then XOR-ing the results together, a good way of uniquely hashing an arbitrary unordered set of items? I am thinking of using hash-then-XOR since I want some sort ...