instruction stringlengths 15 30k |
|---|
```
Let G be a pseudorandom generator with expansion factor l(n) > 2n. In each of the following cases, say whether G′ is necessarily a pseudorandom generator. If yes, give a proof; if not, show a counterexample.
(a) Define G'(s) = G(s1 ···s⌊n/2⌋), where s = s1 ···sn.
```
I thought that it's not a PRG, by the coun... |
I am attending the video lectures from Prof Dan Boneh. He gives the following example.
Let $G:\mathcal K\longrightarrow \Bbb Z_2^n$ be a PRG with the property that from the last $\frac{n}{2}$ digits of $G(k)$ we can easily compute the first $\frac{n}{2}$ digits of $G(k)$. We want to show that $G$ is predictable for ... |
I am attending the video lectures from Prof Dan Boneh. He gives the following example.
Let $G:\mathcal K\longrightarrow \Bbb Z_2^n$ be a PRG with the property that from the last $\frac{n}{2}$ digits of $G(k)$ we can easily compute the first $\frac{n}{2}$ digits of $G(k)$. We want to show that $G$ is predictable for ... |
I am working on using the Hadamard transform as a way to map randomly generated values and then apply statistical tests as defined by Nist or other institutions. One resource online I found particularly helpful, yet I do not seem to have the mathematical intuition to understand some parts. The python code and the text ... |
You need to read about WHT. It is just a fourier transform obtained for $\pm 1$ valued sequences. A fourier transform is usually normalized in different ways. Some authors like to divide by $2^n$ (since the sum is that of a function taking $2^n$ inputs) in the forward direction, others split the normalization into $2^{... |
I'm using `AES-256-CBC` to encrypt password for a set of users, and for each user in the database we gotta generate and store the password in the database. The database has constraint that the name of the user must be unique, so I was wondering if using the name of the person as the initialization vector was okay, bec... |
I'm a novice reader of Introduction to Modern Cryptography, where it states:
> Let $G$ be a pseudorandom generator with expansion factor $l(n) > 2n$.
> In each of the following cases, say whether $G′$ is necessarily a pseudorandom generator. If yes, give a proof; if not, show a counterexample.
> (a) Define $G'... |
Why: $G'(s) = G(s_1 \cdots s_{\lfloor{n/2}\rfloor})$, where $s = s_1 \cdots s_n$ is PRG? |
I'm a novice reader of Introduction to Modern Cryptography, where it states:
> Let $G$ be a pseudorandom generator with expansion factor $\ell(n) > 2n$.
> In each of the following cases, say whether $G′$ is necessarily a pseudorandom generator. If yes, give a proof; if not, show a counterexample.
> (a) Define ... |
I'm a novice reader of Introduction to Modern Cryptography, where it states:
> Let $G$ be a pseudorandom generator with expansion factor $\ell(n) > 2n$.
> In each of the following cases, say whether $G′$ is necessarily a pseudorandom generator. If yes, give a proof; if not, show a counterexample.
> (a) Define ... |
My question might be a duplicate but I wasn't able to find a similar question.
I recently developed a wallet-like app and I am trying to implement some MPC features.
I searched a little and even asked ChatGPT about how I can achieve that.
I know how ECdsa and how Shamir’s secret sharing work but I can't find a... |
I am following this paper [Encryption from Learning with Errors](https://courses.grainger.illinois.edu/cs598dk/fa2019/Files/lecture10.pdf) for the generation of errors e1 and e2 to retrieve the ciphertext u and v as described below.
u = Ar + e1
v = br + m (q/2) + e2
For this text:
> We require for thi... |
I am following this paper [Encryption from Learning with Errors](https://courses.grainger.illinois.edu/cs598dk/fa2019/Files/lecture10.pdf) for the generation of errors e1 and e2 to retrieve the ciphertext u and v as described below.
u = Ar + e1
v = br + m (q/2) + e2
For this text:
> We require for thi... |
I'm a novice reader of Introduction to Modern Cryptography, where it states:
> Let $G$ be a pseudorandom generator with expansion factor $\ell(n) > 2n$.
> In each of the following cases, say whether $G′$ is necessarily a pseudorandom generator. If yes, give a proof; if not, show a counterexample.
> (a) Define ... |
Why: $G'(s) = G(s_1, \ldots, s_{\lfloor{n/2}\rfloor})$, where $s = s_1, \ldots, s_n$ is PRG? |
How to decide if a point on a elliptic curve belongs to a group generated by a generator $g$? |
In ECDSA, when parsing the public key a key is made to ensure the public key really lies on the curve. What vulnerabilities appear if one does not do this? |
Why must ECDSA verification ensure the point is on the curve? |
In ECDSA, when parsing the public key a test is made to ensure the public key really lies on the curve. What vulnerabilities appear if one does not do this? |
I recently read a [paper][1] that proposed a matrix-DDH which is a matrix variant of DDH assumption. The brief definition is follows:
Let $G$ be a group of prime order $q$.
Then, the matrix-DDH says that it is hard to distinguish between two distributions:
$\{[A], [A\cdot w] \} \approx \{[A], [u], u\leftarrow \tex... |
To clarify a bit: "We want that the output ct of Encap should be indistinguishable from randomness even to an observer with knowledge of msk" seems a bit too strong, since if we know msk, we can distinguish that the output **ct** was not encapsulated to a specific **id** by generating **usk** and playing the role of th... |
Consider following paper based OTP
1. Plaintext has 11 possible symbols 0-10.
2. $C_i = M_i + K_i\ mod\ 11$.
3. $K_i$ comes from a pre-shared key material which is never reused.
How to introduce integrity?
|
Because of the need of the project, I want to develop a simple public key cryptography algorithm, but I have doubts when generating the key pair.
I have learned about the key generation process of RSA. It is to prepare two coprime numbers (p, q), multiply them to obtain N, and then calculate L (that is, L=lcm (p-1, ... |
How does the public key cryptography algorithm generate a public key based on the private key? |
I'm trying to find a MD5 hash collision between 2 1024-bit numbers such that one is prime and the other is composite. I'm using [fastcoll][1] with random prefixes for each iteration.
For this I wrote this script:
```
import subprocess
from Crypto.Util.number import bytes_to_long, isPrime
import string
import ra... |
FS01: [“One Round Threshold Discrete-Log Key Generation without Private Channels” by Pierre-Alain Fouque and Jacques Stern](https://link.springer.com/chapter/10.1007/3-540-44586-2_22),
Section 3.2, "A Proof of Fairness".
CS03: [“Practical Verifiable Encryption and Decryption of Discrete Logarithms” by Jan Camenisch... |
Consider following paper based OTP
1. Plaintext has 11 possible symbols 0-10.
2. $C_i = M_i + K_i\ mod\ 11$.
3. $K_i$ comes from a pre-shared key material which is never reused.
How to introduce data integrity/ MAC in it?
|
Consider a single hash table containing digests from about 10 different 256 bits cryptographic hashing functions, like SHA256, SHA3, KECCACK256, BLAKE2, BLAKE3, etc...
Is such table still considered collision resistant?
I am inclined to think so, but I might be missing something. |
Is a single 256 bits hash table in which the digests are from mixed cryptographic hashing algorithms still considered collision resistant? |
My question might be a duplicate but I wasn't able to find a similar question.
I recently developed a wallet-like app and I am trying to implement some MPC features.
I searched a little and even asked ChatGPT about how I can achieve that.
I know how ECdsa and how Shamir’s secret sharing work but I can't find a... |
Is there a comparison table for the "usual" encryption algorithms, whether and to which degree they fulfill the SAC and BIC?
<br/>
I'm thinking of something like
|Algorithm|SAC average|SAC min |SAC sq.d.|BIC average|BIC min|BIC sq.d.|
|--- | --- | --- | --- | --- |--- |--- |... |
Strict Avalance Criterion (SAC) comparison table? |
Strict Avalanche Criterion (SAC) comparison table? |
For context, I'm making a non-production grade reference implementation of the [balloon hash function][1] using the [Web Crypto API][2]. In order to make it less susceptible to [certain attacks][3] on common memory hard KDFs, the number of memory blocks should be reduced, meaning their size should increase. I am howeve... |
Can HKDF be used in place of a cryptographic hash function? |
For context, I'm making a non-production grade reference implementation of the [balloon hash function][1] using the [Web Crypto API][2]. In order to make it less susceptible to [certain attacks][3] on common memory hard KDFs, the number of memory blocks should be reduced, meaning their size should increase. I am howeve... |
I'm looking for a general comparison of encryption algorithms in regard to **Confusion and Diffusion** (as defined by Claude Shannon),
and if possible, specifically for their SAC and BIC quality.
For example, xor-streaming ciphers have no (0, zero, zilch) diffusion - you switch 1 bit in the ciphertext, you know whi... |
Confusion+Diffusion comparison table? (e.g. with Avalanche Criterion / SAC) |
HKDF is defined ([there][1]) from HMAC and a hash.
> Can [HKDF][1] be used in place of a cryptographic hash function?
**Yes**. $H(M)$ computed as $\operatorname{HKDF-Expand}(\operatorname{HKDF-Extract}(\mathrm{salt},M),\mathrm{info},512)$ for fixed small (possibly empty) constant bytestrings $\mathrm{salt}$ and $... |
Consider the following two verifiable encryption schemes for Discrete Logarithm.
FS01: [“One Round Threshold Discrete-Log Key Generation without Private Channels” by Pierre-Alain Fouque and Jacques Stern](https://link.springer.com/chapter/10.1007/3-540-44586-2_22),
Section 3.2, "A Proof of Fairness".
CS03: [“Pra... |
> Can HKDF be used in place of a cryptographic hash function?
**Yes**.
HKDF is defined ([there][1]) from HMAC and a hash. $H(M)$ computed as
$$\operatorname{HKDF-Expand}(\operatorname{HKDF-Extract}(\mathrm{salt},M),\mathrm{info},512)$$
for fixed small (possibly empty) constant bytestrings $\mathrm{salt}$ and $\... |
Consider the following paper based OTP
1. Plaintext has 11 possible symbols 0-10.
2. $C_i = M_i + K_i\ mod\ 11$.
3. $K_i$ comes from a pre-shared key material which is never reused.
How to introduce data integrity/ MAC in it?
|
I haven't seen Threefish widely used.
For example, I've seen Twofish used in file encryption software, even though it was not standardized, but I've never seen Threefish.
Are there security issues?
|
Why is Threefish not widely used? |
I'm trying to find a MD5 hash collision between 2 numbers such that one is prime and the other is composite (at most 1024-bit). I'm using [fastcoll][1] with random prefixes for each iteration.
For this I wrote this script:
```
import subprocess
from Crypto.Util.number import bytes_to_long, isPrime
import string
... |
Here is the good news: Your algorithm doesn't need to be "constant time". It just needs to be independent on the input data. It is fine if there are random variations; they are actually helpful if the random variations are bigger than the data-dependent variations.
Memory access is notoriously running at variable t... |
Use SHA3-224 [HMAC](https://en.wikipedia.org/wiki/HMAC).
Define a security parameter $\kappa$, and both sides consume
that much $K_i$ keying material.
A paper based OTP will probably choose a smaller parameter
than a TCP-based protocol would choose.
Compute and append the $\kappa$ prefix of the HMAC result
to... |
Use SHA3-224 [HMAC](https://en.wikipedia.org/wiki/HMAC).
Define a security parameter $\kappa$, and both sides consume
that much $K_i$ keying material.
A paper based OTP will probably choose a smaller parameter
than a TCP-based protocol would choose.
Compute and append the $\kappa$ prefix of the HMAC result
to... |
Adding salt generally **does not provide any additional security benefits** while signing.
Replay attacks can be prevented by either nonce, or in this case, by timestamp.
However, it is situational.
With salt, we will get different signature for the same message. So when two messages are sent and you don't wa... |
This is a simpler statement than it seems. If a language $\mathcal{L}$ is in $\mathsf{NP}$, and you prove that $\mathcal{L} \not\in \mathsf{P}$, then this is a proof that $\mathsf{P} \neq \mathsf{NP}$.
You can phrase ECDLP as a decision problem in $\mathsf{NP}$: _given an elliptic curve $\mathcal{E}$ of order $d$ an... |
This is a simpler statement than it seems. If a language $\mathcal{L}$ is in $\mathsf{NP}$, and you prove that $\mathcal{L} \not\in \mathsf{P}$, then this is a proof that $\mathsf{P} \neq \mathsf{NP}$.
The book itself doesn't define a decision version of the ECDLP problem, so I'll define one here.
_Given $(\mathcal... |
Recall the QAP equivalence condition. If $r_1, \ldots, r_n$ are uniformly chosen elements in the field $\mathbb{F}$, and $\{u_i(X),v_i(X),w_i(X)\}_{i=1}^m$ are all degree $n-1$ polynomials in $\mathbb{F}[X]$ denoting the QAP representation of the circuit; then the arithmetic circuit is satisfied by the wire assignment ... |
Lets say entity A sends a secret "token" to anybody that they trust.
The token itself is the proof and its sent equally to everybody and it has or needs to be derived from application specific data.
Entities B, C and D get the same token and want to publish a timestamped event for proof, but they don't trust an... |
How can knowledge of a secret be compared among untrusted entities? |
The padding fix by [Albertini et al.][1] for AEAD key commitment (pp. 3292 and 3301-3302) involves prepending a block or two of zeros to the plaintext before encrypting. After decryption, these bytes are checked to be zero to verify that the same key was used for decryption.
The Counter-then-Xor (CX) construction by... |
I am beginning my journey into Cryptography, having studied a theory heavy master's degree module, and I have also read The Code Book by Simon Singh, among many other online resources.
What puzzle books would the community recommend, just so I can get into the mindset of code breaking? I noticed that certain newspap... |
Recommended puzzles? |
On some lecture slides regarding to RSA-Encryption, the formula for calculation of the private key is given as $d = e^{-1} \equiv e^{\phi(N)-1} \mod \phi(N)$. The second equation is justified by the fact that $gcd(e,\phi(N))=1$.
My questions:
1.How does the second equality come about? I know, that Eulers Theorem ... |
Why is $d = e^{-1} \mod \phi(N) \equiv e^{\phi(N)-1} \mod \phi(N)$ and not commonly used in RSA key generation? |
> 1.How does the second equality come about? I know, that Eulers Theorem shows, that $a^{\phi(b)} \equiv 1 \mod b$ for coprime $a,b$. So why we dont need to write $e^{\phi(\phi(N))-1} \mod \phi(N)$?
Actually, you are correct - the slides were wrong.
> 2. With this forumula we can calculate $d$ easily, aren't we? ... |
> 1.How does the second equality come about? I know, that Eulers Theorem shows, that $a^{\phi(b)} \equiv 1 \mod b$ for coprime $a,b$. So why we dont need to write $e^{\phi(\phi(N))-1} \mod \phi(N)$?
Actually, you are correct - the slides were wrong.
> 2. With this forumula we can calculate $d$ easily, aren't we? ... |
For classical hand manual cryptography, the book [Cryptanalysis: A Study of Ciphers and Their Solution][1] by Helen Fouche Gaines is unsurpassed in my opinion. The exercises are entertaining and of a range of difficulties.
Another book is [Elementary Cryptanalysis a Mathematical Approach][2] by Abraham Sinkov. It's ... |
In Guillou and Quisquater's 1988 paper ["A 'Paradoxical' Indentity-Based Signature Scheme Resulting from Zero-Knowledge"][1], they say that an RSA identity has a shadow and go on to state that this property is being standardized:
> Let us mention that ISO is standardizing a “digital signature scheme with shadow (see... |
What is the modern terminology for a digital signature scheme with a shadow? |
I was reading up on the Triple Diffie-Hellman (3-DH) key exchange and noticed that the wikipedia description \[1\] is different from the the original protocol definition \[2\] and the modified definition \[3\] they reference.
Two users have two key pairs each; $a, A$ and $x, X$ for one user and $b, B$ and $y, Y$ for... |
How to combine the keys in the Triple Diffie-Hellman (3DH) key exchange? |
In the question what do you mean by “Multi User” Designated Verifier Signature is not clear. Do you have a definition in mind?
In the case that by “Multi User Designated Verifier Signature” you mean having multiple signers and one designated verifier (DV), then indeed the generalization that you mentioned is correct... |
I am trying to solve a problem where e = 65537 and also private key d and cipher are known.
How can i go about calculating phi(N) or N itself?
An extended version of the problem would be :
*If we can get many d and ciphers for the same plaintext, where e is always 65537, is there a way to decrypt the cipher?*
... |
RSA : Is there a way to compute phi(n) or N itself if we only know e, d and a ciphertext? |
I'm looking for a protocol in which a Prover transforms a RSA signature $\sigma$ on a message $m$ that verifies under a public key $vk$ into a NIZK proof of knowledge, $\pi$ of that signature. A verifier should then be able to verify that the prover saw a signature for that message and that the signature would have ver... |
I'm looking for a protocol in which a Prover transforms a RSA signature $\sigma$ on a message $m$ that verifies under a public key $vk$ into a NIZK proof of knowledge, $\pi$ of that signature. A verifier should then be able to verify that the prover saw a signature for that message and that the signature would have ver... |
> Is the above scheme actually secure i.e., can the Prover construct a $\pi$
which the Verifier will accept without having seen the signature and can the Verifier recover $\sigma$
from $\pi$?
No, the scheme is not secure, in the sense that the Prover can construct a $\pi, w$ pair that validates.
All the Prove... |
I'm looking for a protocol in which a Prover transforms a RSA signature $\sigma$ on a message $m$ that verifies under a public key $vk$ into a NIZK proof of knowledge, $\pi$ of that signature. A verifier should then be able to verify that the prover saw a signature for that message and that the signature would have ver... |
I am asking this since I can't find definite answer.
Is it secure if I use textbook RSA provided all my data is 2048 bits ( or any N <=2048 for 2048 bit key ) and it is random ( using Secure Random in Java for example) ?
Or should I figure out maximal key length under padding scheme and use padding anyway ? |
I was reading up on the Triple Diffie-Hellman (3-DH) key exchange and noticed that the wikipedia description \[1\] is different from the the original protocol definition \[2\] and the modified definition \[3\] they reference.
Two users have two key pairs each; $a, A$ and $x, X$ for one user and $b, B$ and $y, Y$ for... |
I am reading a paper [Round5](https://eprint.iacr.org/2019/090.pdf).
This public key encryption scheme is based on Ring-LWR but I found it is a little bit different from typical LWR-based PKE scheme.
In the key generation algorithm of Round5 (Algorithm 1, Line 3 in the paper), they compute
$$ b= \left< \Bigl \... |
For what 'rounding constant' exists in Round5?(NIST PQC Round 2 Algorithm) |
I was reading up on the Triple Diffie-Hellman (3-DH) key exchange and noticed that the wikipedia description \[1\] is different from the the original protocol definition \[2\] and the modified definition \[3\] they reference.
Two users have two key pairs each; $a, A$ and $x, X$ for one user and $b, B$ and $y, Y$ for... |
The padding fix by [Albertini et al.][1] for AEAD key commitment (pp. 3292 and 3301-3302) involves prepending a block or two of zeros to the plaintext before encrypting. After decryption, these bytes are checked to be zero to verify that the same key was used for decryption.
The Counter-then-Xor (CX) construction by... |
I am beginning my journey into Cryptography, having studied a theory-heavy master's degree module, and I have also read The Code Book by Simon Singh, among many other online resources.
What puzzle books would the community recommend, just so I can get into the mindset of code-breaking? I noticed that certain newspap... |
Below is a description of a "cube" Diffie-Hellman, based on commuting matrix actions on tensor products. Some questions:
1. References for something similar?
2. Obvious flaws, is this a terrible idea?
3. Any other comments?
## Definitions
Let $S$ be a finite ring, $n$, $k$, positive integers, and $R=M_k(S)^... |
Here is the good news: Your algorithm doesn't need to be "constant time". It just needs to be independent on the input data. It is fine if there are random variations; they are actually helpful if the random variations are bigger than the data-dependent variations.
Memory access is notoriously running at variable t... |
[According to the documentation of HighwayHash][1], for finding a collision are expected m/2 guesses, being m the message.
By contrast, 'strong' hashes such as SipHash or HighwayHash require infeasible attacker effort to find a hash collision (an expected 2^32 guesses of m per the birthday paradox) or recover th... |
How to estimate the collision resistance of a hash function if a secondary key is used (keyed hash function)? |
If I hash a 256-bits message and generate a output digest of the same size with a cryptographic hash function, for finding a collision is expected a number of guesses to be 2^128.
Does increasing the message size also increases the expected number of guesses for finding a collision?
If yes, could the hash functio... |
In criptographic hash functions, does increaging the size of the message to be hashed also increases the number of guesses for finding a collision? |
If I hash a 256-bit message and generate an output digest of the same size with a cryptographic hash function then the number of guesses to find a collision is expected to be 2^128.
Does increasing the message size also increase the expected number of guesses to find a collision?
If yes, can the hash function int... |
Does an increase of message size increase the number of guesses to find a collision? |
Not all the cryptographic hash functions have the counter parameter for making messages be different for each counter value. But many accept a key parameter.
Is reasonable to use the key parameter as a counter?
Is it safe? |
Is it safe or reasonable to use the key parameter in a criptographic hash function as a counter? |
In the paper "Efficient Pseudorandom Correlation Generators: Silent OT Extension and More (https://doi.org/10.1007/978-3-030-26954-8)" Boyle et. al. proposed subfield vole.
For standard VOLE correlation, $\vec{v}+\vec{w}=\vec{u}*x$ ($v_i, w_i, u_i, x \in \mathbb{F}_p$).
And for subfield VOLE correlation, $x \in... |
Is it secure to do subfield VOLE over a Ring $Z_{2^k}$? |
**TL;DR**
Under standard assumptions on block cipher design (which in the case of AES have been also experimentally tested and no bad surprises have been found) the function $Q$ generating a recursive sequence is a pseudorandom function with the expected properties of such a function, e.g., the average and maximum c... |
Is there a zero-knowledge proof that proves that two Pedersen commitments commit the same value?
|
This is not a technical question, but rather it seeks advice on what to do if cryptanalytical research goes wrong.
I think I've discovered a new attack that works great in theory, but in practice, it fails.
I don't why. Haven't figured it out yet. Tried really hard.
I work on this thing alone. Not sure If I could ... |
This is not a technical question, but rather it seeks advice on what to do if cryptanalytical research goes wrong.
I think I've discovered a new attack that works great in theory, but in practice, it fails.
I don't know why. Haven't figured it out yet. Tried really hard.
I work on this thing alone. Not sure If I c... |
I'm implementing impossible differential cryptanalysis on 3.5 round IDEA using the methods in "Miss in the middle attack on IDEA and Khufu" paper.
In the first step I need to provide $2^{32}$ pairs that are identical in $X_2$ and $X_4$ and have all the possiblities in $X_1$ and $X_3$ to start the cryptanalysis.
S... |
If we should consider that in an MPC protocol, the confidential messages communicated between two parties can be eavesdropped on by adversaries? If so, should we build a secure channel for that? |
Secure channel: Is there a assumption in an MPC protocol that the communication between different parties is secure? |
I would like to implement domain separation in encryption/decryption along with MAC.
The encryption algorithms consists of XChaCha20,XSalsa20,SM4 From China and MAC algorithms consist of HMAC-SHA512 and Poly1305.
Some proposed the following for domain separation encryption and decryption.
1. Have 2 variables, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.