instruction
stringlengths
15
30k
In a [previous question](https://crypto.stackexchange.com/q/81988/36960), I asked how to implement arbitrary s-box in side-channel-free fashion. The code I posted in the question loops over all 256 values of **a byte** to avoid timing channel, and I want to change it to loop over the values of a **word**. Before get...
First off, if you can, just use something standard like [TLS-PSK](https://en.wikipedia.org/wiki/TLS-PSK) which is designed to do exactly this and is hard to mess up. If you do want to roll your own crypto, symmetric stuff is definitely the most foolproof place to start. ### simplifying the protocol Simplest pr...
I have stuck in two problems when understanding the noise management of BFV scheme, and I don't have any idea about the two problem, help me please. Problem 1: In the `Lemma 3` , the paper demonstrates that the norm of the noise after multiplying two ciphertexts $ct_0$ and $ct_1$ is $\left \|v_{mul}\right\|$=$E\...
From the [PLONK paper](https://eprint.iacr.org/2019/953.pdf). Page 29, Round 3 [![enter image description here][1]][1] The paper doesn't explain the need or the use of the quotient challenge $\alpha$. I understand why each of the polynomials is multiplied by $\frac {1}{Z_H}$ by don't understand why the seco...
PLONK: Why is the challenge added to the quotient polynomial?
PLONK: Why are different powers of a challenge added to the quotient polynomial?
While exploring secp256k1, I came across what seems like the official definition at https://www.secg.org/, specifically in https://www.secg.org/sec2-v2.pdf. In terms of authorship, the document only contains references to the Standards for Efficient Cryptography group and Certicom (acquired by Blackberry). However, man...
What is the relationship between NIST and secp256k1?
PLONK: Why is the quotient polynomial multiplied by different powers of a challenge?
From the [PLONK paper](https://eprint.iacr.org/2019/953.pdf). Page 29, Round 3 [![enter image description here][1]][1] The paper doesn't explain the need or the use of the quotient challenge $\alpha$. I understand why each of the polynomials is multiplied by $\frac {1}{Z_H}$ but don't understand why the sec...
I try to understand of oracle padding example.Try to solve this question but I didn't figure out the answer. 7-byte message using the CBC mode of operation and the padding approach of PKCS #5 is being encrypted. The resulting ciphertext is 0x07 06 05 05 04 03 02 02 01 01, 0x08 09 0A 0B 0C 0D 0E 0F . Assume Attacker...
What is meant by "supported groups" in the section 4.2.7. "Supported Groups" of RFC 8446:<br/> /* Finite Field Groups (DHE) */<br/> ffdhe2048(0x0100), ffdhe3072(0x0101), etc:<br/><br/> Is the digits - 2048, 3072 (and groups) etc - are simply numbers of bits of the parameter _p_ (module) in DF algorythm or so...
> Is the digits - 2048, 3072 (and groups) etc - are simply numbers of bits of the parameter p (module) in DF algorythm or something else ? These names are references to the groups defined in RFC 7919; the actual digits refer to the number of bits within the prime modulus. For example, ffdhe2048 uses a 2048 bit prim...
Section 2 of RFC 8446 says about the phase "Key Exchange": … Everything after this phase is encrypted.<br/> The "Certificate" message is sent after "Key exchange" as the scheme in that section shows. So it seems to be encrypted. <br/> I am confused that I haven't found a mention on certificate encrypting in the ...
Should a certificate message of a server be encypted in TLS 1.3?
TLDR:They're private keys kept in a secure device. Whether in software or hardware is implementation dependent but the big vendors (Apple,Google) are probably storing them to be accessible only to a hardware enclave (EG:Trustzone,Apple secure enclave, Google titan) but also synced to the cloud and across devices (Googl...
Passkeys have this complicated QR code + Bluetooth dance to enroll a new device which *seems* like it ought to be securely creating a key on the device in a TPM. However the messaging around "sync" seems to suggest that while that is happening, the device key is only used to encrypt a software key which is encrypte...
Section 2 of RFC 8446 says about the phase "Key Exchange": `… Everything after this phase is encrypted`.<br/> The "Certificate" message is sent after "Key exchange" as the scheme in that section shows. So it seems to be encrypted. <br/> I am confused that I haven't found a mention of certificate encrypting in th...
I try to understand of oracle padding example.Try to solve this question but I didn't figure out the answer. 7-byte message using the CBC mode of operation and the padding approach of PKCS #5 is being encrypted. The resulting ciphertext is > 0x07 06 05 04 03 02 01 01, 0x08 09 0A 0B 0C 0D 0E 0F . ...
I try to understand a oracle Padding Oracle Attack example. I try to solve this question but I didn't figure out the answer. A 7-byte message is padded per PKCS#5 and encrypted using the CBC mode of operation. The resulting ciphertext is > 0x07 06 05 04 03 02 01 01, 0x08 09 0A 0B 0C 0D 0E 0F Assume...
I try to understand a oracle Padding Oracle Attack example. I try to solve this question but I didn't figure out the answer. A 7-byte message is padded per PKCS#5 and encrypted using the CBC mode of operation. The resulting ciphertext is<br> `0x07 06 05 04 03 02 01 01, 0x08 09 0A 0B 0C 0D 0E 0F` Assume an Attack...
Where in the TLS 1.3 record is located the sequence number?
Where in the TLS 1.3 record is the sequence number located?
I'm developing a custom Authentication Socialite ADFS Provider using OpenID Connect: [Authentication Flow](https://developers.onelogin.com/openid-connect). Since I have a TLS connection between the client App and the Authentication server that issues the token, what is the point of verifying the access token signat...
Is it necessary to verify the access token signature in the context of a TLS connection with .well-known endpoint?
What are some ways to produce a pre-determined sequence of a large number of dice rolls (on the order of 100-1000 times) using biased dice or a biased human roller given the constraints that multiple dice (more than 2) have to be projected in one go from a height of at least 1 meter onto a transparent (acrylic/glass) p...
What are some ways to produce a pre-determined sequence of a large number of dice rolls?
Suggested by [u/HolgerBier on reddit](https://old.reddit.com/r/AskEngineers/comments/13dm3on/what_are_some_ways_to_produce_a_predetermined/jjlt82a/) Is it unpredictable enough or too difficult to manipulate (as in more than a few hundred million USD) to have a sequence of blocks?
Can the last n bitcoing blocks (including transactions) be reliable enough to be used as a seed for a PRNG or an input to a crypto hash-function?
I'm looking for a mechanism for a type of cert/key signing, where multiple keys need to sign/encrypt something, and a final key/method does not product a valid confirmation unless all those keys did sign/encrypt. So maybe something like raw data action by key1 action by key2 action by keyN action by final us...
Is there a type of method where multiple keys are involved, and final key produces invalid results unless all prior keys are used?
I'm looking for a mechanism for a type of cert/key signing, where multiple keys need to sign/encrypt something, and a final key/method does not product a valid confirmation unless all those keys did sign/encrypt. So maybe something like - raw data - action by key1 - action by key2 - action by keyN - action b...
I've been studying the Schnorr signature scheme and recently came across an example that uses the STROBE protocol. In the classic version of Schnorr signatures, the challenge e is calculated as e = H(m || r), where m is the message, r is an ephemeral value, and H is a cryptographic hash function. However, in the STROBE...
How is the message considered in the STROBE-based Schnorr signature example?
Here is a guide to this is homework: 1. We are told that "a 7-byte message is padded per PKCS#5". What does that perform? Name the outcome "padded message" and note that $P$. What is the length of $P$? What byte(s) have been added to the plaintext to form $P$ according to [PKCS#5 padding][1]? Therefore, what's the las...
Here is a guide to this is homework: 1. We are told that "a 7-byte message is padded per PKCS#5". What does that perform? Name the outcome "padded message" and note that $P$. What is the length of $P$? What byte(s) have been added to the plaintext to form $P$ according to [PKCS#5 padding][1]? Therefore, what's the las...
This is `https://github.com/kokke/tiny-AES-c` The column mixing function in the AES algorithm implemented. ```c static uint8_t xtime(uint8_t x) { return ((x << 1) ^ (((x >> 7) & 1) * 0x1b)); } // MixColumns function mixes the columns of the state matrix static void MixColumns(state_t *state) { uint...
What happens if the column mixing in AES is replaced by simple XOR and subtraction?
Can the last n bitcoin blocks (including transactions) be reliable enough to be used as a seed for a PRNG or an input to a crypto hash-function?
I am acquiring binary data from a sensor and storing it in a file. As each byte of data is read from the sensor, it goes into a SHA256 hash. The length of the acquired data stream varies from one session to another. It is possible that an individual sample having a binary value of `10000000` could be encountered in...
What happens if a padding sequence is encountered at the end of input for SHA-256?
I understand the need for padding in MD5 and other hash algorithms such as SHA-1, SHA-256, SHA-384 and SHA-512. But why do we append the message length to the padding? I heard it strengthens the hash but how? Please provide an example if possible and how it applies to this quote: > The inclusion of the length-blo...
I am curious that how to deal with the message or randomness overflow in pedersen commitment? <br/> For more details: <br/> For ec pedersen commitment: The two generators are G and H <br/> two messages and randomness are $m_1$, $m_2$, $r_1$, $r_2$ <br/> so the two Pedersen commitments are $Gm_1+Hr_1$ and $Gm_2+Hr_2$...
I am curious that how to deal with the message or randomness overflow in pedersen commitment? <br/> For more details: <br/> For ec pedersen commitment: The two generators are G and H. <br/> Two messages and randomness are $m_1$, $m_2$, $r_1$, $r_2$, so the two Pedersen commitments are $Gm_1+Hr_1$ and $Gm_2+Hr_2$ <br...
Question - I seek a _quantitatively better_ proof of theorem 13.11 in Katz and Lindell's [Introduction to Modern Cryptography (3<sup>rd</sup> edition)][1] (or nearly equivalently, theorem 19.1 in Dan Boneh and Victor Shoup's freely available [A Graduate Course in Applied Cryptography][2]). The proof is about the Schn...
I am curious that how to deal with the message or randomness overflow in Pedersen commitment? <br/> For more details: <br/> For EC Pedersen commitment: The two generators are G and H. <br/> Two messages and randomness are $m_1$, $m_2$, $r_1$, $r_2$, so the two Pedersen commitments are $Gm_1+Hr_1$ and $Gm_2+Hr_2$ <br...
How to deal with Pedersen commitment message or randomness overflow?
For EC Pedersen commitment: The two generators are G and H. Two messages and randomness are $m_1$, $m_2$, $r_1$, $r_2$, so the two Pedersen commitments are $Gm_1+Hr_1$ and $Gm_2+Hr_2$. When adding these two, I got a new Pedersen commitment as $G(m_1+m_2)+H(r_1+r_2)$ with message $m_1+m_2$ and randomness $r_1+r_2$....
what is "Auxiliary information" in context of cryptographic accumulators?
I have been reading a paper about accumulators (title of the paper: ["Universal Accumulators with Efficient Nonmembership Proofs"][1]). It mentions "auxiliary information" about a function, which I couldn't quite understand. Can anyone explain the term in this context? [1]: https://www.cs.purdue.edu/homes/ninghui/pa...
What is "auxiliary information" in context of cryptographic accumulators?
ChaCha20 also provides 256-bit encryption, i.e, 2^256 possibilities of keys. But ChaCha20 is very fast, I think it provides at most 2^256 multiplied by decrypting time. 256-bit AES provides 254-bit security due to biclique attack, i.e., 2^254 multiplied by decrypting time. Since AES is slower than ChaCha20 (decrypting ...
If ChaCha20 only has 128 bits, is it secure?
> Assume that ChaCha20 only has 128-bit, is it secure? Let us think this through; suppose that our best attack is trying each key individually (which, as far as we know, is true), and that our theoretical attacker would be happen if he succeeds with probability 1% - to reach that goal, he would need to test $2^{128}...
Here is a guide to this is homework: 1. We are told that "a 7-byte message is padded per PKCS#5". What does that perform? Name the outcome "padded message" and note that $P$. What is the length of $P$? What byte(s) have been added to the plaintext to form $P$ according to [PKCS#5 padding][1]? Therefore, what's the las...
Here is a guide to this is homework: 1. We are told that "a 7-byte message is padded per PKCS#5". What does that perform? Name the outcome "padded message" and note that $P$. What is the length of $P$? What byte(s) have been added to the plaintext to form $P$ according to [PKCS#5 padding][1]? Therefore, what's the las...
The terms "average-case", "worst-case" hardness are quite confusing. 1. What do they mean when they say certain problems (like lattices) have an average-case to worst-case relationship? Do they mean there is a polynomial reduction between two case of the problem? Because polynomial reductions are of ou...
I am wondering whether there are any current challenge problems for Discrete Logarithms. Specifically in $\mathbb{Z}_p^\ast$ as well as in elliptic curve groups. It turns out CERTICOM still has some ECC challenges, and it seems 131 bits is the smallest unsolved case. See the link [here][1]. One concern I have...
For discrete log over $\mathbb{Z}_p^{*}$, as of 2019, a discrete logarithm was computed over a 795 bit safe prime [1]. In practice, no one uses generic discrete logarithm algorithms (such as pollard rho or baby step giant step), because there are more efficient algorithms (index calculus attacks or variants of the ...
The most questions are answered by the link in the comment of @EugeneStyer. But one question is not addressed well there. >why don't we consider best-case or simplest-case? Why there is no attention to simple-case of a problem and its dangers? It has to do with **probability**. What is the simplest-case for th...
The most questions are answered by the link in the comment of @EugeneStyer. But one question is not addressed well there. >why don't we consider best-case or simplest-case? Why there is no attention to simple-case of a problem and its dangers? It has to do with **probability**. What is the simplest-case for th...
Forget about cryptography and anything to do with secrets. Let's talk about sorting, a classic problem where we compare the efficiency between algorithms. A problem is a specification of how each input maps to an output. For sorting, given a finite list of integers, return the sorted permutation of it. A problem doe...
I am studying TLS handshaking by example a program [tlse](https://github.com/eduardsui/tlse/blob/master/tlse.c), which uses libtomcrypt library.<br/>I see that in line 5236 (link above) the program call libtomcrypt procedure `ecc_ansi_x963_export(context->ecc_dhe, out, &out_len)` .<br/>I see that the procedure forms a ...
The section 4.4.1 of the RFC [8446](https://www.ietf.org/rfc/rfc8446.txt) tells about Transcript-Hash.<br/> My questions about the transcript-hash are: 1) Must a server hash (a) all **own** sent messages, enumerate in the section 4.4.1, or (b) **own sent and received** from client ? 2) Must a server send the calcula...
**Edit:** *Thanks for the answer and comment. Am I right in concluding that for ECDLP the subexponential algorithms based on NFS and the like don't apply (Galbraith's chapter linked in the paper mentioned in the answer refers to **hyperelliptic** curves) while at least one of the implemented attacks in the comments...
The terms "average-case", "worst-case" hardness are quite confusing. 1. What do they mean when they say certain problems (like lattices) have an average-case to worst-case relationship? Do they mean there is a polynomial reduction between two case of the problem? Because polynomial reductions are of ou...
Forget about cryptography and anything to do with secrets. Let's talk about sorting, a classic problem where we compare the efficiency between algorithms. A problem is a specification of how each input maps to an output. For sorting, given a finite list of integers, return the sorted permutation of it. A problem doe...
For discrete log over $\mathbb{Z}_p^{*}$, as of 2019, a discrete logarithm was computed over a 795 bit safe prime [1]. In practice, no one uses generic discrete logarithm algorithms (such as pollard rho or baby step giant step) against the DLP over $\mathbb{Z}_p^*$, because there are more efficient algorithms (inde...
This arose from a recent [question's](https://crypto.stackexchange.com/q/106502/23115) comment. Why is translating to Welsh less secure than encrypting the King's English?
Why does "hex encoding of the plaintext before encryption", "harm security"?
I am wondering whether there are any current challenge problems for Discrete Logarithms. Specifically in $\mathbb{Z}_p^\ast$ as well as in elliptic curve groups. It turns out CERTICOM still has some ECC challenges, and it seems 131 bits is the smallest unsolved case. See the link [here][1]. One concern I have...
Good day, I've a question regarding Gaussian distribution properties over lattices : Let $\mathcal{L}$ := $ \mathcal{L}(\,b_{1}$,..., $b_{m})$ be a lattice over $\mathbb{R}^{n}$, and $W$ = span($b_{1}$,..,$b_{m}$)$^{\perp}$. define $\pi_{W}$ to be the orthogonal projection onto $W$. If i sample a vector b fr...
I'm new to cryptography and I can't figure out the difference between message-length filed and message length. I'm not sure what is the correct value of SHA-512 message-length filed..?
I want to ask about the confidence interval in NIST SP 800 22 so I can make sure I got it right. When evaluating the randomness of many binary strings, for example 1000 binary strings. In the [NIST SP 800 22 document][1] section 4.2.1, it is recommended to calculate the confidence interval given by the formula: $\hat{p...
I'll read: > In [SHA-512,][1] what's the difference between message-length field and message length? The message-length field is a 128-bit bitstring, when the message length is a (non-negative) integer $\ell$ in range $[0\ldots2^{128})$. The integer $\ell$ is the size of the message in bits, thus 3967 for a 3967...
Suppose it is an Army Enigma I. Choose a reflector from UKW-B or UKW-C and choose three rotors from I, II, III, IV and V. For each of the 120 reflector/rotors permutations, there are 17,576 starting indicator positions to test. Menu ---- Ciphertext $\tt RRHKJ \ KNJXE \ UWNFO \ T$ has 16 characters. Crib $\tt WET...
> Must a server hash (a) all own sent messages, enumerate in the section 4.4.1, or (b) own sent and received from client ? The transcript hash (or hashes) is the hash of all messages exchanged so far. So, the server and the client compute these transcript hashes in the prescribed way. Loosely speaking, the transcrip...
How did the VB6 PRNG generate a byte output from a specific seed, and how to replicate in C?
In the IETF Draft [Deterministic ECDSA and EdDSA Signatures with Additional Randomness](https://datatracker.ietf.org/doc/draft-irtf-cfrg-det-sigs-with-noise/), methods had been specified to seed RNG deterministically with external input, to securely obtain a nonce for use in signing formula. However, the draft seem to ...
What's the current status of development of hedged ECDSA and EdDSA?
I am currently writing a paper in my old age for the fun of it. I feel that the enigma machine had gotten a bad wrap for some of its flaws. I decided to write a machine simulation to see if I can correct some of these flaws. The part of the "not being able to encode a character unto itself" isn't as large a flaw as fir...
Enigma Questions: Eliminating the can't encode to itself flaw? Maybe not a flaw
In the steps of “Append the padding bits” in SHA-512 system, the message is padded so that its length is congruent to 896 mod 1024. I'm new to cryptography and I can't figure out the difference between message-length filed and message length. I'm not sure what is the correct value of SHA-512 message-length filed..?
In the steps of “Append the padding bits” in SHA-512 system, the message is padded so that its length is congruent to 896 mod 1024. I'm new to cryptography and I can't figure out the difference between message-length filed and message length. I'm not sure what is the correct value of SHA-512 message-length filed..? ...
In the steps of “Append the padding bits” in SHA-512 system, the message is padded so that its length is congruent to 896 mod 1024. I'm new to cryptography and I can't figure out the difference between message-length field and message length. I'm not sure what is the correct value of SHA-512 message-length field..? ...
> (In [SHA-512,][1]) what's the difference between message-length field and message length? The message-length field is a 128-bit bitstring, when the message length is a (non-negative) integer $\ell$ in range $[0\ldots2^{128})$. The integer $\ell$ is the size of the message in bits, thus 3967 for a 3967-bit messa...
> (In [SHA-512,][1]) what's the difference between message-length field and message length? The message-length field is a 128-bit bitstring, when the message length is a (non-negative) integer $\ell$ in range $[0\ldots2^{128})$. The integer $\ell$ is the size of the message in bits, thus 3967 for a 3967-bit messa...
> (In [SHA-512,][1]) what's the difference between message-length field and message length? The message-length field is a 128-bit bitstring, when the message length is a (non-negative) integer $\ell$ in range $[0\ldots2^{128})$. The integer $\ell$ is the size of the message in bits, thus 3967 for a 3967-bit messa...
As I am studying ordinary (non-supersingular) binary elliptic curves in the Guide to ECC book by Hankerson (Section 3.1, page 81), for point doubling, the equations presented in the book are: $x_3 = \lambda^2 + \lambda + a = {x_1}^2 + \frac{b}{{x_1}^2}$ $y_3 = {x_1}^2 + (\lambda + 1) x_3 $ $\lambda = x_1 + y...
There is more to a question like this than just has the algorithm been broken. The other and equally important question is how was the encryption algorithm implemented? Who implemented it and was it reviewed to ensure the implementation was good? Getting crypto right is very difficult and making errors is very common, ...
There is more to a question like this than just has the algorithm been broken. The other and equally important question is how was the encryption algorithm implemented? Who implemented it and was it reviewed to ensure the implementation was good? Getting crypto right is very difficult and making errors is very common, ...
I'm learning provable security, and I'm a bit confused with the concept of reduction. So, here's my understanding: to prove a protocol/scheme/generic construction is at some level of security, there are three components: the scheme itself **--->** a security proof **--->** the scheme achieves a security propert...
As learning to be an electronic engineer, My lecture has requested, based on the original Xtea, to develop the FPGA solution to run 128-bit block size and 128-bit key size cryptography. I have decided to solve it by device the 128-bit block to 4 32-bit blocks and running as double encryption. I wanted to make sure math...
There's a strong notion of ZK, which guarantees that no information will be disclosed at all. As you mentioned, the Schnorr protocol is not full ZK. This means, that a bit of information is leaked with each created transcript. As an example of practical consequence, the protocol loses a property of deniability: n...
As learning to be an electronic engineer, my lecturer has requested, based on the original Xtea, to develop the FPGA solution to run 128-bit block size and 128-bit key size cryptography. I have decided to solve it by dividing the 128-bit block into four 32-bit blocks and running as double encryption. I wanted to make s...
Suppose it is an Army Enigma I. Choose a reflector from UKW-B or UKW-C and choose three rotors from I, II, III, IV and V. For each of the 120 reflector/rotors permutations, there are 17,576 starting indicator positions to test. Menu ---- Ciphertext $\tt RRHKJ \ KNJXE \ UWNFO \ T$ has 16 characters. Crib $\tt WET...
I'm new to this, however. I do not believe the stated flaw, is really a large contributing factor to enigma being broken as is it made out to be. Information about the process was the biggest flaw. For example, if a cryptologist didn't know that the device will not encrypt an input character to itself, where could they...
Suppose it is an Army Enigma I. Choose a reflector from UKW-B or UKW-C and choose three rotors from I, II, III, IV and V. For each of the 120 reflector/rotors permutations, there are 17,576 starting indicator positions to test. Menu ---- Ciphertext $\tt RRHKJ \ KNJXE \ UWNFO \ T$ has 16 characters. Crib $\tt WET...
Summary: The operation of the Enigma Bombe is well documented. I manage to use it and a candidate checking machine to recover the plugboard pairs and the ring setting for the fast rotor. I struggle to recover ring settings for the slow and the middle rotors. Question: Where can I find out more technical details on t...
Suppose it is an Army Enigma I. Choose a reflector from UKW-B or UKW-C and choose three rotors from I, II, III, IV and V. For each of the 120 reflector/rotors permutations, there are 17,576 starting indicator positions to test. Menu ---- Ciphertext $\tt RRHKJ \ KNJXE \ UWNFO \ T$ has 16 characters. Crib $\tt WET...