instruction
stringlengths
15
30k
How long would it take to calculate discrete log modulo a number modulo prime of 77 digits?
I am new to cryptography and encountered the discrete log problem. Given generator $g$, a prime $p$ and an integer $b$ calculate $x$ such that: $g^x \equiv b\mod{p}$ I have read that such a problem has been solved for a $240$ digit prime. So I am thinking how much time would be required to solve such problem for ...
How long would it take to calculate discrete log modulo a number modulo prime of 78 digits?
I am new to cryptography and encountered the discrete log problem. Given generator $g$, a prime $p$ and an integer $b$ calculate $x$ such that: $g^x \equiv b\mod{p}$ I have read that such a problem has been solved for a $240$ digit prime. So I am thinking how much time would be required to solve such problem for ...
Is the following a correct formulation for the assumed worst-case hardness of $SIVP_\gamma$? - For every PPT algorithm $A$ - there exists $N$ such that for every $n\ge N$ - there exists a basis $v_1,\dots,v_n \in \mathbb{Z}^n$ such that - Pr[A produces an answer for $SIVP_\gamma$ on $v_1,\dots,v_n$] is negl...
The effort and best method to solve for $x$ the Discrete Logarithm Problem $g^x \equiv b\pmod p$ for prime $p$ depends on characteristics of $p$ beyond being a prime of a given size, and of what we know from or can guess from $x$, possibly by some tests on $b$. In the first part of this answer we consider only prime...
The effort and best method to solve for $x$ the Discrete Logarithm Problem $g^x \equiv b\pmod p$ for prime $p$ depends on characteristics of $p$ beyond being a prime of a given size, and of what we know from or can guess from $x$, possibly by some tests on $b$. In the first part of this answer we consider only prime...
Is the following a correct formulation for the assumed worst-case hardness of $SIVP_\gamma$? - For every PPT algorithm $A$ - there exists $N$ such that for every $n\ge N$ - there exists a basis $v_1,\dots,v_n \in \mathbb{Z}^n$ such that - Pr[A produces an answer for $SIVP_\gamma$ on $v_1,\dots,v_n$] is negl...
The [Index Calculus][1] algorithm solves the [Discrete Logarithm Problem][2] of finding $x$ with $g^x\bmod p=b$ given $g$, $b$, and prime $p$. Assume $g$ is a generator, so that $x$ is uniquely defined in $[1,p)$. Can Index Calculus take advantage of $x$ much smaller than $p$? If so, how low must $x$ be, and what...
Can Index Calculus take advantage of small unknown?
The [Index Calculus][1] algorithm solves the [Discrete Logarithm Problem][2] of finding $x$ with $g^x\bmod p=b$ given $g$, $b$, and prime $p$. Assume $g$ is a generator, so that $x$ is uniquely defined in $[1,p)$. Can Index Calculus take advantage of $x$ much smaller than $p$? If so, how low must $x$ be, and what...
The effort and best method to solve for $x$ the Discrete Logarithm Problem $g^x \equiv b\pmod p$ for prime $p$ depends on characteristics of $p$ beyond being a prime of a given size, and of what we know from or can guess from $x$, possibly by some tests on $b$. In the first part of this answer we consider only prime...
As far as I understand the question - you are looking for k-anonymity, don't you? In my opinion, k-anonymity is explained best in this video: [Have You Been Pwned? - Computerphile][1] Even if the password 'password123' exists in the database, you can use the [Searching Pwned Passwords By Range API][2] to send ju...
> *I know that in Active Directory environments passwords are stored in the form of hashes depending on encryption types used in the environment.* > Yes correct. --- > *I understand also that when using AES as a symmetric encryption type, the user password goes through PKDF2 first which generates a key derive...
I am trying to solve the following problem: > Alice generates a RSA key $(n, \phi)$, she shares with Bob the value $n$, and $y = g^{2^{t}}\;\text{mod}\; n$ for $g$ a generator of the group $\left(\mathbb Z/n\mathbb Z\right)^{*}$ and $t$ a very large number for example $2^{512}$. She then asks Bob for an input $z$ ($...
I have trouble in understanding the security proof of this paper([Ciphertext-Policy Attribute-Based Encryption][1]) [![the defintion of two games][2]][2] [![two hybrids][3]][3] why are these two hybrids equivalent to the modified game above? It is obvious that $M_0e(g, g)^{\alpha s}$ and $e(g, g)^{\alpha s}$ a...
Is the following a correct formulation for the assumed worst-case hardness of $SIVP_\gamma$? - For every PPT algorithm $A$ - for every $n\in\mathbb{N}$ there exists a basis $B_{n,A}=\{v_1,\dots,v_n\} \in \mathbb{Z}^n$ such that - Pr[A produces an answer for $SIVP_\gamma$ on $B_{n,A}$]$\to 0$ faster than any 1/...
I noticed that, when deriving a Classic McEliece public key from a private key, [randomness is required](https://github.com/PQClean/PQClean/blob/0cdedc78dc429ef3dd251257d9f2634e725d0536/crypto_kem/mceliece6960119f/clean/pk_gen.c#L158), and also that [this randomness is normally provided at once, during key *pair* gener...
Safety of multiple public keys per McEliece private key?
I'm attempting to build a blockchain network of IoT devices that would allow public access such that any person around the world could push data to it and there would be an immutable record of all data pledged to the network. The validity of the data or the trust of the client isn't important, but keeping a permanent l...
Best way to implement public blockchain for IoT?
The effort and best method to solve for $x$ the Discrete Logarithm Problem $g^x \equiv b\pmod p$ for prime $p$ depends on characteristics of $p$ beyond being a prime of a given size, and of what we know from or can guess from $x$, possibly by some tests on $b$. In the first part of this answer we consider only prime...
There are three entities: the *user* (prover), *the verifier*, and the *auditor*. The user sends a message to the verifier encrypted using the public key of the auditor. The goal of the user is to convince the verifier that the message is encrypted using the public key of the auditor using zero knowledge proof. Can you...
> Is X25519 and Ed25519 the same curve? No. X25519 isn't a curve, it's an Elliptic-Curve Diffie-Hellman (ECDH) protocol using the x coordinate of the curve Curve25519. Ed25519 is an Edwards Digital Signature Algorithm using a curve which is birationally equivalent to Curve25519. > Is X25519 used by ECDSA? No...
Say party A wants to prove that it has seen the entirety of a public, big message `m`. Providing the hash of `m` is not good enough, because a third party could provide A with the hash. IIUC, signing the message with A's private key would be in principe ok, but most/all signature schemes work by first hashing `m`, so t...
ElGamal-based BBS proxy re-encryption is well known, but it works on a variant of ElGamal like ($mg^r$,$g^{xr})$ not standard ElGamal ($g^r$,$mg^{xr}$). After reading the original paper, I found the authors mentioned that the proxy scheme can be extended to work with standard EIGamal encryption. But unfortunately they ...
I run an open source project implementing some RipeMD and SHA hashes, one day I got nerdy and threw together my own Sponge function. I have now tested it with the dieharder 3.31.1 test suite. Is it acceptable to use as an PRNG for cryptography? This is the results: ``` > dieharder -a -f IdeaProjects/angelos-project...
When a modulo is 0, the result of squaring or multiplying modulo will always be 0 as well. Therefore the loop could break and return 0. It can be a mean to compute faster the result of square and multiply modular exponentiation at a negligible cost of comparing the modulo to 0. Perhaps, using large prime numbers like...
Is there a benefit in cryptography to return 0 in square and mutliply algorythm when a modulo is 0?
this is my first question. I've been into classical cryptography for about a year or so, but I am getting started with cryptanalysis of these ciphers. I am trying to figure out how to reconstruct the Polybius square when cryptanalysing the Bifid. Do you all have any ideas?
How to cryptanalyze Bifid cipher?
I developed an application that stores large files. Those files are stored in plain text. Now the project owner wants those files be encrypted on storage, he wants confidentiality, integrity, and authenticity. The application is written in C# using .NET Framework 4.8. There are no authenticated encryption stream cyp...
I developed an application that stores large files. Those files are stored in plain text. Now the project owner wants those files be encrypted on storage, he wants confidentiality, integrity, and authenticity. The application is written in C# using .NET Framework 4.8. There are no authenticated encryption stream cyp...
Suppose that $k$ is the key for a block cipher. I am interested in the security of key schedules of the form $(k_0,\dots,k_n)$ where $k=k_0$ and $k_{j+1}=A_jk_j+b_j$ where each $A_j$ is some constant invertible matrix and $b_j$ is a constant vector and where $k_0=k_n$ so that the final round key is the original key. In...
I developed an application that stores large files. Those files are stored in plain text. Now the project owner wants those files be encrypted on storage, he wants confidentiality, integrity, and authenticity. The application is written in C# using .NET Framework 4.8. There are no authenticated encryption stream cyp...
this is my first question. I've been into classical cryptography for about a year or so, but I am getting started with cryptanalysis of these ciphers. I am trying to figure out how to reconstruct the Polybius square when performing a known-plaintext attack on the Bifid. Can you all help me out when it comes to this?
In the spirit of [Are curve secp256k1 ECDSA signatures distinguishable from random data?](https://crypto.stackexchange.com/questions/108743/are-curve-secp256k1-ecdsa-signatures-distinguishable-from-random-data) Are RSA signatures distinguishable from random data?
Are RSA signatures distinguishable from random data?
Yes. ### Known public key > Is it possible to distinguish, with non-negligible advantage, an RSA signature made with a key with the modulus $n$, from a random number in the range $[1,n-1]$? Yes for standard signature formats (PKCS#1v1.5, PSS). Given a public key $(n,e)$ and a putative signature $s$, calculate ...
Is there a benefit in cryptography to return 0 in square and mutliply algorithm when a modulo is 0?
Given a prime p, we let $x_0 = 1$, and $x_{i+1} = (x_i^2+1) \mod p$. Since there are only p possible values for $x_i$, so eventually these values must repeat. Assuming that $x_i$ behaves like being random, the smallest I is expected to be quite small. What will happen when we calculate $x_i$? For a while we get all...
Given a prime p, we let $x_0 = 1$, and $x_{i+1} = (x_i^2+1) \mod p$. Since there are only p possible values for $x_i$, so eventually these values must repeat. Assuming that $x_i$ behaves like being random, the smallest I is expected to be quite small. What will happen when we calculate $x_i$? For a while we get all...
I'm working on a secret sharing scheme and facing a challenge in detecting cheaters among the shareholders. Here's the setup: - There's a decoder $D$, a set of $2T$ shareholders, and a combiner/detective $C$. - Within the set of shareholders, there are $T$ known cheaters. - The combiner can provide the decoder wit...
- Sometimes if we have an attacker who's able to solve decisioanl-LWE problem then we can use them (as a sub-routine) to solve (search) LWE problem, i.e., $\mathsf{sLWE} \leq \mathsf{dLWE}$. - Conversely, sometimes if we have an attacker who's able to solve (search) LWE problem then we can use them (as a sub-routine...
Decision LWE vs Search LWE: Which one is harder?
- Sometimes if we have an attacker who's able to solve decision-LWE problem then we can use them (as a sub-routine) to solve (search) LWE problem, i.e., $\mathsf{sLWE} \leq \mathsf{dLWE}$. - Conversely, sometimes if we have an attacker who's able to solve (search) LWE problem then we can use them (as a sub-routine) ...
In the spirit of [Are curve secp256k1 ECDSA signatures distinguishable from random data?](https://crypto.stackexchange.com/questions/108743/are-curve-secp256k1-ecdsa-signatures-distinguishable-from-random-data) Are RSA signatures distinguishable from random data? What if you don't know the message? What if yo...
Given a prime p, we let $x_0 = 1$, and $x_{i+1} = (x_i^2+1) \mod p$. Since there are only p possible values for $x_i$, so eventually these values must repeat. Assuming that $x_i$ behaves like being random, the smallest I is expected to be quite small. What will happen when we calculate $x_i$? For a while we get all...
Assuming we have fixed pairing friendly elliptic curve groups $G_1$, $G_2$ and $G_T$ where for $a \in G_1$ and $b \in G_T$ it holds $e(a,b) \in G_T$. Let's put some more context and we are working in bls12-381. what is a standard way to compute $e(a,b)*r$, where r is a random bit string. Putting in another way how ...
I would like to find the fastest way to derive G for secp256k1 and secq256k1 curves, does anyone know the method, equation?
How can we derive G from P and N?
I would like to find the fastest way to derive G for secp256k1 and secq256k1 curves, does anyone know the method, equation? Edit: I'm interested to know how can this happen, when we use n/2 of secp256k1 we would get this as our x coordinate 0x3b78ce563f89a0ed9414f5aa28ad0d96d6795f9c63 However, half of the secq256k1...
Why are you bound to ZKP techniques? It seems that what you want can be achieved with straightforward signature schemes like Schnorr signatures or other Sigma protocols, but technically speaking these are [not](https://crypto.stackexchange.com/questions/35177/is-using-digital-signatures-to-prove-identity-a-zero-knowled...
Suppose that $F: \{0,1\}^n\times \{0,1\}^n\rightarrow \{0,1\}^n$ is a strongly pseudorandom permutation. Let $\hat{F}(k,x):=F(k,k)\oplus F(k,x)$. I know that $\hat{F}$ can't be a strongly pseudorandom permutation. How to prove that $\hat{F}$ is a normal PRP? This is the problem 6.20 in [the joy of cryptography](https:...
Is F(k,k) $\oplus$ F(k,x) a pseudorandom permutation?
Suppose that $F: \{0,1\}^n\times \{0,1\}^n\rightarrow \{0,1\}^n$ is a strongly pseudorandom permutation. Let $\hat{F}(k,x):=F(k,k)\oplus F(k,x)$. I know that $\hat{F}$ can't be a strongly pseudorandom permutation. How to prove that $\hat{F}$ is a normal PRP? This is the problem 6.20 in [the joy of cryptography](https:...
Do you know of a library for implementing lattice-based schemas?
Do you know any library for implementing lattice-based schemes?
is there an encryption algorithm where no key is wrong, but only one key is right? essentially, if I encrypt some data with key X, any random "key" can "decrypt" the text, but using a random key essentially returns some random rata, and not the actual data that was encrypted using the key X. The objective is esse...
1. Are there situations currently where a PRNG just will not do? Are there current situations where only a TRNG will be useful? 2. What about if someone uses a cryptographically secure PRNG? 3. What is the biggest use case (in terms of magnitude) for a TRNG that a PRNG can't solve.
Where are TRNGs an absolute need?
Some protocols employ ephemeral ECC key exchanges throughout the session. Such as the Noise framework and Signal. Is the rationale to do this simply because you can do it efficiently? To provide future secrecy wouldn't all you need is a simple hash function to ratchet the symmetric encryption key? Seems like t...
Some protocols employ ephemeral ECC key exchanges throughout the session. Such as the Noise framework. Is the rationale to do this simply because you can do it efficiently? To provide future secrecy wouldn't all you need is a simple hash function to ratchet the symmetric encryption key? Seems like the only val...
I am using the NIST suite to test the randomness of binary numbers and I have a 64KB dataset. I am confused with the results in finalAnalysisReport.txt, here are my questions, hope you can help me: 1. does the test pass only if there is no "*" in both "p-value" and "propotion" columns? example: [![enter image descri...
## The problem ## Let the following function be a collision reisistant hash function $$H=\{H_s:\{0,1\}^{2n} \rightarrow \{0,1\}^{n} \}$$ Let the following function be a PRG $$G:\{0,1\}^{n+1} \rightarrow \{0,1\}^{2n}$$ Is the following costrunction a collision resistant hash function? $$H^*(x) = H_s(G(x))$$ #...
Is the following hash function construction collision resistant?
In DES encryption, the IP table is shown. If the input given in hexadecimal is "0020 0940 0000 F008", which are the bit positions of "1" after the IP stage ? [![enter image description here][1]][1] [1]: https://i.stack.imgur.com/hs6sc.png
Let $n$ be the order of the base point $G$ then we know $$[k]G = [k \bmod n]G \tag{1}\label{1}$$ This is due to the arithmetic fact that is $a\cdot n = 0 \bmod n$ This prevents us from unnecessary finite looping if $k>n$ then we may see that we reached $G$ again and again. How many times will we see the $G$? ...
Let $n$ be the order of the base point $G$ then we know $$[k]G = [k \bmod n]G \tag{1}\label{1}$$ This is due to the arithmetic fact that is $a\cdot n = 0 \bmod n$ This prevents us from unnecessary finite looping if $k>n$ then we may see that we reached $G$ again and again. How many times will we see the $G$? ...
Issues are that 1. SRP is only useful with a trusted implementation of it on the side where the password is keyed-in. And when you start bringing that by HTTPS from the server, then two things become weak security links: - unwarranted hope that the user won't key-in the password unless the green lock is there a...
I am using the NIST suite to test the randomness of binary numbers and I have a 64KB dataset. I am confused with the results in `finalAnalysisReport.txt`. I have the following questions: 1. does the test pass only if there is no "*" in both "p-value" and "proportion" columns? example: 12 | 5 | 7 | 3 | 5 | 4 | ...
**How good is blake3 for generating pseudo-random numbers in comparison to a random oracle?** Let's say I generated a block of random bits by concatenating outputs of blake3 hash function together in the following manner: blake3(seed) || blake3(seed + 1) || blake3(seed + 2) || ... || blake3(seed + n) How g...
How good is blake3 compared to a random oracle?
**How good is blake3 for generating pseudo-random numbers in comparison to a random oracle?** Let's say I generated a block of random bits by concatenating outputs of blake3 hash function together in the following manner: blake3(seed) || blake3(seed + 1) || blake3(seed + 2) || ... || blake3(seed + n) How g...
**How good is blake3 for generating pseudo-random numbers in comparison to a random oracle?** Let's say I generated a block of random bits by concatenating outputs of blake3 hash function together in the following manner: blake3(seed) || blake3(seed + 1) || blake3(seed + 2) || ... || blake3(seed + n) How g...
1.) The pass/fail threshold is printed at the bottom of the `finalAnalysisReport.txt` file. It looks like:- > The minimum pass rate for each statistical test with the exception of > the random excursion (variant) test is approximately = x for a sample > size = y binary sequences. 45/50 is a fail. ...
1.) The pass/fail threshold is printed at the bottom of the `finalAnalysisReport.txt` file. It looks like:- > The minimum pass rate for each statistical test with the exception of > the random excursion (variant) test is approximately = x for a sample > size = y binary sequences. 45/50 is a fail. ...
**How good is blake3 for generating pseudo-random numbers in comparison to a random oracle?** Let's say I generated a block of random bits by concatenating outputs of blake3 hash function together in the following manner: blake3(seed) || blake3(seed + 1) || blake3(seed + 2) || ... || blake3(seed + n) How g...
**How good is blake3 for generating pseudo-random numbers in comparison to a random oracle?** Let's say I generated a block of random bits by concatenating outputs of blake3 hash function together in the following manner: blake3(seed) || blake3(seed + 1) || blake3(seed + 2) || ... || blake3(seed + n) How g...
**How good is blake3 for generating pseudo-random numbers in comparison to a random oracle?** Let's say I generated a block of random bits by concatenating outputs of blake3 hash function together in the following manner: blake3(seed) || blake3(seed + 1) || blake3(seed + 2) || ... || blake3(seed + n) How g...
A PRNG is a method for generating output that is unpredictable except by (1) someone who knows the secret seed (or sufficient internal state), or (2) who has more computing power than we know how to physically build. Furthermore, (3) we don't know how to prove mathematically that any of the algorithms we commonly use a...
**How good is blake3 for generating pseudo-random numbers in comparison to a random oracle?** Let's say I generated a block of random bits by concatenating outputs of blake3 hash function together in the following manner: blake3(seed) || blake3(seed + 1) || blake3(seed + 2) || ... || blake3(seed + n) How g...
**How good is blake3 for generating pseudo-random bitstrings in comparison to a random oracle?** Let's say I generated an arbitrarily long pseudo-random bitstring by concatenating outputs of blake3 hash function together in the following manner: blake3(seed) || blake3(seed + 1) || blake3(seed + 2) || ... || b...
**How good is blake3 for generating pseudo-random bitstrings in comparison to a random oracle?** Let's say I generated an arbitrarily long pseudo-random bitstring by concatenating blake3 hashes together in the following manner: blake3(seed) || blake3(seed + 1) || blake3(seed + 2) || ... || blake3(seed + n) ...
In the spirit of [Are curve secp256k1 ECDSA signatures distinguishable from random data?](https://crypto.stackexchange.com/questions/108743/are-curve-secp256k1-ecdsa-signatures-distinguishable-from-random-data) Are RSA signatures distinguishable from random data? What if you don't know the message? What if yo...
**How good is blake3 for generating pseudo-random bitstrings in comparison to a random oracle?** Let's say we generated an arbitrarily long pseudo-random bitstring by concatenating blake3 hashes together in the following manner: blake3(seed) || blake3(seed + 1) || blake3(seed + 2) || ... || blake3(seed + n) ...
Suppose that $k$ is the key for a block cipher. I am interested in the security of key schedules of the form $(k_0,\dots,k_n)$ where $k=k_0$ and $k_{j+1}=A_jk_j+b_j$ where each $A_j$ is some constant invertible matrix and $b_j$ is a constant vector and where $k_0=k_n$ so that the final round key is the original key. In...
I was reading CRYSTALS-Kyber design. They have used ```compress_q(x,d)``` to scale an element of $\mathbb{Z}_q$ to $[ 0,1,...,2^d-1 ]$. The definitions of ```compress_q(x,d)``` and ```decompress_q(x,d)``` are as follows: $$ Compress_q(x,d) = \left\lfloor (2^d/q)\cdot x\right\rceil mod^{+}2^d $$ $$ Decompress_q(x,...
i created a function in javascript that creates my `a` for the DH exchange like this: function createSecretKeyArray(){ let BigNumber = require('bignumber.js'); let numberArray = []; const multiplier = 1; for(let i=0; i<32; i++){ let randomNumber = BigNumber.random(multi...
i created a function in javascript that creates my `a` for the DH exchange like this: function createSecretKeyArray(){ let BigNumber = require('bignumber.js'); let numberArray = []; const multiplier = 1; for(let i=0; i<32; i++){ let randomNumber = BigNumber.random(multi...
> Is this algorithm secure ? No, it is not. As kelalaka pointed out, the $a$ values you get are always less than 111 bits long; we know private exponents that small can be recovered. However, it's worse than that. Your $a$ will always be in the form $2^b3^c5^d7^e11^f$, for $b,c,d,e,f$ with known (and small)...
> Is this algorithm secure ? No, it is not. As kelalaka pointed out, the $a$ values you get are always less than 111 bits long; we know private exponents that small can be recovered. However, it's worse than that. Your $a$ will always be in the form $2^b3^c5^d7^e11^f$, for $b,c,d,e,f$ with known (and small)...
I was reading CRYSTALS-Kyber design. They have used ```compress_q(x,d)``` to scale an element of $\mathbb{Z}_q$ to $[ 0,1,...,2^d-1 ]$. The definitions of ```compress_q(x,d)``` and ```decompress_q(x,d)``` are as follows: $$ Compress_q(x,d) = \left\lfloor (2^d/q)\cdot x\right\rceil mod^{+}2^d $$ $$ Decompress_q(x,...
I want to see and mathematically verify how [pseudonoise][1] (PN) sequence generated by [LFSR][2] or maximum length codes would correlate (auto-correlation and cross correlation) for seeds of varying correlation. Say, I want to generate $512$ bits of PN sequence on two sides ($A$ and $B$). To hide the possible output f...
I want to see and mathematically verify how [pseudonoise][1] (PN) sequence generated by [LFSR][2] or maximum length codes would correlate (auto-correlation and cross correlation) for seeds of varying correlation. Say, I want to generate $512$ bits of PN sequence on two sides ($A$ and $B$). To hide the possible output f...
I see a lot of references to the Davies-Meyer construction for one way compression functions. But I can't find any citation to the original paper. Does anyone have it?
I see a lot of references to the Davies-Meyer construction for one-way compression functions. But I can't find any citation to the original paper. Does anyone have it?
Bent functions are Boolean functions with maximum nonlinearity and are widely studied for their potential applications in cryptography. Let's say you want to use a simple $2$-input AND gate as a nonlinear combiner for the outputs of two [linear feedback shift registers][1]. Because a $2$-input AND gate is a bent functi...
<br> i am trying to compare some of encryption algorithms in terms of encryption duration, decryption duration, information entropy, npcr, uaci, correlation coefficients. i used lena 256x256 grayscale png image as test image, run my pyhton code on max os x i7 cpu, 8 gb ram. i found/used des, aes, simon, speck, tea,...
Actually, if you take it mathematically and choose a better range, you get faaar more complexity to strengthen the algorithm: First of all choose a single random number `r` in a range `v` between, for example, 1000 and 10000 (you can set the borders of your range different). Then take a range, for example `[r-v, r+...