instruction
stringlengths
15
30k
Prover is going to convince verifier that 2 objects are distinct, do you know any Arthur-Merlin protocol for this problem?
I haven't really seen what computational complexity class of decryption of AES is. Can anyone provide reference papers or answers here?
What is the SHA-256 hash if the input is null, i.e. an empty bitstring? (Not the hash of 0 or "0".)
I am quite confused calculating the unicity distance and I was hoping that someone can clarify some things for me. My main issue comes from somewhat a difference of the calculation given by our teacher and the one I find in wikipedia/other topics in here as stated in this article :[http://crypto.stackexchange.com...
I am using randomsound because I thought it would be a good idea to inject some additional entropy into the entropy pools of my linux machines (clearly those machines have a corresponding sound card). (Un)fortunately, I am a quite paranoid person, and, therefore, I am reviewing the source of randomsound (https://lau...
Is randomsound for increasing entropy pool not doing what it is supposed to do?
I am quite confused calculating the unicity distance and I was hoping that someone can clarify some things for me. My main issue comes from somewhat a difference of the calculation given by our teacher and the one I find in wikipedia/other topics in here as stated in this article :[http://crypto.stackexchange.com...
Ah ... I see. I am not a C/C++-expert. So the union in *injector* "projects"*ints* on *bitfield* and vice versa. That is, the start of *ints* and *bitfield* in memory is the same. Writing on *bitfield* automatically writes on *ints*. See http://www.wachtler.de/ck/8_7_struct_union.html (in german). So everythin...
Assume we have plaintext in natural language. Can we use format-preserving encryption in such a way that the produced ciphertext cannot be distinguished from natural language?
I was reading the Wikipedia article on Post Quantum Cryptography and was interested in opinions as to whether the Supersingular Elliptic Curve Isogeny Diffie-Hellman listed there would be a good Post Quantum replacement for Elliptic Curve Diffie-Hellman that is being implemented today?
I don't see an immediate risk of using the hash of the key as the nonce for AES GCM. Is there something I could be overlooking?
Is it OK to use a hash of the key as nonce for AES GCM?
Say that one uses a known LFG (2 known lags $a$ & $b$, known inner state length $N$, known modulo $m$) to hide some text with a basic à la Vigenère cipher: $C_i=(P_i + {PRNG}_i) \bmod 26$. Say that the adversary intercepts some ciphered text (not the LFG output), could they use it to perform a correlation attack t...
The Supersingular Elliptic Curve Isogeny Key Exchange that you refer to was first published in 2011 by DeFeo, Jao, and Plut. It builds on but is quite distinct from earlier work by Rostovetsev and Stolbunov in 2006. As a Post Quantum/Quantum Safe replacement for Elliptic Curve Diffie-Hellman (ECDH) it has several goo...
A modern trend in cryptography consists of defining security as rigorously as possible, and then designing schemes which are secure according to those definitions. Proving security comes in the form of reducing one scheme to a more basic problem or scheme. Furthermore, there are many different ways of formalizing secur...
I am quite confused calculating the unicity distance and I was hoping that someone can clarify some things for me. My main issue comes from somewhat a difference of the calculation given by our teacher and the one I find in wikipedia/other topics in here as stated in [this question / answer][1].<br> $U=\frac{H(k)...
I am wondering if there is a feasible way that, given a certain elliptic curve, I could choose what x-coordinate will have its point in the public key. If it is not possible, is there a way to choose the most significant digits of that coordinate? For example, a way to create a EC public key 04 0000....1234 y-coord...
Is it possible to choose which point will have the public key of a given Elliptic Curve?
For some project, I need to store some short string in encrypted form. It would be ideal for the current purposes to encrypt it using itself. # This would be the usual way: result = AES_ENCRYPT(string, key) # but I would like to do it this way: result = AES_ENCRYPT(string, string) The same st...
8 bit / byte would be perfect obviously. `head -c 1M /dev/urandom | ent` gives ~ 7.9998 bits per byte. Now, if I have a physical entropy source, how much entropy is sufficent. E.g. my sound card produces 7.8 to 7.9 bits per byte for 1M raw data generated via randomsound. My main question: Is this amount of...
Physical entropy source: How many bits entropy per byte is sufficent?
I've reading on GPG since yesterday and I have a doubt: the whole system of double key encryption does make sense but it looks to me like either way you are compromising something in terms of security. If someone sends me an encrypted file using GPG and he/she wants to make sure that I'm the only one able to decrypt...
*Entropy is a function of the distribution.* That is, the process used to generate a byte stream is what has entropy, not the byte stream itself. If I give you the bits 1011, that could have anywhere from 0 to 4 bits of entropy; you have *no way* of knowing that value. Here is the definition of Shannon entropy. Let ...
First, take note of [my answer to the question *Estimating bits of entropy*](https://crypto.stackexchange.com/a/10408/2454). A key phrase therein: > You'll never be able to look at a bitstream without knowing the distribution and say "there are X bits of entropy here." The `ent` program *doesn't* know the distrib...
I am wondering if there is a feasible way that, given a specific elliptic curve (such as secp256r1), I could create a keypair where the public key has a given $x$-coordinate. If it is not possible, is there a way to choose the most significant digits of that coordinate? For example, is there a way to make a secp256...
A modern trend in cryptography consists of defining security as rigorously as possible, and then designing schemes which are secure according to those definitions. Proving security comes in the form of reducing one scheme to a more basic problem or scheme. Furthermore, there are many different ways of formalizing secur...
Is there any cryptographic algorithm immune to side channel attacks based on scan chain? In VLSI point of view.
Is there a cryptographic algorithm which is immune to side channel attacks?
I have quite a big problem, because of a software implementation of TLS I had to adapt I had to create something which is now biting me. It all comes down to this: I need to know the length of the plaintext when I want to decrypt it and the length of the ciphertext when I want to encrypt it. For the 2nd one I've mad...
Are there security issues with adding plaintext length to TLS packets?
Best ways to estimate average bits of entropy in a byte stream. I know there are different statistical tests out there (NIST, Dieharder, etc), which all do different ways of analyzing entropy. What I'm having a hard time finding is any particular literature which describes how to go from those tests to actual bi...
I am using randomsound because I thought it would be a good idea to inject some additional entropy into the entropy pools of my linux machines (clearly those machines have a corresponding sound card). (Un)fortunately, I am a quite paranoid person, and, therefore, I am reviewing the source of [randomsound](https://la...
I'm reading Bernstein's [RSA signatures and Rabin–Williams signatures: the state of the art](http://cr.yp.to/sigs/rwsota-20080131.pdf). In section 6, Bernstein states: > Recall that Rabin’s system needed to try several values of r, on > average about 4 values, before finding a square H(r,m) modulo pq. The > Rabin–...
Recently, Fujisaki and Okamoto have provided a revised version of the Fujisaki-Okamoto transformation [1]. This new version departs from the original [2] and does not define a knowledge extractor. Instead, they directly provide an algorithm for the decryption oracle. When describing the decryption oracle construction, ...
Recently, Fujisaki and Okamoto provided a revised version of the Fujisaki-Okamoto transformation [1]. This new version is slightly different than the original [2] and the security proof does not define a knowledge extractor. Instead, they directly provide an algorithm for the decryption oracle. When describing the decr...
It seems like the brain-dead simplest KDF would have a key-stretching structure that is not substantially different from $\text{hash}(S | P | S | P |\dots|S|P)$, where $S$ is a salt and $P$ is a password. Other protocols generally require lots of hashes-of-hashes-of-hashes; this one builds up one big string to hash. Th...
What's wrong with a iterative (with counter) hashed salted KDF?
What's wrong with an iterative (with counter) hashed salted KDF?
I'm working on a zero knowledge proof system that uses ECC over $\mathbb{Z}_p$ (currently using NIST P-256 since mbed TLS doesn't support group operations on Curve25519, but the problem should be general). Part of this involves calculating the inverse of a group element. For some point $a=(x,y)$ I calculate $$a^{-1...
Is the inverse of a point on an elliptic curve over $\mathbb{Z}_p$ always in the group?
I'm working on a zero knowledge proof system that uses ECC over $\mathbb{Z}_p$ (currently using NIST P-256 since mbed TLS doesn't support group operations on Curve25519, but the problem should be general). Part of this involves calculating the inverse of a group element. For some point $a=(x,y)$ I calculate $$a^{-1...
I'm trying to determine the residue requirements of Rabin-Williams. An older copy of [P1363's Public Key Cryptography](http://perso.telecom-paristech.fr/~guilley/recherche/cryptoprocesseurs/ieee/00891000.pdf) states the following in Section 8.1.3.2 RW key pairs: > An RW public key consists of a modulus n, which is t...
Residue requirements of Rabin-Williams primes?
Assume that $h:\{0,1\}^* \rightarrow \{0,1\}^\lambda$ is a cryptologic hash function, $r$ is taken randomly from $\{0,1\}^\lambda$, $p$ is a low-entropy password and $p^*$ is a guess. Now we get $h(p) \oplus h(p^*) \oplus r$ and $h(r)$ but don't know $h(p)$ or $h(p^*)$. Then there are two problems: 1. Can we get ...
How hard is it to recover $p$ if I can get $h(p) \oplus h(p^*) \oplus r$ and $h(r)$?
An older copy of [P1363 Public Key Cryptography](http://perso.telecom-paristech.fr/~guilley/recherche/cryptoprocesseurs/ieee/00891000.pdf) was used below. In may (or may not) reflect the current state of affairs. It also uses Bernstein's [RSA signatures and Rabin–Williams signatures: the state of the art](http://cr....
Assume that $h:\{0,1\}^* \rightarrow \{0,1\}^\lambda$ is a cryptologic hash function, $r$ is taken randomly from $\{0,1\}^\lambda$, $p$ is a low-entropy password and $p^*$ is a guess. Now we get $h(p) \oplus h(p^*) \oplus r$ and $h(r)$ but don't know $h(p)$ or $h(p^*)$. Then there <s>are two problems</s> is a proble...
sAssume that $h:\{0,1\}^* \rightarrow \{0,1\}^\lambda$ is a cryptologic hash function, $r$ is taken randomly from $\{0,1\}^\lambda$, $p$ is a low-entropy password and $p^*$ is a guess. Now we get $h(p) \oplus h(p^*) \oplus r$ and $h(r)$ but don't know $h(p)$ or $h(p^*)$. Then there <s>are two problems</s> is a probl...
Assume that $h:\{0,1\}^* \rightarrow \{0,1\}^\lambda$ is a cryptologic hash function, $r$ is taken randomly from $\{0,1\}^\lambda$, $p$ is a low-entropy password and $p^*$ is a guess. Now we get $h(p) \oplus h(p^*) \oplus r$ and $h(r)$ but don't know $h(p)$ or $h(p^*)$. Then there <s>are two problems</s> is a proble...
I'm using an older copy of [P1363 Public Key Cryptography was used below](http://perso.telecom-paristech.fr/~guilley/recherche/cryptoprocesseurs/ieee/00891000.pdf). It may (or may not) reflect the current state of affairs. P1363 has the following requirement in section 8.2.8 IFSP-RW, p. 45: > ***Output***: The si...
> What does an RSA signature look like? I found this in [P1363 Public Key Cryptography](http://perso.telecom-paristech.fr/~guilley/recherche/cryptoprocesseurs/ieee/00891000.pdf). Its an older copy of the standard from 2000. It may (or may not) be current. On page 41, there is 8.2.6 IFSP-RSA2, which stands for Int...
I'm trying to determine the residue requirements of Rabin-Williams. An older copy of [P1363's Public Key Cryptography](http://perso.telecom-paristech.fr/~guilley/recherche/cryptoprocesseurs/ieee/00891000.pdf) states the following in Section 8.1.3.2 RW key pairs: > An RW public key consists of a modulus n, which is t...
I know the garbled circuit solution, but is there any more efficient method?
Suppose $A$ knows $a$ and $B$ knows $b$, is it possible to efficiently compute $g^{ab}$ without leaking $a$ and $b$ to each other?
That feature of replacing the result of $y=x^d\bmod N$ (or $y=x^e\bmod N$) by $\hat y=\min(y,N-y)$ is also in [ISO/IEC&nbsp;9796-2&nbsp;<sub><sup>(paywalled)</sup></sub>][1] and ancestors; I first met it in [ISO/IEC&nbsp;9796:1991][2] (a very different, broken and now withdrawn signature scheme with message recovery ba...
Suppose $A$ knows $a$ and $B$ knows $b$, is it possible to efficiently compute $g^{ab}$ without leaking $g^a$ and $g^b$ to each other?
That feature of replacing the result of $y=x^d\bmod N$ (or $y=x^e\bmod N$) by $\hat y=\min(y,N-y)$ is also in [ISO/IEC&nbsp;9796-2&nbsp;<sub><sup>(paywalled)</sup></sub>][1] and ancestors; I first met it in [ISO/IEC&nbsp;9796:1991][2] (a very different, broken and now withdrawn signature scheme with message recovery ba...
I'm using an older copy of [P1363 Public Key Cryptography was used below](http://perso.telecom-paristech.fr/~guilley/recherche/cryptoprocesseurs/ieee/00891000.pdf). It may (or may not) reflect the current state of affairs. P1363 has the following requirement in section 8.2.8 IFSP-RW, p. 45: > ***Output***: The si...
Why does P1363 require RW signature with $0 ≤ s < n/2$?
That feature of replacing the result of $y=x^d\bmod N$ (or $y=x^e\bmod N$) by $\hat y=\min(y,N-y)$ is also in [ISO/IEC&nbsp;9796-2&nbsp;<sub><sup>(paywalled)</sup></sub>][1] and ancestors; I first met it in [ISO/IEC&nbsp;9796:1991][2] (a very different, broken and now withdrawn signature scheme with message recovery ba...
The SHA-2 hashes in [FIPS 186][1] define $\Sigma$ and $\sigma$ bijections of words, with $\Sigma$ used in the round function, and $\sigma$ used in preparing 48 words of [_message schedule_][2] from 16 words of a message block. For example, in SHA-256 (using 32-bit words) $$\begin{align*} \Sigma_0^{\{256\}}(x)&=\opera...
Rationale for use of $\operatorname{SHR}$ in SHA-2?
That feature of replacing the result of $y=x^d\bmod N$ (or $y=x^e\bmod N$) by $\hat y=\min(y,N-y)$ is also in [ISO/IEC&nbsp;9796-2&nbsp;<sub><sup>(paywalled)</sup></sub>][1] and ancestors; I first met it in [ISO/IEC&nbsp;9796:1991][2] (a very different, broken and now withdrawn signature scheme with message recovery ba...
That feature of replacing the result of $y=x^d\bmod N$ (or $y=x^e\bmod N$) by $\hat y=\min(y,N-y)$ is also in [ISO/IEC&nbsp;9796-2&nbsp;<sub><sup>(paywalled)</sup></sub>][1] and ancestors; I first met it in [ISO/IEC&nbsp;9796:1991][2] (a very different, broken and now withdrawn signature scheme with message recovery ba...
That practice of replacing the result of $y=x^d\bmod N$ (or $y=x^e\bmod N$) by $\hat y=\min(y,N-y)$ is also in [ISO/IEC&nbsp;9796-2:2010&nbsp;<sub><sup>(paywalled)</sup></sub>][1] and ancestors; I first met that in [[INCITS/ANSI]/ISO/IEC&nbsp;9796:1991][2], also given in the [Handbook of Applied Cryptography][3], see i...
I'm trying to determine the residue requirements of Rabin-Williams. An older copy of [P1363's Public Key Cryptography](http://perso.telecom-paristech.fr/~guilley/recherche/cryptoprocesseurs/ieee/00891000.pdf) states the following in Section 8.1.3.2 RW key pairs: > An RW public key consists of a modulus n, which is t...
I have written a program with the help of the bouncy castle for C# library. I am monitoring the traffic which is send between the client and the server and found something (i find) strange. The client sends application data to the server using the following ciphersuite: TLS_PSK_WITH_AES_128_GCM_SHA256. The GCM nonce...
What is the proper usage of GCM nonce in TLS1.2?
The SHA-2 hashes in [FIPS 186][1] define $\Sigma$ and $\sigma$ bijections of words, with $\Sigma$ used in the round function, and $\sigma$ used in preparing 48 words of [_message schedule_][2] from 16 words of a message block. For example, in SHA-256 (using 32-bit words) $$\begin{align*} \Sigma_0^{\{256\}}(x)&=\opera...
The SHA-2 hashes in [FIPS 186][1] define $\Sigma$ and $\sigma$ bijections of words, with $\Sigma$ used in the round function, and $\sigma$ used in preparing 48 words of [_message schedule_][2] from 16 words of a message block. For example, in SHA-256 (using 32-bit words) $$\begin{align*} \Sigma_0^{\{256\}}(x)&=\opera...
The SHA-2 hashes in [FIPS 180][1] define $\Sigma$ and $\sigma$ bijections of words, with $\Sigma$ used in the round function, and $\sigma$ used in preparing 48 words of [_message schedule_][2] from 16 words of a message block. For example, in SHA-256 (using 32-bit words) $$\begin{align*} \Sigma_0^{\{256\}}(x)&=\opera...
The SHA-2 hashes in [FIPS 180][1] define $\Sigma$ and $\sigma$ bijections of words, with $\Sigma$ used in the round function, and $\sigma$ used in preparing 48 words of [_message schedule_][2] from 16 words of a message block. For example, in SHA-256 (using 32-bit words) $$\begin{align*} \Sigma_0^{\{256\}}(x)&=\opera...
I know bit independence is good in SHA2 function output, but is it truly 100% secure? For example: - Y = SHA512(secretKeyNonce256bit) - A = first 32ytes / 256bits of Y, used as message encryption key - B = next 16bytes/128bits used as authentication HMAC key for message - C = next 16bytes/128bits used as acc...
Is "Bit Independence" of SHA-2 hashes secure?
There is no known exploitable relationships between the words (32/64 bit "chunks") of SHA-2 but this is always a source of cryptanalysis. There are some academic weaknesses against reduced round variants of SHA-2 but nothing against the full cipher. Still hashes are cheap so why not just use multiple hash functions? ...
Rationale for use of right-shift (rather than rotate) in SHA-2?
The SHA-2 hashes in [FIPS 180][1] define $\Sigma$ and $\sigma$ bijections of words, with $\Sigma$ used in the round function, and $\sigma$ used in preparing 48 words of [_message schedule_][2] from 16 words of a message block. For example, in SHA-256 (using 32-bit words) $$\begin{align*} \Sigma_0^{\{256\}}(x)&=\opera...
There is no known exploitable relationships between the words (32/64 bit "chunks") of SHA-2 but this is always a source of cryptanalysis. There are some academic weaknesses against reduced round variants of SHA-2 but nothing against the full cipher. Still hashes are cheap so why not just use multiple hash functions? ...
There is no known exploitable relationships between the words (32/64 bit "chunks") of SHA-2 but this is always a source of cryptanalysis. There are some academic weaknesses against reduced round variants of SHA-2 but nothing against the full cipher. Still hashes are cheap so why not just use multiple hash functions? ...
There is no known exploitable relationships between the words (32/64 bit "chunks") of SHA-2 but this is always a source of cryptanalysis. There are some academic weaknesses against reduced round variants of SHA-2 but nothing against the full cipher. Still hashes are cheap so why not just use multiple hash functions? ...
I think we all know RSA. And of course we also know DJB (a.k.a. Daniel J. Bernstein). Now some already have noticed that he has an opinion towards cryptographic questions. In his [2008 paper][1] on state-of-the-art signature schemes he documents the "evolution" of RSA and I get the impression he's advertising th...
Why isn't Rabin-Williams cryptosystem widely used?
At first I want to cite [Lindell and Katz][1] book: > A "plain Rabin" encryption scheme, constructed in a manner analogous to plain RSA encryption, is vulnerable to a chosen-ciphertext attack that enables an adversary to learn the entire private key. Although plain RSA is not CCA-secure either, known chosen-cipherte...
I need to generate some session keys from a master key that was generated from an ECDH key exchange. The master key is 256 bits and I need 256 sessions keys. Is it safe to use SHA256_HMAC with a counter as the HMAC input to get the session keys? skey1 = SHA256_HMAC(master_key, 1); skey2 = SHA256_HMAC(master...
I need to generate some session keys from a master key that was generated from an ECDH key exchange. The master key is 256 bits and I need 256 bit sessions keys. Is it safe to use SHA256_HMAC with a counter as the HMAC input to get the session keys? skey1 = SHA256_HMAC(master_key, 1); skey2 = SHA256_HMAC(m...
I'm working with an implementation that creates a blinding value for RW signatures with the following C++ code: <!-- language: lang-cpp --> Integer r, rInv; ModularArithmetic modn(m_n); do { // Do this in a loop for people using small numbers for testing r.Randomize(rng, Integer::One() /*min*/,...
Though I can get the basic idea of UC Framework, namely let the environment cannot distinguish the real protocol with the real adversary and the functionality with the simulator, I am still puzzled in details: 1. What's the principle to design the functionality, if it aims to a new scene that Canetti haven't treate...
What's the principle to design the functionality under UC framework?
Though I can get the basic idea of UC Framework, namely let the environment cannot distinguish the real protocol with the real adversary and the functionality with the simulator, I am still puzzled in details: 1. What's the principle to design the functionality, if it aims to a new scene that Canetti haven't treate...
I need to write a first program in one language that saves data in a text file, and write a second program in a second language to decrypt that file. The two languages in question don't include any crypto libraries, so I'm on my own. Could someone recommend, point me to, or summarize a simple algorithm (pseudo code)...
Though I can get the basic idea of UC Framework, namely let the environment cannot distinguish the real protocol with the real adversary and the functionality with the simulator, I am still puzzled in details: 1. What's the principle to design the functionality, if it aims to a new scene that Canetti hasn't treated...
I have been reading that DES is slow. Is it only slow in software or slow overall? Also, as far as Triple DES being slow is concerned, is double AES with two 128 bit keys slower than single AES with a 256 bit key?
Is DES slow in hardware or only in software?
Lately I've been studying cryptography and in the current course I'm taking we're reviewing statistical tests and how they can be used to determine if a pseudo-random generator is secure or not. Essentially, one of the requirements for a Pseudo-random generator to be secure is that the probability of guessing the next ...
How is an epsilon of 1/1000 non-negligible?
Suppose we used this PRNG to generate a 128-bit AES key. Well, assuming the bits are independent (but have the 1/1000 bias), then [some math shows][1] that the statistical distance between the result and a truly random 128-bit value is about 0.018. It follows that using this PRNG in place of a perfect one could increas...
Suppose we used this PRNG to generate a 128-bit AES key. Well, assuming the bits are independent (but have the 1/1000 bias), then [some math shows][1] that the statistical distance between the result and a truly random 128-bit value is about 0.018. It follows that using this PRNG in place of a perfect one could increas...
> How can a computer leverage that tiny extra probability to crack a secret key? Your professor is trying to answer a different question. He wants to know, and wants you to think about: > How small does the bias have to be in order to ensure that no one can leverage it to crack a secret key? Suppose we used th...
> How can a computer leverage that tiny extra probability to crack a secret key? The answer to that depends on what type of key it is, how it's being used, etc. Certainly, the bias would make a brute-force attack easier, but you probably wouldn't need to worry about that, regardless. Your professor, though, is tr...
> How can a computer leverage that tiny extra probability to crack a secret key? The answer to that depends on what type of key it is, how it's being used, etc. Certainly, the bias would make a brute-force attack easier, but you probably wouldn't need to worry about that, regardless. Your professor, though, is tr...