instruction
stringlengths
15
30k
Say I have some message like "Hello World" that I want to encrypt, I get that Hello World is the Plain Text and the output from the encryption is called Cipher Text. But, let's say I want to encrypt the data again, so I feed in the cipher Text from first round back into the encryption algorithm and then get the new ...
Plain Text and Cipher Text terminology when double encrypting?
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^...
In the official documentation of the X3DH Algorithm ([link](https://signal.org/docs/specifications/x3dh/x3dh.pdf)) 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 initia...
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...
Is it possible to adapt the Chaum-Pedersen protocol for using elliptic curves by simply replacing the exponentiation with scalar products? [![zk protocol][1]][1] For example, if `g` is a point in the curve, then `g^k` is the scalar multiplication `k*g` as defined for elliptic curves. Would that still work? I ...
Is it possible to adapt the Chaum-Pedersen protocol for using elliptic curves by simply replacing the exponentiation with scalar products? [![zk protocol][1]][1] For example, if `g` is a point in the curve, then `g^k` is the scalar multiplication `k*g` as defined for elliptic curves. Would that still work? I ...
After a Fiat–Shamir heuristic is applied, the non-interactive version would be: $Y_1=xG$ and $Y_2=xH$, where $G$ and $H$ are generator points on the curve and $x$ is a scalar. We intend to prove discrete-log equivalence, along with knowledge of $x$. We pick a uniformly random scalar $k$, and calculate the chal...
After the Fiat–Shamir heuristic is applied, the non-interactive version would be: $Y_1=xG$ and $Y_2=xH$, where $G$ and $H$ are generator points on the curve and $x$ is a scalar. We intend to prove discrete-log equivalence, along with knowledge of $x$. We pick a uniformly random scalar $k$, and calculate the ch...
A custom file format has a header encrypted with a 2048-bit RSA public key. I need to decrypt it using a 2048-bit RSA private key. The header has 48 bytes, and according to the scheme I got for the task, after decryption I should get a 48 bytes of "plaintext" payload. However, this scheme does not make any sense to ...
Does this RSA decryption scheme make sense?
You're right, normal RSA does not (and cannot) work like that. Most likely, your client either: 1. is using RSA with an absurdly low (and insecure) key size, 2. is not actually using RSA at all, or 3. has provided you with incorrect documentation regarding the encrypted header size. All of those seem plausible...
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^...
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^...
Suppose someone has a black box, which is running some program. This box has some internal states, and we can observe the outputs it produces. Now someone comes along and claims the release the source code of the program running on that black box. Is there a way to verify that claim, without also requiring the disclosu...
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 Prod Check Proof - why does it have to be proven beyond the last element of the set? It should be enough to prove it upto last element
PLONK Prod Check Proof - why does it have to be proven upto the last element of the set? It should be enough to prove it upto last but one element
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^...
**Case 1**: If the box is a simple finite state machine as you suggest, then there are techniques such as Monte Carlo simulation. You input various random values whilst observing the outputs. This has been done by NIST for hardwired cryptographic primitives operating in potted boxes. See [What's the reason for Monte Ca...
I understand that FIDO2/WebAuthn generates a separate key-pair for each web-site (domain), and only allows a specific key-pair to be used for authentication on the same web-site (domain) who originally generated/registered that key-pair with the browser/authenticator, in order to prevent MITM and Phishing attacks. *...
Why does FIDO2/WebAuthn need to generate a separate key-pair for each site?
I understand that FIDO2/WebAuthn generates a separate key-pair for each web-site (domain), and only allows a specific key-pair to be used for authentication on the same web-site (domain) who originally generated/registered that key-pair with the browser/authenticator. This is done in order to prevent MITM and Phishing ...
I understand that FIDO2/WebAuthn generates a separate key-pair for each web-site (domain), and only allows a specific key-pair to be used for authentication on the same web-site (domain) who originally generated/registered that key-pair with the browser/authenticator. Also I'm aware that this is done in order to preven...
I understand that FIDO2/WebAuthn generates a separate key-pair for each web-site (domain), and *only* allows a specific key-pair to be used for authentication on the same web-site (domain) who originally generated/registered that key-pair with the browser/authenticator. Also, I'm aware that this is done in order to pre...
I understand that FIDO2/WebAuthn generates a separate key-pair for each web-site (domain), and *only* allows a specific key-pair to be used for authentication on the same web-site (domain) who originally generated/registered that key-pair with the browser/authenticator. Also, I'm aware that this is done in order to pre...
Why does FIDO2/WebAuthn really need to generate a separate key-pair for each site?
I understand that FIDO2/WebAuthn generates a separate key-pair for each web-site (domain), and *only* allows a specific key-pair to be used for authentication on the same web-site (domain) who originally generated/registered that key-pair with the browser/authenticator. Also, I'm aware that this is done in order to pre...
I understand that FIDO2/WebAuthn generates a separate key-pair for each web-site (domain), and *only* allows a specific key-pair to be used for authentication on the same web-site (domain) who originally generated/registered that key-pair with the browser/authenticator. Also, I'm aware that this is done in order to pre...
I understand that FIDO2/WebAuthn generates a separate key-pair for each web-site (domain), and *only* allows a specific key-pair to be used for authentication on the same web-site (domain) who originally generated/registered that key-pair with the browser/authenticator. Also, I'm aware that this is done in order to pre...
reading paper: ‘even s. A randomized protocol for signing contracts [J]. ACM SIGACT news, 1983’, there has been a question why this scheme cannot be directly extended from 1-out-of-2 OT to 1-out-of-n OT. The OT extension in the later paper adopts very complex methods to expand. Brief description of the original sche...
Reading paper: ‘even s. A randomized protocol for signing contracts [J]. ACM SIGACT news, 1983’, there has been a question why this scheme cannot be directly extended from 1-out-of-2 OT to 1-out-of-n OT. The OT extension in the later paper adopts very complex methods to expand. Brief description of the original sche...
**Assumption**: _"If it looks like a duck, swims like a duck, and quacks like a duck, then it probably is a duck."_ I suggest that if the I/O characteristics of a black box and inspect-able source code achieve the same effect, then semantically the two are identical. The presence of individual pieces of code (e.g. GOT...
Can we upgrade OT(oblivious transfer) from 1-out-of-2 protocol to 1-out-of-N protocol directly?
I understand that FIDO2/WebAuthn generates a separate key-pair for each web-site (domain), and *only* allows a specific key-pair to be used for authentication on the same web-site (domain) who originally generated/registered that key-pair with the browser/authenticator. Also, I'm aware that this is done in order to pre...
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...
I understand that FIDO2/WebAuthn generates a separate key-pair for each web-site (domain), and *only* allows a specific key-pair to be used for authentication on the same web-site (domain) who originally generated/registered that key-pair with the browser/authenticator. Also, I'm aware that this is done in order to pre...
It is worth mentioning most cryptographic hardness assumptions (with the exception of ECC stuff imo) can be painted to be somewhat suspect. For example, one way to describe RSA is as follows. > RSA is a rather ad-hoc assumption, that proponents like to compare to the standard problem of factoring integers, despite ...
Given that there are two parties, and a process has been conducted by which both parties are knowledgeable of a shared value p, how could two parties communicate with each other over a public channel using the value p as a seed for a random number generator?
I have a checksum scheme that uses a simple polynomial summation as described [here](https://crypto.stackexchange.com/questions/103357/data-fingerprint-using-polynomial-and-schwartz-zippel-lemma). Basically I'll take a random value $R$ and a set of inputs $[v_0, v_1, v_2]$ and checksum it like $v_0*R + v_1*R^2 + v_2...
I have a checksum scheme that uses a simple polynomial summation as described [here](https://crypto.stackexchange.com/questions/103357/data-fingerprint-using-polynomial-and-schwartz-zippel-lemma). Basically I'll take a random value $R$ and a set of inputs $[v_0, v_1, v_2]$ and checksum it like $v_0*R + v_1*R^2 + v_2...
> Does this add security against chosen input attacks, and if so how much? No, if $R_c$ is public, it is easy to find collisions. The idea is to find a simultaneous collision on both $R$ and $C$. Here is one approach: - Start with a provisional input $v_i$; set the lower three inputs $v_3, v_2, v_1$ to 0, and...
> Does this add security against chosen input attacks, and if so how much? No, if $R_c$ is public, it is easy to find collisions. The idea is to find a simultaneous collision on both $R$ and $C$. Here is one approach: - Start with a provisional input $v_i$; set the lower three inputs $v_3, v_2, v_1$ to 0, and...
> Does this add security against chosen input attacks, and if so how much? No, if $R_c$ is public, it is easy to find collisions. The idea is to find a simultaneous collision on both $R$ and $C$. Here is one approach: - Start with a provisional input $v_i$; set the lower three inputs $v_3, v_2, v_1$ to 0, and...
Cryptography is the practice of securing communication from unauthorized access. One way of securing information is through encryption, where plaintext (clear text) is transformed into ciphertext using a complex algorithm. The ciphertext is designed to be indistinguishable from random data and difficult to reverse with...
In a message exchange with RSA, an unusual public exponent $e = 65536$ is used. Since $N$ is easily factored, I am able to derive $p$ and $q$. Consequently $ \phi(N) = (p-1)*(q-1)$. However, since $2^3$ is present among the factors of $ \phi(N), \gcd(e,\phi(N)) = 8$. It is not possible to compute the private ex...
How can I decrypt a message with RSA if $e = 65536 and gcd(e,\phi (N)) = 8$?
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^...
How can I decrypt a message with RSA if $e = 65536$ and $gcd(e,\phi (N)) = 8$?
Just started learning about RSA cryptography so forgive me if I made any mistakes or misunderstandings. ``` n = 1024-bit integer (product of two large primes p*q) e = 65537 (standard exponent) ``` However I also have some ciphertext all encrypted with the same keys. > c<sub>1</sub> = m<sub>1</sub><sup>e</su...
GPUs or dedicated hardware can calculate most things much much faster than regular computers ever could. There are password hashing algorithms such as scrypt and argon2 that make the difference smaller, but a powerful dedicated argon2 machine/cluster is still much more efficient than an old budget smartphone is. My ...
Store the password hashing salt on a separate server to slow down evaluation?
I am looking at some secret encryption method that apparently uses CBC and a block size of 256 bytes. I can do a chosen-ciphertext-attack. When I modify a single byte in the ciphertest a complete block of 256 bytes in the plaintext is corrupted, plus a single byte at the same offset in the following block. That leads m...
Which encryption method support 256 bytes block size?
I am looking at some secret encryption method that apparently uses CBC and a block size of 256 bytes. I can do a chosen-ciphertext-attack. When I modify a single byte in the ciphertext a complete block of 256 bytes in the plaintext is corrupted, plus a single byte at the same offset in the following block. That leads m...
GPUs or dedicated hardware can calculate most things much much faster than regular computers ever could. There are password hashing algorithms such as scrypt and argon2 that make the difference smaller, but a powerful dedicated argon2 machine/cluster is still much more efficient than an old budget smartphone is. My ...
> is there any way to obtain the private key and consequently be able to decrypt the other ciphertexts? Sometimes. A fuller answer involves number theory (but to understand RSA, you really need to know the basics anyways). First off, a definition: the *order* of a value $a$ (modulo $p$) is the smallest positive ...
> is there any way to obtain the private key and consequently be able to decrypt the other ciphertexts? Sometimes. A fuller answer involves number theory (but to understand why RSA works, you really need to know the basics anyways). First off, a definition: the *order* of a value $a$ (modulo $p$) is the smallest...
> is there any way to obtain the private key and consequently be able to decrypt the other ciphertexts? Sometimes. A fuller answer involves number theory (but to understand why RSA works, you really need to know the basics anyways). First off, a definition: the *order* of a value $a$ (modulo $p$) is the smallest...
I've spent some time learning about DIDs but am confused about how key rotation really works. **The way I understand it is:** 1. A key pair is generated 2. From the public key, a DID is generated 3. A corresponding DID document with the public key is also generated, signed with the private key, hosted on the...
How does key rotation work with DIDs?
How does key rotation work with DIDs (Decentralized Identifier)?
Let's suppose I hash a 384-bits message with a cryptographic hash function and generate a hash digest of 128-bits. I know that due to the [pigeonhole principle][1], many inputs of same size will result in the same 128-bits hash digest. How is the estimated number of 384-bits messages that will produce the same 128-b...
Is there a simple formula to calculate how many inputs generate same outputs in cryptographic hash functions, being the input larger than the input?
I've spent some time learning about DIDs but have some questions about key rotation: The way I understand it is that a DID and DID doc are generated from a public key derived from a private key. Subsequently, if the owner wants to rotate the keys (the private key really), they can make a new DID doc which will incl...
If we look at the WebAuthn specification, then, during the "registration" ceremony, the authenticator generates a new key-pair and a unique user-id. Then the public-key *and* the unique user-id are sent to the relying party (server), together with some attestation statement. The relying party will store the public-key ...
How do non-"resident" keys work in WebAuthn?
If we look at the WebAuthn specification, then, during the "registration" ceremony, the authenticator generates a new key-pair and a unique user-id. Then the public-key *and* the unique user-id are sent to the relying party (server), together with some attestation statement. The relying party will store the public-key ...
If we look at the WebAuthn specification, then, during the "registration" ceremony, the authenticator generates a new key-pair and a unique user-id. Then the public-key *and* the unique user-id are sent to the relying party (server), together with some attestation statement. The relying party will store the public-key ...
If we look at the WebAuthn specification, then, during the "registration" ceremony, the authenticator generates a new key-pair and a unique user-id. Then the public-key *and* the unique user-id are sent to the relying party (server), together with some attestation statement. The relying party will store the public-key ...
If we look at the WebAuthn specification, then, during the "registration" ceremony, the authenticator generates a new key-pair and a unique user-id. Then the public-key *and* the unique user-id are sent to the relying party (server), together with some attestation statement. The relying party will store the public-key ...
If we look at the WebAuthn specification, then, during the "registration" ceremony, the authenticator generates a new key-pair and a unique user-id. Then the public-key *and* the unique user-id are sent to the relying party (server), together with some attestation statement. The relying party will store the public-key ...
If we look at the WebAuthn specification, then, during the "registration" ceremony, the authenticator generates a new key-pair and a unique user-id. Then the public-key *and* the unique user-id are sent to the relying party (server), together with some attestation statement. The relying party will store the public-key ...
I've recently heard about coding based cryptography and it seems very close to the LWE assumption in that it is based on the idea that the error is hard to identify. They are both post-quantum schemes too. Is there a direct link between the two? (e.g., coding based can be seen as an instance of LWE under certain as...
What is the relation between LWE and coding based cryptography?
Some statements are expensive to prove. If I need to make proof for such kind of statement repeatly (generate new proof $\pi$ for each new verifier), I think it might be a waste of time (as well as computation resources). If there is a proof $\pi$ that I generated in a non-interactive way, can I reuse it? What problem ...
What security problem would cause if I reuse a NIZK proof?
As asked, I suppose this must have been answered before, even if not in the form asked here. The most notable AEAD schemes GCM-AES and ChaCha20-Poly1305 do this. Also, even outside AEAD, ad-hoc constructs such as CBC+HMAC also require separate keys. So: **Q**: Why use separate keys in authenticated encryption? As in...
Why in authenticated encryptions do we need separate keys for cipher and MAC?
As asked, I suppose this must have been answered before, even if not in the form asked here. The most notable AEAD schemes GCM-AES and ChaCha20-Poly1305 do this. Also, even outside AEAD, ad-hoc constructs such as CBC+HMAC also require separate keys. So: **Q1**: Why use separate keys in authenticated encryption? As i...
[Rotational Cryptanalysis of ARX][1] show that rotational probability of an ARX primitive can be computed by $p^q$ where $p$ is rotational probability of modular addition and $q$ is number of modular additions in ARX primitive. Similarly, [Rotational Cryptanalysis of ARX Revisited][2] extends it to chained additions....
Having recently learned of coding based cryptography, it seems that they key size for post-quantum security might be a lot larger than what is required by Regev PKE (in the former keys include several large matrices), which is also post-quantum secure. Is this a correct observation? Ether way - what are the pros and co...
What are the advantages of coding based cryptosytems over LWE?
What are the advantages of coding based cryptosytems over LWE (Regev)?
I have done some research on HKDF but I am still not sure about the security properties in different scenarios. Which properties are fullfilled, when **IKM** and the **salt** are random and secret, but not uniformly random? Are the output keys uniformly random? Which guarantees does HKDF give, if (a.) **IKM** or...
Is the output of HKDF uniformly distributed, when my input is not?
Is the output of HKDF uniformly distributed, if my input is not?
In [GlobalPlatform][1] specification for smartcards, I came accross this rather strange scheme: To calculate the Message Authentication Code, we take some original data (a host cryptogram and a padding), then we apply multiple chained DES calculations, as shown in the image attached. [![MAC Calculation][2]][2] ...
Why do we encrypt then decrypt then encrypt data with different keys?
I have a cypher text with I know encrypted two times with Autokey Cipher with same lengths of keys. I am following the statistical cryptanalysis in [here][1] when it is ciphered with one time with Autokey and it works but I could not come up with any cryptanalysis solution when I cipher the text with Autokey cipher but...
> If symetric cryptography is about using the same key for encryption and decryption, then what's the logic behind decrypting data with a different key than the one used to encrypt it? Operations consisting of multiple steps of applying the same cipher - in either direction - with each step taking the output of the ...
> If symetric cryptography is about using the same key for encryption and decryption, then what's the logic behind decrypting data with a different key than the one used to encrypt it? Operations consisting of multiple steps of applying the same cipher - in either direction - with each step taking the output of the ...
Suppose we have an RSA-Oracle that can encrypt and decrypt our input. The the decryption output is equal to: $ (C^d \mod N) \mod 2^n $. How can I extend the LSB oracle attack, using the using knowledge about the last n-bits of the ciphertext?
How can I extend the RSA LSB Oracle attack, to n-LSBs?
All the answers can be found in the original paper: "Cryptographic Extraction and Key Derivation: The HKDF Scheme" which is generally available. > *Which properties are fullfilled, when IKM and the salt are random and secret, but not uniformly random? Are the output keys uniformly random?* They should be close to...
How can I decrypt a message with RSA if e = 65536 and gcd(e,ϕ(N)) = 8?
How can I decrypt a message with RSA if $e = 65536$ and $gcd(e,\phi(N)) = 8$?
How can I decrypt a message with RSA if $e = 65536$ and $\gcd(e,\phi(N)) = 8$?
Suppose we have intercepted a public key exchange (via Diffie-Hellman protocol). In addition to the keys A and B, the generator g and the module p are known. Assuming that it is possible to exchange keys with client B, once it has finished the conversation with A, how can I obtain the private exponent of B? I had t...
How can I perform a one-client MITM attack in a Diffie-Hellman key exchange?