instruction stringlengths 15 30k |
|---|
I'm trying to pad some plaintext to be a multiple of 16 bytes to use it as input in AES ECB block cipher.
```
def encrypt(plaintext):
plaintext = bytes.fromhex(plaintext)
padded = pad(plaintext, 16)
cipher = AES.new(b'0'*16, AES.MODE_ECB)
try:
encrypted = cipher.encrypt(padded)
exce... |
In Gentry's [seminal paper][1] on fully homomorphic encryption (FHE), it is assumed that the **sparse subset set problem** is hard. It looks like there is a [followup paper][2] on the concrete parameter of the **subset size**, which mentions that Gentry's choice of subset size is too aggressive (e.g., 15). However, in ... |
In a lecture at my university, the following proof of correctness of RSA is given:
$m^{ed} \equiv m^{ee^{-1}} \equiv m^{1} \equiv m \ \textrm{mod} \ N$
The given reasoning is: $d$ is chosen as the multiplicative inverse of $e$, therefore this holds.
Surely, this cannot be a proof, considering that $e$ is only... |
Is this proof of RSA's correctness sufficient? |
In a lecture at my university, the following proof of correctness of RSA is given (the lecture is not mainly on cryptography or even computer science):
$m^{ed} \equiv m^{ee^{-1}} \equiv m^{1} \equiv m \ \textrm{mod} \ N$
The given reasoning is: $d$ is chosen as the multiplicative inverse of $e$, therefore this h... |
In a lecture at my university, the following proof of correctness of RSA is given (the lecture is not mainly on cryptography or even computer science):
$m^{ed} \equiv m^{ee^{-1}} \equiv m^{1} \equiv m \ \textrm{mod} \ N$
The given reasoning is: $d$ is chosen as the multiplicative inverse of $e$ in the modulo rin... |
I am just getting started with cryptography.
After doing some research, I see that people usually advice against encryption using the same key and nonce. However if a message is too long and has to be broken up into multiple packets, how exactly does this work?
Will a different key and nonce be generated for each pa... |
Why use small error vectors in LWE instead of big ones? |
0
I have two questions:
1. Can someone point me to some solution providing multi-party **{t,n}**-threshold ECDSA?
2. I imagine that such a scheme works first by creating an ECDSA private key then sharding it to **n** subkeys, **t** of which subkeys are required to generate the initial ECDSA private key. Am I r... |
There's a problem in detecting whether the sum of public key addition has crossed the cyclic group order boundary
For this example, think of public keys $Pub$ as private keys $Priv$, (private scalars), one-way converted to points on the elliptic curve.
$n$ - is the order of the group. Private keys can range from ... |
Recall that the LWE problem is the following.
---
**LWE problem.** Let $q$ be a prime, let $\chi$ be a distribution of *small* elements over $\mathbb{Z}/q$, and let $n,m$ be two integers (dimensions of vectors that we work with). Sample $s \leftarrow \chi^n$, $e \leftarrow \chi^m$ and $A \leftarrow \mathbb{Z}/q^{... |
Is LWE easy when the matrix $A$ is sparse? |
If the last $448$ bits of a [SHA-1][1] block input are known and only the first $64$ bits are unknown, is it possible to do a preimage attack using [SAT][2] solvers or something else? Or do I have to brute force all $2^{64}$ possibilities? Is this a kind of reduced SHA-1?
[1]: https://en.wikipedia.org/wiki/SHA-1... |
Verifier doesn't calculate β1(x), β2(x), β3(x), prover has to. Therefore, simply sending a F(x) is not enough, prover still has to send β1(x), β2(x), β3(x).
The optimization in the paper works as follows:\
With β1 evaluated as c, a constant, verifier can computes () themselves, which utilizes the (additive) homom... |
([Related](https://crypto.stackexchange.com/questions/45107/how-to-estimate-the-hardness-of-sis-instances))
Hi, I am interested in what the state of the art results on hardness of SIS instances are. The one I am the most familiar of (and most discussed) is to use lattice reduction, so that can be ignored. I have als... |
([Related](https://crypto.stackexchange.com/questions/45107/how-to-estimate-the-hardness-of-sis-instances))
Hi, I am interested in what the state of the art results on hardness of Short Integer Solution instances are. The one I am the most familiar of (and most discussed) is to use lattice reduction, so that can be ... |
Assume that Prover have $n$ pedersen commitments ($V_{a_1},V_{a_2},\cdots,V_{a_n}$ where $V_{a_i}=G \cdot a_i + H \cdot r_{a_i}$) of $n$ elements $a_1,a_2,\cdots,a_n$. The Prover have another element $\theta$.
The verifier is provided with these $n$ pedersen commitments ($V_{a_1},V_{a_2},\cdots,V_{a_n}$) and $\theta... |
I am interested in what the state of the art results on the hardness of the [Short Integer Solution][1] (SIS) instances are. The one I am the most familiar with (and the most discussed) is to use [lattice reduction][2], which can be ignored. I have also found the [Blum-Kalai-Wasserman][3] (BKW) algorithm, which seems t... |
According to [Jack Watling][1] & [Nick Reynolds][2],
> Ukrainian officers recalled one incident in which the Russian headquarters gave pre-emptive warning to its units of an artillery strike based on Ukrainian troops calling in a fire mission. The Ukrainian troops were communicating with Motorola radios with 256-bit... |
According to [Jack Watling][1] & [Nick Reynolds][2],
> Ukrainian officers recalled one incident in which the Russian headquarters gave pre-emptive warning to its units of an artillery strike based on Ukrainian troops calling in a fire mission. The Ukrainian troops were communicating with Motorola radios with 256-bit... |
Assume that Prover have $n$ pedersen commitments ($V_{a_1},V_{a_2},\cdots,V_{a_n}$ where $V_{a_i}=G \cdot a_i + H \cdot r_{a_i}$) of $n$ elements $a_1,a_2,\cdots,a_n$. The Prover have another element $\theta$.
The verifier is provided with these $n$ pedersen commitments ($V_{a_1},V_{a_2},\cdots,V_{a_n}$) and $\theta... |
Let $a_i=2^{u_i}$ $i=1,\ldots,n$ with $u_i$ nonnegative integers. If the values $u_i$ are distinct, and
$$
\theta=\sum_{i \in J} 2^{u_i}
$$
then the subset $J\in \{1,\ldots,n\}$ is uniquely determined by $\theta$ by the uniqueness of writing $\theta$ in base $2.$
If they are not unique, then the decomposition is... |
Is it valid? well yes, if data fails a test after transforming the data it fails the test.
Is it as good as adding more tests? Well depends on the test and on the transformation. In general I would say this has value, but less so then adding more tests.
Applying an existing test on transformed input is a subclass... |
From Introduction to Modern Cryptography, 6.2.1 Substitution-Permutation Networks
A description of an optimized attack on one round SPN
> A better attack is possible by noting that individual bits of the output depend on only part of the master key. Fix some given input/output pair (x, y) as before. Now, the ad... |
I'm [enhancing][1] the venerable `ent` randomness test suite. And I came across this idea in [On Independence and Sensitivity of Statistical Randomness Tests][2].
>"To have more confidence in a random number generator, it is advantageous to
use as many randomness tests as possible. In this part of the study, we pro... |
From Introduction to Modern Cryptography, 6.2.1 Substitution-Permutation Networks
A description of an optimized attack on one round SPN
> A better attack is possible by noting that individual bits of the output depend on only part of the master key. Fix some given input/output pair (x, y) as before. Now, the ad... |
A few months ago I decided to write my own custom prime number generator. One of the tests I use is a modified Miller-Rabin test that tests the number against base 2 and then only tests random odd numbers, instead of completely random numbers. I figured this might get better probability than 1/4^k for k rounds since if... |
Question about Modified Miller-Rabin Test? |
I'm taking 2 medium-length strings (15-20 chars) and hash them using md5 to get results like `d2ae4f4919a10958e2c603782f0ec1cc`, then recording the first 5 symbols of the hash to provide a (unique) short key. If md5 distribution is (almost) random then would the chances of a collision be 16^5 ([0-9a-f]^5) = 2/1.048.576... |
What are the chances of two 5-symbol strings derived from md5 colliding? |
I'm taking 2 medium-length strings (50-70 chars) and hash them using md5 to get results like `d2ae4f4919a10958e2c603782f0ec1cc`, then recording the first 5 symbols of the hash to provide a (unique) short key. If md5 distribution is (almost) random then would the chances of a collision be 16^5 ([0-9a-f]^5) = 2/1.048.576... |
Under the Wassenaar Arrangement and applicable export control law, symmetric cryptography of an (effective) key size of 56 bits or less is (generally) exempted from export control. I am forced to work within this constraint. My goal is to maximize security regardless. Encryption and decryption operations may take ... |
Sounds more so like a test for your tests using fuzzing.
That could inform you of how sensitive your tests are to non-statistically consequential input transformations. But, only if your transformations aren't introducing changes to the statistical properties of your sample. Because if they are, then you'd actually... |
Sounds more so like a test for your tests using fuzzing.
That could inform you of how sensitive your tests are to non-statistically consequential input transformations. But, only if your transformations aren't introducing changes to the statistical properties of your sample. Because if they are, then you'd actually... |
By going through the document: https://www.dmtf.org/sites/default/files/standards/documents/DSP0274_1.2.0.pdf
I could get that this spec will be used to verify the identify and attestation of h/w & firmware with the help of TCG_UDS spec. I want to know that do we have any other advantage of having SPDM specification? |
What is the use of Secure Protocol Data Management (SPDM)? |
why are there two random numbers involved in DSA?
I am referring to $r$ and $s$ in the Signing-Algorithm depicted below. Is it really necessary to have both, $r$ and $s$, or would it still be secure if only one of them is used?
In the Schnorr-Signature only one random number is involved, for example.
[![enter ... |
Reason for two random numbers in DSA? |
I am following the steps in LoRa Cloud in order to derive the PIN value using the Algorithm smtc0 (https://www.loracloud.com/documentation/join_service?url=derivation_schemes.html).
I don't quite understand how the DMKEY(i) = (hash[0]+i mod 256) | hash[1] | .. | hash[15] is derived. |
I've been reading about ZK-STARK. There's an example that appears in several blogs. The most detailed explanation of that specific example which I have found so far is in [this blog][1].
The description of the example (the requirement) is:
> Suppose that you want to prove that you have a polynomial $P$ such that ... |
I am trying to implement ECIES properly with X25519/HKDFwithSHA256/AES-128-GCM with Node.js crypto library. It is not clear to me how to determine the input key material (IKM) to HKDF.
Initially, I thought it is okay to directly use the shared secret generated by X25519 as the IKM.
``` js
const {diffieHellman, hkd... |
What is the correct way to use HKDF with X25519? |
Why is the signature in DSA the way it is?
I am referring to $r$ and $k$ in the Signing-Algorithm depicted below. Is it really necessary to have both, $r$ and $s$, or would it still be secure if only one of them is used?
In the Schnorr-Signature only one random number is involved, for example.
[![enter image d... |
Would either $\alpha$ or $r$ suffice as challenge?
I am aware that the signature and verification were to adapt. However, what is the motivation behind using two challenges?
[![DSA Identification Scheme According to "Introduction to Modern Cryptography" by Katz & Lindell][1]][1]
[1]: https://i.stack.imgur.... |
Why are there two Challenges in the DSA Identification Scheme? |
> So my question essentially is: why could the signature not be $s=H(m)+xr$ or $s=k^{β1}(H(m)+x)$?
Well, both those alternatives would allow an easy forgery after a single valid signature (or the public key in the second case)
For $s=H(m)+xr$, the adversary with a valid message/signature pair knows $s, H(m), r$. ... |
I am trying to implement ECIES properly with X25519/HKDFwithSHA256/AES-128-GCM with Node.js crypto library. It is not clear to me how to determine the input key material (IKM) to HKDF.
Initially, I thought it is okay to directly use the shared secret generated by X25519 as the IKM.
``` js
const {diffieHellman, hkd... |
What is the best known asymptotic/concrete complexity of modular multiplication?
Using Montgomery multiplication, if $M(n)$ is the cost of one integer multiplication of $n$ bits, then the cost is $2M(n)+o(M(n))$ (assuming comparisons and bit-shifts are $o(M(n))$. Is this the best known? |
I have read that despite strong connections between prime factorization and DLP an algorithm for the former does not imply the latter directly. But I was reading about the number field sieve and it seemed like the bottleneck was identifying smooth norms. Wouldn't an ultrafast prime factorization algorithm achieve that? |
Does the ability to factor in polynomial time give you smooth numbers in the number field sieve? |
This is not a programming question. This is to confirm whether a crypto documentation is incorrect.
I am using Rust's p384 crate. I am creating a private key from a JWK string.
In the source code, at line 85:
https://docs.rs/elliptic-curve/latest/src/elliptic_curve/jwk.rs.html#85
it says:
The `d` ECC... |
Is it wrong that in a JWK, if the "d" value is **omitted**, that JWK represents a private key? |
Is combining Elgamal algorithm and RSA algorithm for key generation and AES+RSA algorithm for encryption and decryption a novel approach? |
I was studying about how to transport keys from one HSM environment to another and it came to me that I would need some sort of transportation key so the HSM keys would be double encrypted.
How would this key be generated so it would be imported in both HSM securely? Coyld
It be used RSA or EC? Since the key could b... |
I wrote an attack based on frequency analysis to break the substitution cipher.
The code is below by Python.
...
import random
import operator
import sys
cipher = """lrvmnir bpr sumvbwvr jx bpr lmiwv yjeryrkbi jx qmbm wi
bpr xjvni mkd ymibrut jx irhx wi bpr riirkvr jx
ymb... |
I'm [enhancing][1] the venerable `ent` randomness test suite. And I came across this idea in [On Independence and Sensitivity of Statistical Randomness Tests][2].
>"To have more confidence in a random number generator, it is advantageous to
use as many randomness tests as possible. In this part of the study, we pro... |
I'm trying to understand CKKS (non bootstrappable) and I'm struggling with the encoding part.
I'm using the original paper , ["Homomorphic Encryption for Arithmetic of Approximate Numbers
"][1], also this notes ["Lattices, Homomorphic Encryption, and CKKS"][2]
and this [blog][3].
I have four questions (will have... |
Sounds more so like a test for your tests using fuzzing.
That could inform you of how sensitive your tests are to **non-statistically consequential** input transformations. But, **only** if your transformations **aren't introducing changes to the statistical properties of your sample**. Because if they are, then you... |
Sounds more so like a test for your tests using fuzzing.
That could inform you of how sensitive your tests are to **non-statistically consequential** input transformations. But, **only** if your transformations **aren't introducing changes to the statistical properties of your sample**. Because if they are, then you... |
I'm trying to understand the inhomogeneous SIS problem and I'm came across to a scenario that I don't know how to evaluate.
Let $A,B \in \mathbb{Z}_q^{n\times m}$ be two random matrixes and $u,v \in \mathbb{Z}_q^m$ be two vectors of small norm $||u||,||v||<\sigma$, such that
$A.u=B.z$.
How easy would be to find... |
Sounds more so like a test for your tests using fuzzing.
That could inform you of how sensitive your tests are to **non-statistically consequential** input transformations. But, **only** if your transformations **aren't introducing changes to the statistical properties of your sample**. Because if they are, then you... |
Sounds more so like a test for your tests using fuzzing.
That could inform you of how sensitive your tests are to **non-statistically consequential** input transformations. But, **only** if your transformations **aren't introducing changes to the statistical properties of your sample**. Because if they are, then you... |
Sounds more so like a test for your tests using fuzzing.
That could inform you of how sensitive your tests are to **non-statistically consequential** input transformations. But, **only** if your transformations **aren't introducing changes to the statistical properties of your sample**. Because if they are, then you... |
Sounds more so like a test for your tests using fuzzing.
That could inform you of how sensitive your tests are to **non-statistically consequential** input transformations. But, **only** if your transformations **aren't introducing changes to the statistical properties of your sample**. Because if they are, then you... |
Sounds more so like a test for your tests using fuzzing.
That could inform you of how sensitive your tests are to **non-statistically consequential** input transformations. But, **only** if your transformations **aren't introducing changes to the statistical properties of your sample**. Because if they are, then you... |
Sounds more so like a test for your tests using fuzzing.
That could inform you of how sensitive your tests are to **non-statistically consequential** input transformations. But, **only** if your transformations **aren't introducing changes to the statistical properties of your sample**. Because if they are, then you... |
Let's say I have a public generator $G$, an unknown, private $p$ and a public point $pG$ on an elliptic curve.
Given $pG$ it's easy to construct $-pG$ by just taking the negative. But can you construct $p^{-1}G$? |
Multiplicative inversion of a generated point? |
I am given the ECDSA public key x and y coordinates below, calculate the compressed public key in HEX:
PubKey.X : 61702053028733271054209908027052318932346644879827564097906752978487519734153
PubKey.Y : 107222915356196552656214196479588207773590978294786246589469812962187242002272
How do I find the Compressed Pu... |
How to calculate ECDSA compressed public key in HEX? |
> But can you construct $p^{-1}G$?
No, you can't if:
- You're assuming that you can compute the inverse modulo an arbitrary base point (rather than a fixed one)
- The CDH problem is hard.
That's because with an arbitrary 'inverse modulo' operation, you can compute Diffie Hellmans.
Here's one way, given ... |
Sounds more so like a test for your tests using fuzzing.
That could inform you of how sensitive your tests are to **non-statistically consequential** input transformations. But, **only** if your transformations **aren't introducing changes to the statistical properties of your sample**. Because if they are, then you... |
Sounds more so like a test for your tests using fuzzing.
That could inform you of how sensitive your tests are to **non-statistically consequential** input transformations. But, **only** if your transformations **aren't introducing changes to the statistical properties of your sample**. Because if they are, it's not... |
> Is there a standard for LFSRs to test against?
I'm afraid that if there were, there would be several incompatible ones, because for a given initial state vector and feedback polynomial the output differs according to multiple LFSR definitions.
There is only one universal convention in LFSRs: the number $n$ of b... |
Can cryptography solve this problem?
Two people are chatting, Mr. X and Ms Y. They give each other a CRC16 hash of someone's name initials and salt a random number at the end (suffix).
> Ms Y: "I love someone with the initials {53d4}".
> Mr X: "Are that person's initials {da17}?"
```
{CRC16} -> Original S... |
Can cryptography solve this problem?
Two people are chatting, Mr. X and Ms Y. They give each other a CRC16 hash of someone's name initials and salt a random number at the end (suffix).
> Ms Y: "I love someone with the initials {53d4}".
> Mr X: "Are that person's initials {da17}?"
```
{CRC16} -> Original S... |
I am a bit confused about Sponge construction and Merkle-Damgard-style ones for hashing. The only advantage I see for sponge construction is that they are secure against length extension attacks. So if the application does not mind about such an attack, Merkle-Damgard should be better, Is that the case?
My intuition i... |
I am a bit confused about Sponge construction and Merkle-Damgard-style ones for hashing. The only advantage I see for sponge construction is that they are secure against length extension attacks. So if the application does not mind about such an attack, Merkle-Damgard should be better, Is that the case?
My intuition i... |
Sounds more so like a test for your tests using fuzzing.
That could inform you of how sensitive your tests are to **non-statistically consequential** input transformations. But, **only** if your transformations **aren't introducing changes to the statistical properties of your sample**. Because if they are, it's not... |
This might be a silly question. But since more and more people simply use public blockchains as a secure ledger to store mutually agreed information to secure their high level applications, could we abstract blockchains as a secure ledger primitive that has the following properties:
- **Append-only**
- **Tamper-p... |
Can blockchain be considered a cryptographic primitive? |
Sounds more so like a test for your tests using fuzzing.
That could inform you of how sensitive your tests are to **non-statistically consequential** input transformations. But, **only** if your transformations **aren't introducing changes to the statistical properties of your sample**. Because if they are, it's not... |
I am a bit confused about Sponge construction and Merkle-Damgard-style ones for hashing. The only advantage I see for sponge construction is that they are secure against length extension attacks. So if the application does not mind about such an attack, Merkle-Damgard should be better, Is that the case?
My intuition i... |
I am a bit confused about Sponge construction and Merkle-Damgard-style ones for hashing. The only advantage I see for sponge construction is that they are secure against length extension attacks. So if the application does not mind about such an attack, Merkle-Damgard should be better, Is that the case?
My intuition i... |
I am a bit confused about Sponge construction and Merkle-Damgard-style ones for hashing. The only advantage I see for sponge construction is that they are secure against length extension attacks. So if the application does not mind about such an attack, Merkle-Damgard should be better, Is that the case?
My intuition i... |
I am a bit confused about Sponge construction and Merkle-Damgard-style ones for hashing. The only advantage I see for sponge construction is that they are secure against length extension attacks. So if the application does not mind about such an attack, Merkle-Damgard should be better, Is that the case?
My intuition i... |
I am a bit confused about Sponge construction and Merkle-Damgard-style ones for hashing. The only advantage I see for sponge construction is that they are secure against length extension attacks. So if the application does not mind about such an attack, Merkle-Damgard should be better, Is that the case?
My intuition i... |
I'm trying to read about Diffie Hellman (One to One) kind of protocols for group communication. Is Message Layer Security the state of art protocol for group encryption (not necessarily chat or application layer)? I found Tree Based Group Diffie Hellman as one such handshake algorithm for group encryption, but not sure... |
Is Message Layer Security the state of art protocol for group encryption? |
From the [PLONK paper](https://eprint.iacr.org/2019/953.pdf).
On page 19 & ahead, the permutation check is described.
In Particular on page 20, the protocol is described.
Step 5 of the check is described as
Verifier checks if for all $a \in H$
a) $L_1(a) (Z(a) -1) = 0$
b) $Z(a) f'(a) = g'(a) Z(a\cdot ... |
Why does the permutation polynomial have the First Lagrange base added to it in PLONK? |
The description of the sponge function on [Crypto.Stackexchange](https://crypto.stackexchange.com/questions/tagged/sponge) contains the following text
> The cryptographic sponge is a construction scheme for hash functions (and other symmetric primitives) based on an unkeyed permutation.
But is it possible to m... |
This question may be of no practical interest. But as a meaningful or meaningless question, can we extend the domains of the `keyspace`, `input space` and `output space` of a PRF to be defined over intervals of $\mathbb{R}$?
For instance, let $I := (a,b) \subset \mathbb{R}$ be some interval of $\mathbb{R}$, and $F: ... |
I am given the ECDSA public key x and y coordinates below, calculate the compressed public key in HEX:
PubKey.X :
> 61702053028733271054209908027052318932346644879827564097906752978487519734153
PubKey.Y :
> 107222915356196552656214196479588207773590978294786246589469812962187242002272
How do I find the Com... |
I understand that R.x is a field element.
I don't understand why in ECDSA verification ie. [FIPS 186-5 section 6.4.2 step 1][1], we check whether r is less than subgroup order.
If it has something to do with the curve (what?), then why in [BIP340 Verification step 2][2] do we check whether r is less than the fie... |
In ECDSA over K256, Why R.x should be less than the subgroup order, not field order? But in BIP340 over K256, should be less than field order |
From the [PLONK paper](https://eprint.iacr.org/2019/953.pdf).
On page 19 & ahead, the permutation check is described.
In particular, on page 20, the protocol is described.
Step 5 of the check is described as
Verifier checks if for all $a \in H$
a) $L_1(a) (Z(a) -1) = 0$
b) $Z(a) f'(a) = g'(a) Z(a\cdot... |
Why is the following protocol never used to share a symetric key between two parties ?
β is the XOR operation.
Alice has M and wants to send it to Bob.
Alice generates Kβ randomly.
Bob generates Kβ randomly.
- **Alice** has M.
- **Alice** : M -- Β·βKβ --> MβKβ
- **Alice** sends MβKβ to **Bob**.
- **Bob**... |
Instead of asymetric encryption, why not use two One-time pad? |
How fast are the fastest ones? Which ones have the most entropy? Which ones are the most practical ones?
I tried looking for answers on wikipedia and also, I tried reading papers, but I am couldnt find answers to these questions. I was looking for a recent paper that would have compared all the TRNGs but I couldnt... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.