instruction
stringlengths
15
30k
Consider a variant of the Paillier encryption scheme where the message space is restricted to $\mathbb{Z}_q$ such that the RSA modulus $N$ of the Paillier cryptosystem satisfies $N > q + q^2$. I am interested in the following variant of the CCA security game where the decryption oracle answers with not a complete decry...
RFC 5869 for HKDF says "an application needs to make sure that salt values are not chosen or manipulated by an attacker".[1] Soatok also discusses some nuances in choosing salts for HKDF.[2] This question also discusses a situation where it led to a vulnerability.[3] While these sources all indicate that salts shoul...
What is the impact of leaving a salt used in HKDF open to attacker control?
RFC 5869 for HKDF says "an application needs to make sure that salt values are not chosen or manipulated by an attacker".[1] Soatok also discusses some nuances in choosing salts for HKDF.[2] This question also discusses a situation where it led to a vulnerability.[3] While these sources all indicate that salts shoul...
I am going through Dan Boneh's video tutorial on PLONK Polynomial IOPs - https://www.youtube.com/watch?v=vxyoPM2m7Yg He describes 3 type of proof gadgets he will use [![Proof Gadgets][1]][1] He gives a proof of the Zero Test which I understood. However, he doesn't cover the proof for the Sum Check & Product Ch...
maybe the lecture video on youtube can help you to understand: https://youtu.be/LbpPCN-f_XA?t=952 BTW, the equation in the first of 4 slides you don't understand is just stating the hypothesis in the form of auxiliary polynomial t
Let $f_k$ be a PRF. We claim that $f_k$ is a OWF. PROOF let $f_k$ is not a OWF, there exists a $PPT$ algorithm $A$ that can invert $f_k$ with non-negligible advantage. Even if we know the input $x$ for given $f_k(x)$ with a non-negligible advantage, how can we claim that we can distinguish $f_k(x)$ from random with non...
Is a pseudorandom function (PRF) also a one-way function (OWF)? If yes, how can we proof that a PRF $f_k$ is a OWF? If no, what is the closest work?
For a public-key encryption scheme (Gen,Enc,Dec), the textbook definition of IND-CPA security is the following: 1. The challenger runs (pk,sk)←$Gen and sends pk to the adversary. 2. The adversary performs some computation, chooses (m0​,m1​) and sends them to the challenger. 3. The challenger runs ct←$Enc(pk,mb​) ,...
How to give a hybrid proof that IND CPA secure implies multiple query IND CPA secure and vice versa?
For a public-key encryption scheme (Gen,Enc,Dec), the textbook definition of IND-CPA security is the following: 1. The challenger runs (pk,sk)←$Gen 2. The challenger sends pk to the adversary. 2. The adversary performs some computation, chooses (m0​,m1​) and sends them to the challenger. 3. The challenger runs...
For a public-key encryption scheme (Gen,Enc,Dec), the textbook definition of IND-CPA security is the following: 1. The challenger runs (pk,sk)←Gen and sends pk to the adversary. 2. The adversary performs some computation, chooses (m0​,m1​) and sends them to the challenger. 3. The challenger runs ct←$Enc(pk,mb​) , ...
I'm trying to design an encryption system for a new app that may be built that requires top notch security... and no password. Does this plan make sense: **Algorithms used** - Base layer: TLS 1.3 (no cert pinning) - Client-Server communication: diffie-hellman - Threshold/Distributed encryption: Shamir's Secre...
Is this passwordless encryption system for an app and client-server communication any good?
I'm trying to design an encryption system for a new app that may be built that requires top notch security... and no password. Does this plan make sense as far as the technologies go (ignore the human vulnerabilities for phishing and UI design issues)? I'm concerned here with MIM attacks, brute force, vulnerabilities f...
Is this passwordless encryption system for an app and client-server communication considered secure in 2023?
I'm trying to design an encryption system for a new app that may be built that requires top notch security... and no password. Does this plan make sense as far as the technologies go (ignore the human vulnerabilities for phishing and UI design issues)? I'm concerned here with MIM attacks, brute force, vulnerabilities f...
I'm trying to design an encryption system for a new app that may be built that requires top notch security... and no password. Does this plan make sense as far as the technologies go (ignore the human vulnerabilities for phishing and UI design issues)? I'm concerned here with MIM attacks, brute force, vulnerabilities f...
I'm trying to design an encryption system for a new mobile app and am thinking of using Shamir's Secret Sharing Scheme in a way which I have not seen before. Does this seem possible or does it violate some mathematical concept I'm not understanding in SSS? I want to split a key generated on the user's mobile device ...
I am currently studying the [proof of the Dilithium signature in the quantum random oracle model][1] (QROM). I am curious to hear if anyone have any thoughts on the importance of having proofs in the QROM or if proofs in the standard random oracle model should be sufficient? Have been exploring the topic briefly wit...
Do we need the quantum random oracle model (QROM)?
A PRF is a keyed function, or alternatively it is a family of functions indexed by a key. A OWF is a single public function. There is a mismatch between these two things. AES is a secure PRF (function family). Does that mean $\textsf{AES}(k,\cdot)$ is a OWF? The adversary attacking a OWF is allowed to depend on the ...
A PRF is a keyed function, or alternatively it is a family of functions indexed by a key. A OWF is a single public function. There is a mismatch between these two things. AES is a secure PRF (function family). Does that mean $\textsf{AES}(k,\cdot)$ is a OWF? The adversary attacking a OWF is allowed to depend on the ...
I have found [similar question for PIV (and not PGP)][1] I assume PIV and OpenPGP would work in similar ways. I also assumes that the GPG private key never leaves the Yubikey. If these assumptions are correct then: - at encryption: a symmetric key is generated and encrypted on the sending computer using the GP...
Where does signing/decrypting take place on a YubiKey 5 for PGP private key?
I'm no crypto expert, but I remember that PGP added some random number (32-bit I think) twice at the start of the data to encrypt. So when decrypting you can check whether the first two 32-bit values are identical (without knowing the actual values, making clear-text attacks (more?) difficult). Maybe you could try th...
A signature system applies textbook RSA to a $b$-bit hash of the message. What's the cost (preferably, as CPU time on common hardware) of existential forgery assuming known signature of $r$ random messages? How much is that reduced if public exponent is small? We assume - Safe RSA public key $(n,e)$ and matching se...
Sorry in advance if I'm asking a stupid question: I thought the role of "IV" in encryption is to avoid having identical ciphertext for identical plaintext. So one could use some random IV. Writing some Perl code I'm confused, however. Consider this test code: ~~~lang-perl use Crypt::Rijndael; my $cipher = ...
Relinearization is important to build a *compact* FHE scheme. > An FHE scheme is said to be *compact* if > > 1. The running time of decryption, and > 2. The size of ciphertexts > > are both independent of the homomorphic computation which has taken place. It is (roughly) trivial to build non-compact FHE sc...
This question specifically asks about AES-256-CBC, so this answer shows how to determine programmatically whether or not the correct key is provided for decrypting ciphertext generated by AES-256-CBC. It turns out that with a little knowledge of the padding used during encryption, this is possible to do, by focusing ...
I don't understand why relinearization is so significant. I understand the equations in the paper (in this post I'll be using notation from BV but I would it applies to BGV+BFV) but if anything it seems like it would be ***less*** efficient. We go from: $$h_0+\sum_ih_ix_i+\sum_{i,j}h_{i,j}x_ix_j$$ to utilizing t and ...
Relinearization is important to build a *compact* FHE scheme. > An FHE scheme is said to be *compact* if > > 1. The running time of decryption, and > 2. The size of ciphertexts > > are both independent of the homomorphic computation which has taken place. It is (roughly) trivial to build non-compact FHE sc...
A signature system applies textbook RSA to a $b$-bit hash of the message. What's the cost (preferably, as CPU time on common hardware) of existential forgery assuming known signature of $r$ random messages? How much is that reduced if public exponent is small? We assume - Safe RSA public key $(n,e)$ and matching se...
A signature system applies textbook RSA to a $b$-bit hash of the message. What's the cost (preferably, as CPU time on common hardware) of existential forgery assuming known signature of $r$ random messages? How much is that reduced if public exponent is very small ($e\le7$)? We assume - Safe RSA public key $(n,e)$ ...
Let's suppose I encrypt two blocks of 1MiB with AES-256 in CBC mode, each one using different keys, XOR the resulting plaintexts and send this XORed block to an adversary. What could he/she do with the XORed block? Can he/she find the keys I used, or even the plaintext in less than 2^256 tries (256-bits). This qu...
If I encrypt two plaintexts with different keys, XOR the plaintexts and send to an adversary, what can he/she do with what I sent?
Let's suppose I encrypt two blocks of 1MiB with AES-256 in CBC mode, each one using different keys, XOR the resulting plaintexts and send this XORed block to an adversary. Remembering that the adversary will not have access to resulting plaintexts, only the XOR of them. What could he/she do with the XORed block? Can...
Let $E\!: y^2 = f(x)$ be an elliptic curve over a finite field $\mathbb{F}_{q}$ of odd characteristic. Consider an $\mathbb{F}_{q}$-point $P = (x,y)$ on $E$. Suppose that we only have the $x$-coordinate (with one auxiliary bit) and we want to recover $P$, that is, the value $y = \sqrt{f(x)}$. Assume that the field ...
Let $E\!: y^2 = f(x)$ be an elliptic curve over a finite field $\mathbb{F}_{q}$ of odd characteristic. Consider an $\mathbb{F}_{q}$-point $P = (x,y)$ on $E$. Suppose that we only have the $x$-coordinate (with one auxiliary bit) and we want to recover $P$, that is, the value $y = \sqrt{f(x)}$. Assume that the field ...
Is there modification to LWE public key crypto-system which makes the decryption process is totally deterministic and does not affect security?
Is there a version of LWEEncrypt in which probability of decryption error is zero?
Given a message m, how can I prove that m lies between 0 and 31 without revealing the message using a Sigma protocol? The message is encrypted as c = a^beta * g^m, where a is the public key of the receiver, beta is the secret key of the sender and g is a generator of a cyclic group G of prime order q. I know I need to ...
How to design a zkp that a message lies in a certain range?
Let's suppose I encrypt two blocks of 1MiB with AES-256 in CBC mode, each one using different keys, XOR the resulting plaintexts and send this XORed block to an adversary. Remembering that the adversary will not have access to resulting ciphertexts, only the XOR of them. What could he/she do with the XORed block? Ca...
Let's say a device has 2 private keys and a service has the 2 corresponding public keys. Is there an efficient way to encrypt a symmetric key from the service side utilizing the 2 public keys, such that on the client, it requires both private keys in order to decrypt? I.e if I only have private key 1, I am unable t...
Encrypting a symmetric key which requires 2 keys to decrypt?
Let's say a device has 2 private keys and a service has the 2 corresponding public keys. Is there an efficient way to encrypt a symmetric key from the service side utilizing the 2 public keys, such that on the client, it requires both private keys in order to decrypt? I.e if I only have private key 1, I am unable t...
While using ECDH key exchange, we can choose to use different kind of elliptic curve, e.g. P224, P256 or P384 etc. (btw, I am using [go](https://pkg.go.dev/crypto/ecdh)). My question is, what is the criteria to choose different kind of elliptic curve? Is it related to desired security level? If yes, what is the "ru...
With elliptic-curve cryptography, a private key $a$ has the corresponding public key $A = aG$, where $G$ is a well-known generator point on the curve and $aG$ means elliptic-curve scalar multiplication of the point $G$ with the scalar $a$. If you have two (private, public) key pairs $(a, A=a G)$ and $(b, B=b G)$, th...
Let's say a device has 2 private keys and service has the 2 corresponding public keys. Is there an efficient way to encrypt a symmetric key from the service side utilizing the 2 public keys, such that on the client, it requires both private keys in order to decrypt? I.e if I only have private key 1, I am unable to ...
Given a message $m$, how can I prove that m lies between 0 and 31 without revealing the message using a Sigma protocol? The message is encrypted as $$c = a^beta * g^m$$ where - $a$ is the public key of the receiver, - $beta$ is the secret key of the sender and - $g$ is a generator of a cyclic group G of pri...
Given a message $m$, how can I prove that m lies between 0 and 31 without revealing the message using a Sigma protocol? The message is encrypted as $$c = a^{beta} * g^m$$ where - $a$ is the public key of the receiver, - $beta$ is the secret key of the sender and - $g$ is a generator of a cyclic group G of p...
Given a message $m$, how can I prove that $m$ lies between 0 and 31 without revealing the message using a Sigma protocol? The message is encrypted as $$c = a^{\beta} \cdot g^m$$ where - $a$ is the public key of the receiver, - $\beta$ is the secret key of the sender and - $g$ is a generator of a cyclic grou...
Given a message $m$, how can I prove that $m$ lies between 0 and 31 without revealing the message using a Sigma protocol? The message is encrypted as: $$c = a^{\beta} \cdot g^m ,$$ where: - $a$ is the public key of the receiver, - $\beta$ is the secret key of the sender, and - $g$ is a generator of a cy...
How to design a Zero-Knowledge Proof of a message in a certain range?
Let's suppose I encrypt two blocks of 1MiB with AES-256 in CBC mode, each one using different keys, XOR the resulting ciphertexts and send this XORed block to an adversary. Remembering that the adversary will not have access to resulting ciphertexts, only the XOR of them. What could he/she do with the XORed block? C...
If I encrypt two ciphertexts with different keys, XOR the ciphertexts and send to an adversary, what can he/she do with what I sent?
If I encrypt two plaintexts with different keys, XOR the ciphertexts and send to an adversary, what can he/she do with what I sent?
["Factoring integers with sublinear resources on a superconducting quantum processor"](https://arxiv.org/pdf/2212.12372.pdf) seems to indicate the end is getting closer for RSA - much faster than anticipated earlier: > We proceed by estimating the quantum resources required to factor RSA-2048. We find that a quantum...
Does the article "Factoring integers with sublinear resources on a superconducting quantum processor" affect ECC?
> *I thought the role of "IV" in encryption is to avoid having identical ciphertext for identical plaintext. So one could use some random IV.* Well, yes, but in case of CBC it also needs to be fully unpredictable by an adversary. ``` $cipher->set_iv('IV' x 8); ``` Absolutely doesn't cut it *unless* the key i...
In the official Documentation of the X3DH Algorithm is made an analysis about the forward secrecy. Forward security would be an uselful property if we would repeat the protocol multiple times. But in the Signal-Protocol it is always used only once, to initalize Double Ratchet (which then on its own leads to forward / b...
Why is forward secrecy needed at X3DH?
## Content and Informal Problem Suppose a protocol $\pi$ doing an arbitrary task between two users A and B. I only know that $\pi$ relies on a IND-CPA symmetric encryption scheme $\mathcal{E} = $(KeyGen, Enc, Dec). In details, A holds a key $k$ in $\pi$ computes encryptions of $n$ messages $m_1, \dots, m_n$, providing...
In the official documentation of the X3DH Algorithm is made an analysis about the forward secrecy. Forward secrecy would be an uselful property if we would repeat the protocol multiple times. But in the Signal-Protocol it is always used only once, to initialize the Double Ratchet Algorithm (which then on its own leads ...
## Content and Informal Problem Suppose a protocol $\pi$ doing an arbitrary task between two users A and B. I only know that $\pi$ relies on a IND-CPA symmetric encryption scheme $\mathcal{E} = $(KeyGen, Enc, Dec). In details, A holds a key $k$ in $\pi$ computes encryptions of $n$ messages $m_1, \dots, m_n$, providing...
> *I thought the role of "IV" in encryption is to avoid having identical ciphertext for identical plaintext. So one could use some random IV.* Well, yes, but in case of CBC it also needs to be fully unpredictable by an adversary. ``` $cipher->set_iv('IV' x 8); ``` Absolutely doesn't cut it *unless* the key i...
So I went ahead an wrote this little program. What it does is it takes a password for a seed and generates a (pseudo-random) bit-pattern using rule 30 from cellular automata. It then XORs our input file with the same-length pattern. In theory this should be secure, given I would start padding the plaintext and only use...
There have been people considering CA for cryptanalysis. The problem is that CA leads to an unbounded state and this uses unbounded memory. Thus some dubious claims of "breaking" cryptosystems which appear outside the mainstream crypto venues are largely ignored. For your specific question you need to demonstrate ex...
As I understand it, in WPA2, the shared key (for encryption) is derived from the password, plus nonces and identities used in the initial 4-way exchange. An attacker who was able to sniff the initial exchange could perform an offline dictionary attack on the AP password. I've also learned about PAKE protocols that a...
Is PAKE more secure than WPA2?
I think my understanding on initialization vector (IV) might be lacking, but as I understand it, an IV is used to create randomness to an encrypted message so that the message is difficult to crack from an attacker. The randomness part I can see the importance of. The part I can’t get my head around is why use the ...
I am trying to solve a puzzle, and I think have to solve a cipher. But I'm not actually sure what I have to do ... This is the thing I think might be a cipher to solve : The diu uff i dve. lleive pi he bl hle f he mi Nw ie d hiie d eve me Biie ide hi i. Ti Bii imli Vili Buei G Bii Ti imli, Gee li bei ipped el be...
Could this be a cipher or not?
> as I understand it, an IV is used to create randomness to an encrypted message so that the message is difficult to crack from an attacker. Actually, it's more so that if we encrypt several messages with the same key, their relationship is not obvious. For example, consider CBC mode, and we encrypt two different...
> why don't WIFI security protocols use PAKE? I wasn't involved with the design; I assume that WPA2 and earlier do not use a PAKE because it was considered too expensive (either in terms of bandwidth or computational cost). Now, with WPA3, that added [Dragonfly][1], which does attempt to be a symmetric PAKE (symm...
> An attacker who was able to sniff the initial exchange could perform an offline dictionary attack on the AP password. That is indeed correct for WPA2 > why don't WIFI security protocols use PAKE? I wasn't involved with the design; I assume that WPA2 and earlier do not use a PAKE because it was considered too...
A hacker goes into a database and downloads a bunch of hashes and salts of users with knowledge of the hashing method. Say this is one entry that got downloaded: cbc0a790b2f28fc72ca43eb749028b9f:21022011 (hash:salt) Without the salt, the hacker simply computes 100M common passwords and their hashes and find matc...
Salts are stored with the hash - so for a single user it's no security advantage?
There are two algorithms in my framework, $E_1(\cdot)$ and $E_2(\cdot)$. In particular, executing $E_1(\cdot)$ on a specific input $x$ (i.e., $E_1(x)$) is equivalent to executing B for some input $y$. Suppose the security model of this framework allows an adversary $\mathcal{A}$ to query $E_1(\cdot)$ with any inp...
Is it appropriate to prohibit an adversary from querying a specific input in an algorithm in some situation?
There are two algorithms in my framework, $E_1(\cdot)$ and $E_2(\cdot)$. In particular, executing $E_1(\cdot)$ on a specific input $x$ (i.e., $E_1(x)$) is equivalent to executing $E_2(y)$ for some input $y$. Suppose the security model of this framework allows an adversary $\mathcal{A}$ to query $E_1(\cdot)$ with ...
I am trying to solve a puzzle, and I think have to solve a cipher. But I'm not actually sure what I have to do ... Example : ` The diu uff i dve. lleive pi he bl hle f he mi Nw ie d hiie d eve me Biie ide hi i. Ti Bii imli Vili Buei G Bii Ti imli, Gee li bei ipped el be ie EL lvd ie Nvz d ell u h u. lle Re V...
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...
It is known that by adding an extra round of communication, it is possible to convert a random OT (where the choice bits and the sender input are random) to a standard OT, see https://crypto.stackexchange.com/a/84206/48273 for details. OLE (oblivious linear function evaluation) is a generalization of OT. Specifically, ...
Is it secure to do subfield VOLE over a Ring $\mathbb{Z}_{2^k}$?
Let $E$ be an elliptic curve over a finite field $\mathbb{F}_q$. For simplicity, let the group $E(\mathbb{F}_q)$ is of prime order. Assume that I know how to construct an efficiently computable permutation of $E(\mathbb{F}_q)$ as a set, that is, a bijective map $\phi: E(\mathbb{F}_q) \to E(\mathbb{F}_q)$. Moreover, $\p...
Let $E$ be an elliptic curve over a finite field $\mathbb{F}_q$. For simplicity, let the group $E(\mathbb{F}_q)$ be of prime order. Assume that I know how to construct an efficiently computable permutation of $E(\mathbb{F}_q)$ as a set, that is, just a bijective map $\phi: E(\mathbb{F}_q) \to E(\mathbb{F}_q)$ rather th...
Let $E$ be an elliptic curve over a finite field $\mathbb{F}_q$. For simplicity, let the group $E(\mathbb{F}_q)$ be of prime order. Assume that I know how to construct an efficiently computable permutation of $E(\mathbb{F}_q)$ as a set, that is, just a bijective map $\phi: E(\mathbb{F}_q) \to E(\mathbb{F}_q)$ rathe...
In pairing based cryptography (PBC) we restrict the pairing domains to be subgroups of the $r$-torsion group $E[r]$. This arises two questions to me: 1. Why do we restrict them to subgroups of $E[r]$? Couldn't we use, for instance, the whole group of points $E$? Or a mixture between various torsion groups? (As lon...
Why pairing domains are subgroups of the r-torsion group?
I know this is an old question but I had the same question and after a bit of searching I think found the answer so I wanted to share: *The difference between the salt and the personalization contex can indeed be considered purely semantic.* ### More details Looking at the [implementation in libsodium][1] we s...
I wrote code that solves the subset sum problem via the LLL algorithm, as given in chapter three of the Handbook of Applied Cryptography https://cacr.uwaterloo.ca/hac/ I ran the code on ten random sets, each with positive integers from one to $2^n$, each with a random subset adding up to a target integer. The code f...
I wrote code that solves the subset sum problem via the LLL algorithm, as given in chapter three of the Handbook of Applied Cryptography https://cacr.uwaterloo.ca/hac/ I ran the code on ten random sets, each with positive integers from one to $2^n$, each with a random subset adding up to a target integer. The code f...
In GCM, GMAC, the additional associated data (AAD) (as well as outputs of subsequent blocks) is multiplied by a polynomial H in GF(2^128). This appears to be doing some secure hashing. Is that what's happening, and if so, is this a general hashing method that's used elsewhere?
Is GF multiplication in GCM cipher mode and GMAC a more general hashing method?
> In GCM, GMAC, the additional associated data (AAD) (as well as outputs of subsequent blocks) is multiplied by a polynomial H in GF(2^128). Actually, it's the other way around; the AAD and the ciphertext is converted into a polynomial, and that polynomial is evaluated at a secret point H (in $GF(2^{128})$ > This...
What kind of hashing is GF multiplication in GCM cipher mode and GMAC?
I am going through Dan Boneh's video on PLONK - https://www.youtube.com/watch?v=LbpPCN-f_XA&t=952s At around 19 minutes, he gets to the Prod Check Gadget. **Background:** $\omega \in \mathbb F_p$ is the primitive $k$th root of unity (i.e. $\omega^{k} = 1$) $\Omega = \{1, \omega, \omega^{2}, ..., \omega^...
PLONK Product Check Proof. Why is the 2nd condition required?