instruction
stringlengths
15
30k
I keep hearing CBC with fixed IV mode is bad because it has similar issues to the codebook breakdown of ECB mode. However, people seem quite willing to recommend AES-GCM-SIV for deterministic encryption. Why is GCM-SIV superior to claim CBC with fixed IV?
GCM-SIV vs CBC with fixed IV?
> Why is GCM-SIV superior to CBC with fixed IV? From a confidentiality standpoint: - GCM-SIV changes it's IV (with very high probability) when the message changes at any position, thus it's vulnerability is limited to allowing detection of fully identical messages. - Contrast with CBC with fixed IV, that allows de...
> Why is GCM-SIV superior to CBC with fixed IV? From a confidentiality standpoint: - GCM-SIV changes it's internal IV (with very high probability) when the message changes at any position, thus it's vulnerability is limited to allowing detection that two messages are fully identical. - Contrast with CBC with fixed...
> Why is GCM-SIV superior to CBC with fixed IV? From a confidentiality standpoint: - GCM-SIV changes it's internal IV (with very high probability) when the message changes at any position, thus it's vulnerability is limited to allowing detection that two messages are fully identical. - Contrast with CBC with fixed...
So there’s [LadderLeak][1]. [RFC6979][2] produces uniformly random nonce $k$. There are other techniques, such as hash-to-curve standard ([draft-irtf-cfrg-hash-to-curve-16 section 5][3]), which allows to produce uniformly random scalars. They mention it’s OK to use 128 additional bits of entropy, e.g 48-byte hash...
The final [SP800-186][1] outlines mappings between Twisted Edwards and Montgomery curves, and between Montgomery and Weierstrass curves. These mappings are defined in Appendix B. Relationships Between Curve Models. There are two types of mappings outlined: 1. Standard maps between curves on these different model...
I'm reading through the EDHOC draft spec and they talk about passing just the X portion of the (ephemeral) public key across in message 1. I've only ever heard of EC public keys (in this case the curve is P-256, if it matters) having both an X and a Y. The implication is, I guess, that you can derive the Y from the X? ...
EC: Can you derive Y from X for a public key?
> The implication is, I guess, that you can derive the Y from the X? Is this true? Well, for each valid $X$ value, there are two possible values for $Y$; it is easy to recover both. And, for Diffie Hellman, it happens that we don't care which $Y$ value we pick (as the ultimate shared secret doesn't depend on whic...
A common method to mitigate the effect of rainbow tables is to add a string to the end of the user password before hashing, a process known as salting. However, let’s say for example that someone uses a certain password across multiple websites which all salt their passwords, all use the same cryptographic hashing f...
I want to use TweetNaCl.js for encrypting user data that is stored in `LocalStorage`. Therefore, I want to prompt the user to provide a PIN/password that shall be used to derive a key that is then used as a secret key for TweetNaCl's secretbox. Looking for a modern scrypt implementation in JavaScript, I couldn't fin...
Is my TypeScript scrypt implementation using Web Crypto API safe and correct? (Open Source)
Several years ago, there was an [unenforced constraint on verification in the cirmcomlib library](https://github.com/iden3/circomlib/commit/109cdf40567fce284dca1d535819ce28922653e0#diff-d115e3788e56ac3d62b1f243561d50e5) : a tool for building projects using ZsNarks. The error allowed to forge cryptographic nullifiers/pr...
Many cryptographic protocols are parameterized by a uniformly random reference string (e.g. the commitment key for Pedersen commitments). Our goal is to publicly generate the random values of this string (in a finite field), and to do so using the simplest and fastest seed-expansion process (measured I supposed in `by...
Many cryptographic protocols are parameterized by a uniformly random reference string (e.g. the commitment key for Pedersen commitments). Our goal is to publicly generate the random values of this string (in a finite field), and to do so using the simplest and fastest seed-expansion process (measured I supposed in `by...
Let's suppose that there is a filter generator which based on $n$-size LFSR. Denote a feedback polynomial as $g(x_1, x_2, \dots, x_n)$ and nonlinear filter function as $f(x_1, x_2, \dots, x_n)$. Let $a = a_1, a_2, \dots, a_k$ be filter generator output sequence. Attacker knows $f$ and $a$. 1. What are boun...
> Why is GCM-SIV superior to CBC with fixed IV? From a confidentiality standpoint: - GCM-SIV changes it's internal IV (with very high probability) when the message changes at any position, thus it's vulnerability is limited to allowing detection that two messages are fully identical (and then only if it's not suppl...
If you really - are attached to those bits so you want to use more than 101/128 of conversion attempts - don't want to do bignum calculations - want verfiable bias-free generation then - collect 20 bits to make an integer between 0 and 1048575 - reject if >= 1030301 (101^3) (happens with 1.7% probability...
What is the difference between Ring Signature and Multi User Designated Verifier Signature?
I am studying Lybashevsky's ID-scheme from the article *Fiat-Shamir With Aborts: Applications to Lattice and Factoring-Based Signatures*(https://www.iacr.org/archive/asiacrypt2009/59120596/59120596.pdf) by *Vadim Lybashevsky*. I am trying to work trough the soundness and completness of the ID-scheme through the four...
What is this parameter? in Lyubashevsky's ID-scheme
I know that there are previous questions on the subject e.g. [here](https://crypto.stackexchange.com/q/5458/76356), however I would like to ask it for my particular (simple) case. I have an application firmware that is downloaded to a microprocessor through a bootloader firmware that is taking care of decryption and...
I was going through this [simulation][1] tutorial. > For example, let x and y be lists of data elements, and let f be a functionality that outputs an independent random sample of **x ∪ y** of some predetermined size to each party. Now, consider a protocol that securely outputs the **same random sample to both par...
Why does joint distribution of simulation output and functionality output is required?
I am learning about Elliptic curve and I reached to Montgomery curve with XZ coordinates with this equation: `b*y2=x3+a*x2+x` and regarding the information from this link: [XZ coordinates add and doubling][1] and I made this small code in matlab to understand the concepts: ``` % Define the elliptic curve parame...
> They obtain the first 32 bytes of each signature. All your scenarios make this assumption, and so lets dig into it. For ECDSA with RFC-6979, it gets the message and the private key, and generates the first 32 bytes are $F( message, privatekey ) $, where $F$ is a public and noninvertible function; that is, by kn...
I have been reading Vitalik's series on STARKs recently (Part [1][1], [2][2] and [3][3]). It is a nice and very understandable read for a layman like me. ### Brutal summary of my current understanding Vitalik outlines the following technique to prove the correctness of some arbitrary computation: - Encode th...
I am encrypting and storing sensitive values in the database. I have a set max length in the database, but in order to provide useful user feedback, I'd like to know the max input I should allow for a given database length. I can throw together a test that brute forces an answer, but I'd like to understand more gene...
Recently, I was reading the paper [One Hot Garbling][1] published on CCS 2021. I noticed a sentence in it: > In this work, we forgo the standard GC notation of garbled labels in favor of garbled sharings of cleartext values held by G and E. This will be convenient for handling vectors and matrices of bits. I do...
Recently, I was reading the paper [One Hot Garbling][1] published on CCS 2021. I noticed a sentence in it: > In this work, we forgo the standard GC notation of garbled labels in favor of garbled sharings of cleartext values held by G and E. This will be convenient for handling vectors and matrices of bits. I do...
Recently, I was reading the paper [One Hot Garbling][1] published on CCS 2021. I noticed a sentence in it: > In this work, we forgo the standard GC notation of garbled labels in favor of garbled sharings of cleartext values held by G and E. This will be convenient for handling vectors and matrices of bits. I do...
According to a Reddit post I am participating in, SpiderOak “repented” of its incorrect usage of the term “zero knowledge” in 2017, as shown here: https://medium.com/@SpiderOak/why-we-will-no-longer-use-the-phrase-zero-knowledge-to-describe-our-software-ddef2593a489 NordPass has yet to walk back its claim to a ze...
Does NordPass Make the Same Error SpiderOak Stopped Making in 2017?
For Monero, the scheme for stealth addresses is pretty straightforward. (For example: https://monero.stackexchange.com/questions/1500/what-is-a-stealth-address) However, I haven't found any details on how the same functionality is done in Zcash, can someone provide more information on this?
In Zcash, how does a recipient look up which transactions belong to him/her?
I know, that PBKDF2 uses HMAC function as PRF. But.. can I use many iterations of HMAC directly? Is this effective and securely? P.S I need the best function, but I can’t use bcrypt, argon, pbkdf2.
Can I use many iterations of HMAC function instead of PBKDF2?
I know, that PBKDF2 uses HMAC with SHA2 function as PRF. But.. can I use many iterations of HMAC with SHA2 directly? Is this effective and securely? P.S I need the best function, but I can’t use bcrypt, argon, pbkdf2.
I know that there are previous questions on the subject e.g. [here](https://crypto.stackexchange.com/q/5458/76356), however I would like to ask it for my particular (simple) case. I have an application firmware that is downloaded to a microprocessor through a bootloader firmware that is taking care of decryption and...
On July 5, 2022, NIST chooses one KEM (Key Encapsulation Mechanism) as a PQC standard and 4 KEMs as four-round candidates. Why aren't there any key exchanges? Similarly, KEMs are usually studied in the literature. The post-quantum key exchanges in the literature are very rare. Moreover, in those key exchanges, the ...
Why post-quantum key exchanges went extinct?
Principally because NIST did not make key exchanges a necessary part of the process. If we look at the [NIST PQC FAQ][1] "NIST provided APIs and security definitions for Public Key encryption, KEM, and digital signature. Why are other functionalities not included?" NIST state: > NIST is looking primarily to replace ...
Principally because NIST did not make key exchanges a necessary part of the process. If we look at the [NIST PQC FAQ][1] "NIST provided APIs and security definitions for Public Key encryption, KEM, and digital signature. Why are other functionalities not included?" NIST state: > NIST is looking primarily to replace ...
Does it exist an upper bound for the advantage of solving the Gap Diffie-Hellman problem (possibly expressed in terms of the order of the group, number of queries to the oracle, time, etc.)?
How can I create a "reverse" GHASH algorithm for GCM that allows me to compute an input value that generates a specific chosen output, given that I know the authentication key H? If this is possible, what is the process for achieving this?
Is it possible to reverse GHASH from GCM?
> If this is possible, what is the process for achieving this? It's actually quite easy, if you know how to do operations in $GF(2^{128})$, specifically, addition, multiplication and computing inverses (note that you already need to know how to do addition and multiplication to perform GHASH in the forward direction...
I know that it sounds like a very stupid question but if shor's algorithm has a complexity of roughly n^3 why cant we just increase the bit size until the time for the algorithm to run is unfeasible on a quantum computer or would it just take too much memory and too much computation for RSA/ECC to be worth it?
[![enter image description here][1]][1] [![enter image description here][2]][2] [![enter image description here][3]][3] [![enter image description here][4]][4] [![enter image description here][5]][5] Would a replay attack be possible in any of these scenarios? My understanding is that in none of th...
I understand the authentication procedure, but are replay attacks possible in these scenarios?
Would a replay attack be possible in any of these scenarios? My understanding is that in none of them a replay attack is possible, but I want to confirm if that is correct. [![enter image description here][1]][1] [![enter image description here][2]][2] [![enter image description here][3]][3] [![en...
Would a replay attack be possible in any of these scenarios? My understanding is that in only images 3 & 4 it is possible. [![enter image description here][1]][1] [![enter image description here][2]][2] [![enter image description here][3]][3] [![enter image description here][4]][4] [![enter ima...
**Scenario:** 1. There are 3 people: PERSON1, PERSON2, and PERSON3 2. PERSON1 and PERSON2 each have a 2-dimensional polygon on an x,y plane 3. It is PERSON3's job to assess whether the polygons overlap 4. However, PERSON1 and PERSON2 must encode their polygons in such a way that PERSON3 cannot ident...
Anonymized Spatial Conflict Assessment - Suggested Approaches?
I have some rudimentary cryptography knowledge but am by no means an expert. I generally understand stream ciphers, such as such as ChaCha20-Poly1305, to be symmetric. I am wondering how age (https://github.com/FiloSottile/age) uses public and private keys to encrypt data with ChaCha20-Poly1305. Is it similar to ho...
Age: stream cipher with public key cryptography?
Why predicting an error in Crystal Kyber is considered to be hard?
[PBKDF2][5] (as defined by [RFC 2898][6]) is a function of the form $$DK = \text{PBKDF2}(\text{PRF}, Password, Salt, c, dkLen)$$ In most practical use cases, the [$\text{PRF}$][6] is [$\text{HMAC}$][7] instantiated with a [Merkle-Damgård][8] [hash][9] function such as [$\text{SHA-1}$][10]†.The time to compute $\t...
I was reading "**The Potential Impact of Quantum Computers on Society**" by Ronald de Wolf. He states that "other computational problems, for instance, are based on lattices or on error-correcting codes. The problem with such schemes is that they have barely been tested." The author did not provide any references ...
[PBKDF2][1] (as defined by [RFC 2898][2]) is a function of the form $$DK = \text{PBKDF2}(\text{PRF}, Password, Salt, c, dkLen)$$ In most practical use cases, the [$\text{PRF}$][2] is [$\text{HMAC}$][3] instantiated with a [Merkle-Damgård][4] [hash][5] function such as [$\text{SHA-1}$][6]†.The time to compute $\te...
[PBKDF2][1] (as defined by [RFC 2898][2]) is a function of the form $$DK = \text{PBKDF2}(\text{PRF}, Password, Salt, c, dkLen)$$ In most practical use cases, the [$\text{PRF}$][2] is [$\text{HMAC}$][3] instantiated with a [Merkle-Damgård][4] [hash][5] function such as [$\text{SHA-1}$][6]†.The time to compute $\te...
I know that it sounds like a very stupid question but if Shor's algorithm has a complexity of roughly $n^3$ why cant we just increase the bit size until the time for the algorithm to run is unfeasible on a quantum computer or would it just take too much memory and too much computation for RSA/ECC to be worth it?
Why can't we just increase the bit length to counteract shor's algorithm?
Can the security of the encryption system be improved by using double encryption with two randomly chosen keys? By double encryption I mean using two keys $K_1$ and $K_2$, each 20-bit long, to obtain ciphertext $C = ( M ⊕ K_1 ) ⊕ K_2$.
How is MLWE used for key generation in Kyber?
How & where is concepts of Good basis and bad basis used in Crystal kyber?
In the process of learning zk-SNARKs, I'm faced with this problem: I understand why if the prover sends a polynomial $P$ that can be divided by $T$, the target polynomial, the prover knows a valid assignment. But I don't understand how the verifier makes sure that the prover actually sent a polynomial $P$ which matc...
I am trying to understand what the Hybrid Argument is in cryptography and why is it useful. ------ By the definition of the Hybrid Argument we know that to prove that if two distributions $D = D_1, D_2, ..., D_k = D'$ can be distinguished, then $\exists D_i, D_{i+1} $ that can be distinguished. -------- Let: ...
**Scenario:** 1. There are 3 people: PERSON1, PERSON2, and PERSON3 2. PERSON1 and PERSON2 each have a 2-dimensional polygon on an x,y plane 3. It is PERSON3's job to assess whether the polygons overlap 4. However, PERSON1 and PERSON2 must encode their polygons in such a way that PERSON3 cannot ident...
How can I create a "reverse" GHASH algorithm for GCM that allows me to compute an input value that generates a specific chosen output, given that I know the authentication key H? If this is possible, what is the process for achieving this?
Is it possible to reverse GHASH from GCM?
I would like to know the security of using key size that is larger than the message digest (output) of a HMAC in one time pad encryption. One time pads for the message and the key of HMAC are different, scenario: - A single message will be sent from A to B on insecure medium but is not known WHEN, in advance. - Both...
I am trying to understand what the Hybrid Argument is in cryptography and why is it useful. ------ By the definition of the Hybrid Argument we know that to prove that if two distributions $D = D_1, D_2, ..., D_k = D'$ can be distinguished, then $\exists D_i, D_{i+1} $ that can be distinguished. -------- Let: ...
[PBKDF2][1] (as defined by [RFC 2898][2]) is a function of the form $$DK = \text{PBKDF2}(\text{PRF}, Password, Salt, c, dkLen)$$ In most practical use cases, the [$\text{PRF}$][2] is [$\text{HMAC}$][3] instantiated with a [Merkle-Damgård][4] [hash][5] function such as [$\text{SHA-1}$][6]†.The time to compute $\te...
Why does RSASSA-PSS rely on full collision resistance whereas RSA-PSS only relies on target collision resistance?
How to give an example for collision in modified Mekle-Damgard construction that does not include input length, with two message that **ARE** multiple of the block length? (Assume the resulting hash function is only defined for inputs whose length is an integer multiple of the block length.) \ It is easy to consider a...
Im following these slides from "An Introduction to the Theory of Elliptic Curves" http://www.math.brown.edu/johsilve/Presentations/WyomingEllipticCurve.pdf, but I'm having some difficulty understanding how the ECDLP can be solved in anomalous curves. On the slides it says: "If #E(Fp) = p, then there is a “p-adic l...
LMS is specially used for applications, such as code-signing (https://csrc.nist.gov/CSRC/media/Publications/white-paper/2018/01/26/security-considerations-for-code-signing/final/documents/security-considerations-for-code-signing.pdf). Given the parameter list in table 3, found here https://datatracker.ietf.org/doc/html...
why sbox input XOR sbox output can be sensitive data of side channel attack?
> What I don't understand is why is it easy to solve the discrete logarithm problem in $\mathbb{Z}/p\mathbb{Z}$. Isn't the Diffie Hellman key exchange based on the difficulty of computing discrete logarithms? In the *additive group* $\mathbb{Z}/p\mathbb{Z}$, DLOG is equivalent to computing a modular inverse, which i...
Goldreich justifies why we work with the term negligible by saying among other things "events that occur with negligible (in n) probability remain negligible even if the experiment is repeated for polynomially (in n) many times.". Now I want to proof this statement. So I assume we have a problem with a verifiable solu...
Why is repeating for polynomial time still negligible if one execution has negligible chance?
On July 5, 2022, NIST chooses one KEM (Key Encapsulation Mechanism) as a PQC standard and 4 KEMs as four-round candidates. Why aren't there any key exchanges? Similarly, KEMs are usually studied in literature. The post-quantum key exchanges in literature are very rare. Moreover, in those key exchanges, the message ...
Why did post-quantum key exchanges go extinct?
From Ronald de Wolf's [The potential impact of quantum computers on society][1]: > The first is so-called *post-quantum cryptography*. This is classical cryptography, based on computational problems that are easy to compute in one direction but hard to compute in the other direction *even by quantum computers*. Fact...
Are lattice-based cryptography and error-correcting codes mathematically unsound?
I would like to know the security of using key size that is larger than the message digest (output) of a HMAC in one time pad encryption. One time pads for the message and the key of HMAC are different, scenario: - A single message will be sent from A to B on insecure medium but is not known WHEN, in advance. - Both...
The updated question, containing the quote, is much less polemic than the original. Indeed, it's just an issue of the general impossibility of proving a negative (in this case: "can certain PQC problems be solved efficiently"?) It's easy to prove that yes, they can be solved efficiently, by just providing an algorithm ...
I was studying about the Microsoft exchange server data breach attack of 2021 as part of assignment case study. One of the tasks of the assignment it to find its relevance with IND-CPA, IND-CCA1, IND-CCA2 standards. From my understanding the attack is seemed to be caused due to some logical bugs in the code base of ...
I was studying about the Microsoft exchange server data breach attack of 2021 as part of assignment case study. One of the tasks of the assignment it to find its relevance with IND-CPA, IND-CCA1, IND-CCA2 standards. From my understanding the attack is seemed to be caused due to some logical bugs in the code base of ...
Assume $\phi(N) = (p - 1) (q - 1)$ as in the original paper. Suppose that we are using the same modulus $N$ for public and private key pairs $(e_1, d_1)$ and $(e_2, d_2)$. How can we get a multiple of $\phi(N)$ from these two pairs?
Let's say I have three messages: `A` `B` `C` And I run each of these through two *different* Hashing algorithms: `MD5` and `SHA1` for this example MD5(A) = X MD5(B) = Y MD5(C) = Y SHA1(A) = N SHA1(B) = N SHA1(C) = M Notice the MD5 hash of `B` and `C` collide. And the `SHA` has...
Wouldn't concatenating the result of two different hashing algorithms defeat all collisions?
If we consider LMS with (SHA256 and LMS-OTS as the OTS scheme) as defined in sections 5 and 4 here: https://datatracker.ietf.org/doc/html/rfc8554#section-5, they provide the following formulas for LMS-OTS (section 4.4): *In general, the LM-OTS signature is 4+n*(p+1) bytes long, and public key generation will tak...
LMS hash calls formula?
> for a given parameter set of LMS as defined in Section 5, making use of LMS-OTS, what would those above formulas be? Well, for LMS verification, it would be the time taken for LMS-OTS verification, plus one hash [1] per Merkle tree height $L$ (which is either 5, 10, 15, 20 or 25). On the other hand, for LMS sig...
> for which specific code-signing applications and environments (router firmware updates, user OS updates, cloud embedded device firmware update verification) are these parameter sets most practical? Well, LMS is best suited if: - You need good security (e.g. postquantum); LMS makes the assumption that SHA-256 is...
> for which specific code-signing applications and environments (router firmware updates, user OS updates, cloud embedded device firmware update verification) are these parameter sets most practical? Well, LMS is best suited if: - You need good security (e.g. postquantum); LMS makes the assumption that SHA-256 is...
I'm currently working on implementing digital signatures on the curve secp256k1 (for learning purposes only), and I'm having some trouble implementing ECDSA on curve secp256k1. As I understand it, this curve is a koblitz curve, which means it can't be written in the Montgomery form. Due to this limitation, I'm unable t...