instruction stringlengths 15 30k |
|---|
I'm asking if this encryption scheme would increase the security of the user's data. Here's how it would work:
1. The user would create an account (username + password). An encryption key (symmetric) is created for the user, which is then encrypted with the user's password and stored into the site's database.
2. Th... |
I'm asking if this encryption scheme would increase the security of the user's data. Here's how it would work:
1. The user would create an account (username + password). An encryption key (symmetric) is created for the user, which is then encrypted with the user's password and stored into the site's database.
2. Th... |
I'm asking if this encryption scheme would increase the security of the user's data. Here's how it would work:
1. The user would create an account (username + password). An encryption key (symmetric) is created for the user, which is then encrypted with the user's password and stored into the site's database.
2. Th... |
I'm asking if this encryption scheme would increase the security of the user's data. Here's how it would work:
1. The user would create an account (username + password). An encryption key (symmetric) is created for the user, which is then encrypted with the user's password and stored into the site's database.
2. Th... |
Many companies argue their gathering of private data with 'digitization' but I guess their real intention is most likely just gathering data. However I didn't came up with a simple idea without it.
**Use case:** Digital ticket for an event or for transportation or similar. \
We have: a ticket Seller $S$, a ticket o... |
Assume we have two uniform distributions $X=U(\mathbb{Z}_m)$ and $Y=U(\mathbb{Z}_n) \bmod m$, for $m,n \in \mathbb{N}$.
The statistical distance is defined as:
$$
\Delta(X, Y) = \frac{1}{2} \sum_{a \in \mathbb{Z}_m} | \Pr[X = a] - \Pr[Y = a] | \enspace.
$$
**Question:**
What is the statistical distance betwee... |
Modulo bias: How to compute statistical distance? |
Trying to upsolve "notsosmart - hxp CTF 2017"
https://2017.ctf.link/internal/challenge/5c8119ca-bfed-444a-968d-1cc9bff27bfb.html
This server code was given during the CTF, letting you get multiple values of n:
```python
#!/usr/bin/env python3
from random import randrange
from gmpy2 import *
from fast impo... |
Given plaintext $m$ of length $l_m = |m| > 0$ <br>
After encryption $E$
$$E(m) = c$$
we receive a cipher $c$ with an elongated length $l_c = |c| > |m|$ <br>
With decryption $D$
$$D(c) = D(E(m)) = m$$
we receive $m$ again.
The opposite does not to be always true:
$$E(D(m)) = m' \text{ } \text{ with } \text{ }... |
Is there any format-prolongation encryption? |
## Context
To learn about fully homomorphic encryption (FHE) and a new language I implemented the [Paillier](https://en.wikipedia.org/wiki/Paillier_cryptosystem) [cryptosystem](https://blog.openmined.org/the-paillier-cryptosystem/) in Go, and I thought it would be fun to apply it to the following interaction:
> A cus... |
I'm learning various cryptography protocols and use cases and since I'm developing a USB device and PC application, it would be nice to use encrypted communication.
I studied TLS 1.2 key exchange but mostly focuses on the one-way authentication only (client authenticates server), althought mTLS exists too. Aim is to... |
In my understanding, the main difference in the proof between UC and standalone model is the ability to "rewind", which appears to related to malicious security only.
So if we are only interested in semi-honest security models, do we have to distinguish UC and standalone models? |
***The following context is based on elliptic curves in short-weierstrass form y^2 = x^3 + b.***
**pls read carefully-**
I am looking for a **function/formula/algorithm** that can be applied on any curve, *say for e.g.* *y^2 = x^3 + 2* with *prime = 1097, parent group order = 1098 and subgroups = 1098, 549, 12... |
2 Can I move elements from cyclic subgroup to its cyclic parent group? |
I have a question regarding the scheme below. PSI using homomorphic encryption appears to subtract the plaintext into the ciphertext. I understand that homomorphism is maintained in operations between ciphertexts. Is homomorphism maintained even if calculated as below?
If 3. (b) operation is correct, c=[c0,c1] and ... |
I am working on a tool that uses password derived keys for AES and a selectable modes of operation **to encrypt (and later decrypt) text for storage on an insecure media**. The tool is constrained to using only the functions provided browser [SubtleCrypto][1], which are described as "low-level cryptographic primitives ... |
Does this protocol description and design look sound? |
I am working on a tool that uses password derived keys for AES and a selectable modes of operation **to encrypt (and later decrypt) text for storage on an insecure media**. The tool is constrained to using only the functions provided by the browser [SubtleCrypto][1] API, which are described as "low-level cryptographic ... |
Is there some source of standard, vetted, efficient Montgomery elliptic curves over prime field, beyond the Montgomery analogs of Ed25519 (Curve25519) and of Ed448?
Ideally I'm looking for one with cofactor 4 over some 256-bit prime field, which would give about one extra bit of security compared to Curve25519. |
Is there some source of standard, vetted, efficient Montgomery elliptic curves over prime field, beyond the Montgomery analogs of Ed25519 (Curve25519) and of Ed448? I'm looking for curves engineered for efficient computation of scalar multiplication with X/Z coordinates and Montgomery ladder.
Ideally I'm looking for... |
I try to create a valid decryption function for a modified the Goldwasser-Micali scheme
$pk = (N,p,q)$ where N is a Blum-Number $(p = q = 3 \bmod 4)$
$Enc_{pk}(m) = (-1)^{m} \cdot r^{2} \bmod N \text{ where } r \in_{R} \mathbb{Z}^{*}_{N}$
Now when I want to decrypt a ciphertext I can check if $m = 0$ by c... |
I am working on a tool that uses password derived keys for AES and a selectable modes of operation **to encrypt (and later decrypt) text for storage on an insecure media**. The tool is constrained to using only the functions provided by the browser [SubtleCrypto][1] API, which are described as "low-level cryptographic ... |
I am working on a tool that uses password derived keys for AES and a selectable modes of operation **to encrypt (and later decrypt) text for storage on an insecure media**. The tool is constrained to using only the functions provided by the browser [SubtleCrypto][1] API, which are described as "low-level cryptographic ... |
I am working on a tool that uses password derived keys for AES and a selectable modes of operation **to encrypt (and later decrypt) text for storage on an insecure media**. The tool is constrained to using only the functions provided by the browser [SubtleCrypto][1] API, which are described as "low-level cryptographic ... |
I've read the series of blog posts explaining TFHE scheme on zama.ai's website (four parts), and some things are not clear to me. I would appreciate if someone can shed some light on those topics.
1. I am not sure I understand how multiplication by a "big" constant works in practice: what are the typical values for... |
I'm sorry if the answer to this is actually simpler than it seems to me.
I'm running AES-GCM to encrypt some data keys, but I don't actually know how to go about calculating the probability of collisions for my setup, or how to derive the maximum number of plaintexts I can encrypt without violating NIST standards o... |
Calculating maximum plaintexts without birthday collisions given a probability, when the encryption scheme has multiple parts? |
Is there some source of standard, vetted, efficient Montgomery elliptic curves over prime field?
I'm looking for curves $B\,y^2\equiv x^3+A\,x^2+x\pmod p$ engineered for efficient computation of scalar multiplication with $X/Z$ coordinates and Montgomery ladder, which if I'm not mistaken requires small $A_{24}=(A+2)... |
In exploring post-quantum cryptography algorithms like Kyber and Falcon, I've come across their utilization of Discrete Fourier Transform (DFT) and Number Theoretic Transform (NTT), but I'm seeking clarity on why the choice of transform matters.
While Falcon employs DFT in its algorithm and NTT in the verification p... |
Is there some source of standard, vetted, efficient Montgomery elliptic curves over prime field?
I'm looking for curves $B\,y^2\equiv x^3+A\,x^2+x\pmod p$ engineered for efficient computation of scalar multiplication with $X/Z$ coordinates and Montgomery ladder, which if I'm not mistaken is faster with small<sup>*</... |
For SHAKE128 NIST has provided test vectors for Monte Carlo:
~~~
[Minimum Output Length (bits) = 128]
[Maximum Output Length (bits) = 1120]
Msg = c8b310cb97efa3855434998fa81c7674
COUNT = 0
Outputlen = 264
Output = fe8c476993b47b10c98303a04c6212dfb341426d748d3926140aee0a151fc80fa1
~~~
How they are they calc... |
I know this post is old, sorry for bump, but I came across an interesting example that might invalidate the accepted answer.
Consider the following hash: `H(m) = SHA1(m) | {first 10 bits of m, padded with 0 if len(m) < 10 bits}` (clamped concatenation with [SHA1][1]).
This function is clearly not first pre-image ... |
I have been going through some old lecture notes of mine and found this interesting question.
Assume we reduce the challenge space for the verifier from ℤ to ℤlog(), does security still hold for Schnorr's verifier ?
My thought process so far is that it does. While the probability of guessing a challenge is co... |
I have been going through some old lecture notes of mine and found this interesting question.
Assuming we reduce the challenge space for the verifier from $\mathbb ℤ_q$ to $\mathbb ℤ_{\log()}$, does security still hold for Schnorr's verifier?
My thought process so far is that it does. While the probability of ... |
In the case of an Elliptic curve over a GF(p) which has order n and multiplicative grouo on n-1 elements, does multiplication of an element of a subgroup of order q where q is a divisor of n-1 with a scalar s obey the cyclic property, or plaily put does an element e member of subgroup q when multiplied with s stay in t... |
In multiplicative subgroup Fp* of an elliptic curve does multiplying an element make it leave the subgroup? |
In the case of an Elliptic curve over a GF(p) which has order n and multiplicative group of n-1 elements, does multiplication of an element of a subgroup of order q where q is a divisor of n-1 with a scalar s obey the cyclic property, or plainly put does an element e member of subgroup q when multiplied with s stay in ... |
I am designing a one time password system, in which I will send the password to the user over some transport (concretely SMS). Once they receive it they will type it into the mobile app. In this way we can verify that the user has access the phone number they gave us.
I want to use a stateless time based one time p... |
I am designing a one time password system, in which I will send the password to the user over some transport (concretely SMS). Once they receive it they will type it into the mobile app. In this way we can verify that the user has access the phone number they gave us.
I want to use a stateless time based one time p... |
I am designing a one time password system, in which I will send the password to the user over some transport (concretely SMS). Once they receive it they will type it into the mobile app. In this way we can verify that the user has access the phone number they gave us.
I want to use a stateless time based one time p... |
The way I understand this question is that we have a secure PRG G: $\{0,1\}^\lambda \rightarrow \{0,1\}^{\lambda + l}$, and we want to use it to make a secure PRG G' : $\{0,1\}^\lambda \rightarrow \{0,1\}^{\lambda + l'}$ which is essentially $\{0,1\}^\lambda \rightarrow \{0,1\}^{\lambda + l + k}$ where $k$ is $l' - l$.... |
I have an interesting cipher based on matrix products that I've not seen before.
Given plaintext bytes $p\in[0,255]$, pad to a perfect square length and write into the entries of an $n\times n$ matrix $\mathbf{P}$.
Given a key $k$, apply some key derivation function $f$ to it to produce another $n\times n$ matrix... |
What weaknesses are worth investigating in this non-linear matrix cipher? |
I have an interesting cipher based on matrix products that I've not seen before.
Given plaintext bytes $p\in[0,255]$, pad to a perfect square length and write into the entries of an $n\times n$ matrix $\mathbf{P}$.
Given a key $k$, apply some key derivation function $f$ to it to produce another $n\times n$ matrix... |
looking at the linux kernel provided cipher and block cipher modes `cat /proc/crypto` my prefered mode `CTR` (counter/integer) is not provided.
However the "crazy unsafe" ECB mode - in which "all equal plaintext blocks result in equal ciphertext" - exists almost everywhere.
My question is:
Can I emultate CTR mo... |
Can ECB block cipher mode be used to implement CTR? |
Can you take a curve equation from https://safecurves.cr.yp.to and a large safe prime from existing DH parameters (for example `openssl dhparam 9000`), combine them, and result in a secure ECDH curve?
Are there some special considerations when pairing a curve equation with a prime?
The generator point would be SH... |
The following problem of my is from final exam for my online course last year; I couldn't have the time to do it, so I want to check whether my answer is correct;
Q5) Given an (entirely) random hash function $h : S \times \mathbb{N} \to [p]$, where $p$ is the number of blocks in the hash table of size $p = 2q$, we r... |
My friend in the software industry came to me with one of his "dumb boss" war stories. This particular time, his (non-technical but eager to learn) manager came to him and told him to, in the new app he was developing, not store `SHA2(password) + salt`, but `SHA2(password) + SHA3(password)` (both 256-bit). The boss cla... |
My friend in the software industry came to me with one of his "dumb boss" war stories. This particular time, his (non-technical but eager to learn) manager came to him and told him to, in the new app he was developing, not store `SHA2(password + salt)`, but `SHA2(password) + SHA3(password)` (both 256-bit). The boss cla... |
> Is there any possible benefit?
The only possible benefit I can see would be if someone picked an enormous password (one so long that there are over $2^{256}$ plausible passwords of that length). In that case, an attacker with a preimage attack against one of the hash functions couldn't get a plausible password (b... |
> - "nobody has a rainbow table for [this scheme]"
Well, this is a huge claim so needs justification. Building a rainbow table is not hard. Once you are a target, the table will be ready.
> - "salting is insecure" (no elaboration)
Salt is public, so it doesn't add to security. This is known by design. It ... |
In the case of an Elliptic curve over a GF(p) which has order n and multiplicative group of n-1 elements, does multiplication of an element of a subgroup of order q where q is a divisor of n-1 with a scalar s obey the cyclic property, or plainly put does an element e member of subgroup q when multiplied with s stay in ... |
> - "nobody has a rainbow table for [this scheme]"
Well, this is a huge claim so needs justification. Building a rainbow table is not hard. Once you are a target, the table will be ready. For example [crackstation](https://crackstation.net/) claims to have it. So once the attackers had access to the table of `SHA2... |
In the case of an Elliptic curve over a GF(p) which has order n and multiplicative group of n-1 elements, does multiplication of an element of a subgroup of order q where q is a divisor of n-1 with a scalar s obey the cyclic property, or plainly put does an element e member of subgroup q when multiplied with s stay in ... |
According to the SDH assumption, it is hard for adversary to output a pair $(c,g_1^{\frac{1}{c+\alpha}})$ given a q+2 tuple ($g_1$,$g_2$,$g_2^{\alpha}$, ...,$g_2^{{\alpha}^q}$)
Now, consider $g_1$,$g_2$,$g_2^{\alpha}$, $c_1$, and $c_2$ is given to an adversary:
1- How is it hard to calculate $g_1^{\frac{1}{c_1+\al... |
According to the SDH assumption, it is hard for an adversary to output a pair $(c,g_1^{\frac{1}{c+\alpha}})$ given a $q+2$ tuple ($g_1$,$g_2$,$g_2^{\alpha}$, ...,$g_2^{{\alpha}^q}$)
Now, consider $g_1$,$g_2$,$g_2^{\alpha}$, $c_1$, and $c_2$ is given to an adversary:
1- How is it hard to calculate $g_1^{\frac{1}{... |
My friend in the software industry came to me with one of his "dumb boss" war stories. This particular time, his (non-technical but eager to learn) manager came to him and told him to, in the new app he was developing, not store `SHA2(password + salt)`, but `SHA2(password) + SHA3(password)` (both 256-bit). The boss cla... |
When creating a SealedBox, one of the parameters which needs to be passed is an `authentication tag`:
https://developer.apple.com/documentation/cryptokit/aes/gcm/sealedbox/init(nonce:ciphertext:tag:)
I have 2 questions about this:
1. What should this authentication tag be? I have seen quite a few examples onli... |
What should be passed as the authentication tag when creating a SealedBox? And can it be made public? |
> - "nobody has a rainbow table for [this scheme]"
Well, this is a huge claim so needs justification. Building a rainbow table is not hard. Once you are a target, the table will be ready. For example [crackstation](https://crackstation.net/) claims to have it. So once the attackers had access to the table of `SHA2... |
When creating a SealedBox, one of the parameters which needs to be passed is an `authentication tag`:
https://developer.apple.com/documentation/cryptokit/aes/gcm/sealedbox/init(nonce:ciphertext:tag:)
I have 2 questions about this:
1. What should this authentication tag be? I have seen quite a few examples onli... |
We suppose that we have N consecutif numbers generated by javascript using :
math.floor(math.random()*multiple), knowing that math.random() generates consecutif xorshift128+ values.
I found that there exist a script capable of reversing this using Z3 (https://github.com/d0nutptr/v8_rand_buster) and it works perfec... |
The following problem of my is from final exam for my online course last year; I couldn't have the time to do it, so I want to check whether my answer is correct;
Q5) Given an (entirely) random hash function $h : S \times \mathbb{N} \to [p]$, where $p$ is the number of blocks in the hash table of size $p = 2q$, we r... |
We suppose that we have N consecutive numbers generated by JavaScript using: `math.floor(math.random()*multiple)`, knowing that `math.random()` generates consecutive xorshift128+ values.
I found that there exist a script capable of reversing this using Z3 (https://github.com/d0nutptr/v8_rand_buster) and it works per... |
Are security assumptions based on quantum computers too strict? Causing cryptographers to tie their own hands |
> - "nobody has a rainbow table for [this scheme]"
Well, this is a huge claim so needs justification. Building a rainbow table is not hard. Once you are a target, the table will be ready. For example [crackstation](https://crackstation.net/) claims to have it. So once the attackers had access to the table of `SHA2... |
I'm creating a PKCE [Code Verifier](https://datatracker.ietf.org/doc/html/rfc7636#section-4.1) (a random string).
Solution 1 from a [StackOverflow answer](https://stackoverflow.com/a/63336562/64904). (You can copy/paste these code examples into a browser's inspector.)
```
(function generateCodeVerifier() {
fu... |
I'm creating a PKCE [Code Verifier](https://datatracker.ietf.org/doc/html/rfc7636#section-4.1) (a random string).
Solution 1 from a [StackOverflow answer](https://stackoverflow.com/a/63336562/64904). (You can copy/paste these code examples into a browser's inspector.)
```
(function generateCodeVerifier() {
fu... |
I recently read the post [Distinguishing x25519 public keys from random?][1] and found myself wondering why, for a randomly chosen
x, the result of the function $$x^3+ax^2+x$$ is a square in 50% of cases and not in the other 50%. I understand that in a finite field with an odd prime order, a randomly chosen x is a sq... |
> Is there any possible benefit?
The only possible benefit I can see would be if someone picked an enormous password (one so long that there are over $2^{256}$ plausible passwords of that length). In that case, an attacker with a preimage attack against one of the hash functions couldn't get a plausible password (b... |
Have security assumptions based on quantum computers de facto constrained the emergence and application of many new cryptographic schemes (e.g., fully homomorphic encryption)?
It seems to me that, in addition, too many resources are spent on so-called *quantum-resistant* cryptography schemes. Even though there is c... |
While Kodlu's comment has focused on the case of basic public-key operations, I thought I would respond to
> Have security assumptions based on quantum computers de facto constrained the emergence and application of many new cryptographic schemes (e.g., fully homomorphic encryption)?
The only known fully homomorp... |
Imagine an encryption scheme defined as follows for a fixed $|k|$ and $|m| > |k|$:
- $K = \{0, 1\}^{|k|}$
- $K' = M = C = \{0, 1\}^{|m|}$
- $G: K \rightarrow K'$ is a truly random injective function
- $E(k, m) = m \oplus G(k)$
- $D(k, c) = c \oplus G(k)$
Is this construction semantically secure *without the eps... |
If a stream cipher uses a truly random, injective function, can we get rid of epsilon? |
While Kodlu's comment has focused on the case of basic public-key operations, I thought I would respond to
> Have security assumptions based on quantum computers de facto constrained the emergence and application of many new cryptographic schemes (e.g., fully homomorphic encryption)?
The only known fully homomorp... |
> Is understanding correct?
No, it comes from the requirement that $|m| > |k|$.
Consider this adversary: he picks a random key $k'$. Then, when he gets the plaintext/ciphertext pair $m, c$, he checks whether $m \oplus G(k') = c$.
If the ciphertext was generated by the encryptor, this will be true with probabi... |
What happens when the public key in an asymmetric KEM is never made public?
Can an attack on the asymmetric scheme compromise the KEM? Such as by a quantum computer.
In this instance the situation appears to be where you have an asymmetric scheme used in a symmetric fashion.
Would the security of such a KEM re... |
How to evaluate security of a KEM where the public key is never made public? |
What are your thoughts on this? I am not sure about the complications the designers of such a cryptosystem might face..? Are there obvious drawbacks with chaotic functions when using them in cryptography? |
Chaos theory combined with RSA and/or other cryptosystems? |
What are your thoughts on this? Are there any complications a designer of such a cryptosystem might face? Or, a better way to put it.. are there obvious drawbacks with chaotic functions when using them for cryptographic purposes? |
Is there a threshold signature scheme (TSS) that a quorum in a group can sign, where members can dynamically join and leave, without changing the shared group key? ECDSA and Schnorr based TSS are preferred, since the desired use case is in blockchain. |
Is there a threshold signature scheme (TSS) that a quorum in a group can sign, where members can dynamically join and leave, without changing the shared group key? ECDSA, BLS, and Schnorr based TSS are preferred, since the desired use case is in blockchain. |
Is there a threshold signature scheme (TSS) that a quorum in a group can sign, where members can dynamically join and leave, without changing the shared group public key? ECDSA, BLS, and Schnorr based TSS are preferred, since the desired use case is in blockchain. |
> Or, a better way to put it.. are there obvious drawbacks with chaotic functions when using them for cryptographic purposes?
The obvious drawback is that it adds an unclear amount of value, while appealing to notions that are frankly mostly used informally by amateurs.
As an example, RSA (when parameterized and im... |
Since this is still open and the issue keeps coming up:
**TLDR: There are lots of things in OpenSSL that implement standards including AES, but the key derivation part of `enc` is partly nonstandard** (at least by default)
First, OpenSSL has several commandline operations it calls commands (although they usually ... |
When RSA is used in a fashion where both the private key and the public key are both secret (for example, when the public key in a KEM is never leaked) could RSA be then evaluated as a symmetric cipher? And how would its security compare vs. standard symmetric ciphers such as AES?
Would a quantum computer for instan... |
How does the security of RSA compare to a symmetric cipher when both public and private keys are secret? |
I have solved a problem in [Project Euler.](https://projecteuler.net/problem=248) My solution was based on the finding the all numbers whose Euler Totient value equals to $13!$
However, while I was working on the problem, I thought that: "Can I find an algorithm that tests whether the Euler Totient of a number equal... |
I have solved a problem in [Project Euler.](https://projecteuler.net/problem=248) My solution was based on the finding the all numbers whose Euler Totient value equals to $13!$
However, while I was working on the problem, I thought that: "Can I find an algorithm that tests whether the Euler Totient of a number equal... |
Assume RSA with modulus $n$ product of large secret distinct primes $p$ and $q$, large secret encryption and decryption exponents $e$ and $d$ with $e\,d\equiv1\pmod{p-1}$ and $e\,d\equiv1\pmod{q-1}$. Without loss of generality, assume $e,d\in\bigl[0,\operatorname{lcm}(p-1,q-1)\bigr)$ so that there are no equivalent key... |
Assume RSA with modulus $n$ product of large secret distinct primes $p$ and $q$, large secret encryption and decryption exponents $e$ and $d$ with $e\,d\equiv1\pmod{p-1}$ and $e\,d\equiv1\pmod{q-1}$. Without loss of generality, assume $e,d\in\bigl[0,\operatorname{lcm}(p-1,q-1)\bigr)$ so that there are no equivalent key... |
Assume RSA with modulus $n$ product of large secret distinct primes $p$ and $q$, large secret encryption and decryption exponents $e$ and $d$ with $e\,d\equiv1\pmod{p-1}$ and $e\,d\equiv1\pmod{q-1}$. Without loss of generality, assume $e,d\in\bigl[0,\operatorname{lcm}(p-1,q-1)\bigr)$ so that there are no equivalent key... |
We possess a database containing entries, where each entry consists of a person's ID and the corresponding confidential information (a fractional number) falling within the range of 1.00 to 100.00. We are considering sending a "SELECT" query to this database, aiming to retrieve the noisy secret (obfuscated secret) asso... |
Assume H is a collision resistant and preimage resistant (unkeyed) hash function and P is a permutation.
I am interested into the collision resistance of the composed function F(x)=P(H(x)).
This [post](https://crypto.stackexchange.com/a/96474/36334) seems to say that F should be collision resistant but I can't se... |
Is the composition of a hash function with a permutation collision resistant? |
Any hash function has fixed output size but it does not mean that all values of output values are ever used. What's the term for the size of output set? Can it be calculated? How do most widely used hashes compare by that metric? For example, does SHA256 use 100% of output values? |
How is a charasteristic of hash function named? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.