instruction
stringlengths
15
30k
ECDSA and EdDSA both require the generation of a single-use value. Are there any elliptic curve signature schemes in existence which don't require nonce and maintain the usual security strength equal to that offered by the curve?
Is it safe (or optimal) to use a BCrypt hash directly as the key to an HMAC-SHA256? I ask because all the BCrypt hashes I will use contain the same salt, version, and cost, so the first 29 characters of the hashes will all look the same, e.g. `"$2a$06$/H63GWnve78WGVBSDouFTO"`. I'm not comfortable with this much known s...
Safe to use a BCrypt hash directly as a key to HMAC-SHA256?
I have a Windows 10 laptop with an algorithm that creates a random number using the PRNG CryptGenRandom. According to [Wikipedia][1]: > Because CryptGenRandom is the de facto standard CSPRNG in Win32 environments, its security is critical for Windows users. However, > The specifics of CryptGenRandom's algorith...
In Kyber-CCA-KEM, there's a step in the Fujisaki-Okamoto transformation, where decryption failure results in a random shared secret returned from the decapsulation call. I have a C language project currently implementing RSA-OAEP and ECDH, and I haven't reserved a PRNG parameter for the decryption interfaces, since...
Imagine a large array (Megabytes) that is virtually empty, i.e. contains 0 in almost all locations. But also imagine there's 1000 pseudo random locations that contain a pseudo random byte. There is no correlation between bytes nor locations. So on average, there is a random byte > 1000 bytes apart. Then the entire arr...
Is there a way to short circuit (speed up) hashing a large but sparse array?
> Can this statistical predictability be leveraged for speed? Well, both SHA-256 and SHA-512 apply 'message scheduling' to expand the 64/128 [1] byte message block to a 256/640 byte sequence (or 64/80 word sequence); this message scheduling isn't that expensive, but it isn't free. If you were to check the next bloc...
- Say we have a very limited password space with only a 4 digit PIN, so only 10000 PIN possibilities. - Say also that the attacker has access to the stored form of the PIN. Can breaking the PIN be made reasonably difficult by storing the PIN in a way that makes the reverse computation impossible, as well as the sto...
(Cryptographically and hash/checksum wise consider me a rookie, as I'm rather just using algorithms.) While there are many names not all of them are explained - I tried searching for the meaning of a couple of names, but found neither an explanation in Wikipedia articles (multiple, like English, German and French), nor...
I am currently playing around with some of the Python FHE libraries and found out that, e.g. TenSeal (SEAL) is able to perform "only" 8 ciphertext-ciphertext multiplications on the same ciphertext (8x1 Vector) (c1 = c1*c2 in a loop) before the noise threshold is surpassed and decryption fails. The parameters I set f...
A best attempt at answering my own question, provided for archival purposes. **Preliminary research insights:** - Regarding [ERT12][1], without fully understanding how to translate the findings: **A.** If the problem is massaged into one without sub-grid constraints, it can be represented by $(|X| \times 2...
You can achieve this with Pedersen commitments, which are additively homomorphic. You need to prove: 1. That the commitments sum to $x$ 2. That each commitment is to either $0$ or $x$. An EC Pedersen commitment is of the form $C=aG+bH$, where $a$ is the value being committed to, and $b$ is a uniformly randoml...
You can achieve this with Pedersen commitments, which are additively homomorphic. You need to prove: 1. That the commitments sum to $x$ 2. That each commitment is to either $0$ or $x$. An EC Pedersen commitment is of the form $C=aG+bH$, where $a$ is the value being committed to, and $b$ is a uniformly randoml...
You can achieve this with Pedersen commitments, which are additively homomorphic. You need to prove: 1. That the commitments sum to $x$ 2. That each commitment is to either $0$ or $x$. An EC Pedersen commitment is of the form $C=aG+bH$, where $a$ is the value being committed to, and $b$ is a uniformly randoml...
I now understand the initial key from all the round keys will be the original 4x4 block for 128-bit keys, but I do not know how it would work for something else, like AES-256 or 192. Would it be that you copy the rest of the key and put it into the second block, but what would you do with the third and fourth columns? ...
since I already have plaintext and ciphertext why would I need the key for? what purpose would that serve?
If meet in the middle is a known plaintext attack, and i already have both plaintext and ciphertext, why would i need to find the key?
For a graphical description of the algorithm Click [here](https://www.youtube.com/watch?v=H2LlHOw_ANg "key expansion starts after 2:37"). Key expansion is described for 128 bits in this video. The algorithm's block size is same, 128-bits, for all key-lengths 128, 192, and 256. So for each round a round key of 128 bit...
You can achieve this with Pedersen commitments, which are additively homomorphic. You need to prove: 1. That the commitments sum to $x$ 2. That each commitment is to either $0$ or $x$. An EC Pedersen commitment is of the form $C=aG+bH$, where $a$ is the value being committed to, and $b$ is a uniformly randoml...
Edit: New, much simpler idea: Each of the $n$ commitments are of the form $C_i=a_iG+b_iH$, where $a_i$ is the value being committed to, and $b_i$ is the uniformly random blinding factor. First, calculate a challenge scalar $r_i$ for each commitment $C_i$. This can be done using an extendable-output function or HK...
Edit: New, much simpler idea: Each of the $n$ commitments are of the form $C_i=a_iG+b_iH$, where $a_i$ is the value being committed to, and $b_i$ is the uniformly random blinding factor. First, calculate a challenge scalar $r_i$ for each commitment $C_i$. This can be done using an extendable-output function or HK...
Edit: New, much simpler idea: Each of the $n$ commitments are of the form $C_i=a_iG+b_iH$, where $a_i$ is the value being committed to, and $b_i$ is the uniformly random blinding factor. $G$ and $H$ are generator points, arbitrarily and fairly chosen so that $g$ such that $G=gH$ is unknowable (the EC discrete log...
This is a question based on hypothetical scenarios, please bear with me. Consider the two widely implemented (in the real world) public key cryptosystems (PKC), RSA and Elliptic Curve Cryptography. What is the relative penetration of the two approaches to PKC [I am being vague, and it is enough for the answer to...
(Cryptographically and hash/checksum wise consider me a rookie, as I'm rather just using algorithms.) While there are many names, not all of them are explained - I tried searching for the meaning of a couple of names, but found neither an explanation in Wikipedia articles (multiple, like English, German and French), no...
Edit: New, much simpler idea: Each of the $n$ commitments are of the form $C_i=a_iG+b_iH$, where $a_i$ is the value being committed to, and $b_i$ is the uniformly random blinding factor. $G$ and $H$ are generator points, arbitrarily and fairly chosen so that $g$ such that $G=gH$ is unknowable (the EC discrete log...
Might be a bit weird but interesting scenario: I have a telegram bot and I need to authenticate users but I don't want to store any user data(at least openly). So here's a breakdown: 0) I need to prove that the user has access to the bot. So there's a "timeframe" variable, an extra piece of information which might ...
Might be a bit weird but interesting scenario: I have a telegram bot and I need to authenticate users but I don't want to store any user data(at least openly). So here's a breakdown: 0) I need to prove that the user has access to the bot. So there's a "timeframe" variable, an extra piece of information which migh...
I want to create a shared secret from a short string (e.g. a password) which should be easy to decrypt also in the long term. Unfortunately, I have quite a hard time to make the different tools work with each other (e.g. encrypt with [ssss](http://point-at-infinity.org/ssss/) and decrypt using an online tool like [that...
Edit: New, much simpler idea: Each of the $n$ commitments are of the form $C_i=a_iG+b_iH$, where $a_i$ is the value being committed to, and $b_i$ is the uniformly random blinding factor. $G$ and $H$ are generator points, arbitrarily and fairly chosen so that $g$ such that $G=gH$ is unknowable (the EC discrete log...
Each of the $n$ commitments are of the form $C_i=a_iG+b_iH$, where $a_i$ is the value being committed to, and $b_i$ is the uniformly random blinding factor. $G$ and $H$ are generator points, arbitrarily and fairly chosen so that $g$ such that $G=gH$ is unknowable (the EC discrete log assumption). This means that ...
Each of the $n$ commitments are of the form $C_i=a_iG+b_iH$, where $a_i$ is the value being committed to, and $b_i$ is the uniformly random blinding factor. $G$ and $H$ are generator points, arbitrarily and fairly chosen so that $g$ such that $G=gH$ is unknowable (the EC discrete log assumption). This means that ...
I am trying to solve another CTF challenge. The challenge consists in trying to exploit an oracle that decrypts any hex text we send (see code below). I am kind of stuck on this one as this is not a classical challenge, since the decrypted text is not displayed. My guess would be one should exploit the fact that except...
I have been looking for benchmarks on the precomputation phase of PLONK (https://eprint.iacr.org/2019/953.pdf), but found none. Is there a resource where one can get a feel for this? Specifically, I am trying to estimate how big of a burden it is to update the setup with new randomness for different sizes of the cir...
What is the running time of precomputation for the PLONK zk-SNARK?
I have been looking for benchmarks on the precomputation phase of PLONK (https://eprint.iacr.org/2019/953.pdf), but found none. Is there a resource where one can get a feel for this? Either in terms of CPU cycles or in terms of asymptotic complexity. Specifically, I am trying to estimate how big of a burden it is to...
It cannot be "frequent" because that implies $H$ is not really 256-bit. Are there statistical or mathematical bounds on this? Finding the inverse is computationally difficult, but what matters here is existence.
Let $X$ be the set of 256-bit strings and $x \rightarrow H(x)$ a map on this set, where $H$ is SHA-256. How often is $H^-1(y)$ empty?
I know the standard algorithms for D-log. Pollard-rho, Baby-step-big-step, Pollig-Hellman, index calculus, etc. I'm looking for fast algorithms to find a relation for the generalized discrete logarithm: $$\prod p_i^{a_i} = 1 $$ That is, given $p_i$, find some non-trivial $a_i$ for the above relation. What a...
Fast Algorithms for generalized Discrete Logarithm?
I'm new to cryptography and I was trying to find key to an intercepted vigenere ciphertext using ciphertext-only attack, I'm following book "cryptography and network security" by Forouzan. The book introduced some complicated formulas for finding Mutual Index of Coincidence but I didn't get it. This was mentioned in ...
I'm new to cryptography and I was trying to find key to an intercepted vigenere ciphertext using ciphertext-only attack, I'm following book "cryptography and network security" by Forouzan. The book introduced some complicated formulas for finding Mutual Index of Coincidence but I didn't get it. This was mentioned in ...
I'm new to cryptography and I was trying to find key to an intercepted vigenere ciphertext using ciphertext-only attack, I'm following book "cryptography and network security" by Forouzan. The book introduced some complicated formulas for finding Mutual Index of Coincidence but I didn't get it. This was mentioned in ...
Are you looking for an algorithm that's faster or slower? For a cyclic group I don't expect this to be faster than standard discrete log. If you have an algorithm that can solve this generalized discrete log in complexity $f(n,k)$ where $n$ is the order of the group and $k$ is the number of generators you have, y...
Note that this isn't really a cryptography question; it's about how various kinds of data representations work. The data in this case happens to be cryptographic, but the same or similar methods, operations, and issues can occur with any kind of data. > In this link, it says ed25519 has a length of 64 characters ...
I am trying to solve another CTF challenge. The challenge consists in trying to exploit an oracle that decrypts any hex text we send (see code below). I am kind of stuck on this one as this is not a classical challenge, since the decrypted text is not displayed. My guess would be one should exploit the fact that except...
I am trying to solve another CTF challenge. The challenge consists in trying to exploit an oracle that decrypts any hex text we send (see code below). I am kind of stuck on this one as this is not a classical challenge, since the decrypted text is not displayed. My guess would be one should exploit the fact that except...
I am working on an investigation on TLS 1.3. I've came across an article of [qacafe][1] where they shared a TLS 1.3 handshake sequence. [Wireshark capture][2]. In this capture you see that in the Client Hello a *key_share* is being send where it is "guessing" which cypher suite to use. This saves some bytes. by not ha...
If we have a scheme for inner product predicate encryption (IPPE), then can we claim that we already have designed an attribute based encryption (ABE) scheme; So we do not need to design an ABE again. I mean, is IPPE more general than ABE?
Which one is more general, attribute based encryption or inner product predicate encryption?
1. If we have a scheme for inner product predicate encryption (IPPE), then can we claim that we already have designed an attribute based encryption (ABE) scheme; So we do not need to design an ABE again. I mean, is IPPE more general than ABE? 2. What about predicate encryption (PE)? I think PE is more general than A...
Suppose I have some ZK proofs that were turned non-interactive using Fiat-Shamir heuristic. So I need to generate the challenge value deterministically using some data shared between the prover and the verifier. Different proofs require different challenges of varying size, so using a fixed-output hash is not very conv...
What is the difference between a seeded RNG and an XOF hash?
The short answer is that LLL (or more generally, lattice reduction methods) is useful when you can convert your problem into finding a small linear combination of known vectors. Let's take your example and make it concrete. Let $m = 2^{64}$, $a = 7244019458077122845$, $b=1$, and the we have a generator that outputs ...
> Should we **(a)** sign-then-encrypt, **(b)** encrypt-then-sign[, or **(c)** do something else]? The answer is: **(c)**, do something else. In specific, it's [safest][1] to use authenticated encryption (**AE**) in *encrypt-then-mac* mode with associated data (**AEAD**), as well as to hash the *target* with associat...
Frequently, we want to send messages that are (a) encrypted, so passive attackers can't discover the plaintext of the message, and (b) signed with a private-key digital signature, so active attackers can't make Alice think that a message came from Bob when it didn't. Is it better to 1) generate the digital signatu...
Let $F$ be a pseudorandom function (length preserving). We have the following scheme: To encrypt $ m \in \{0,1\}^{2n}$, parse m as $m_1||m_2$ with $|m_1|=|m_2|$, then choose $r\leftarrow\{0,1\}^n$ and output the ciphertext $(r, m_1\oplus F_k(r), m_2 \oplus F_k(r))$. Is this scheme EAV Secure? I think that ...
I suppose one meaningful way to interpret the question is to phrase it as follows: “does there exist an elliptic curve-based *unique* signature scheme?” (i.e., in which there is only one valid signature on each message, as is the case for RSA-FDH). In that case, BLS signatures fit the bill, although of course, it's ...
Is there a cryptographic function that employs two locks: first 'Lock A', and then on top of that 'Lock B' but it permits unlocking 'Lock A' before 'Lock B' to read the message?
> Should we **(a)** sign-then-encrypt, **(b)** encrypt-then-sign[, or **(c)** do something else]? The answer is: **(c)**, do something else. In specific, it's [safest][1] to use authenticated encryption (**AE**) in *encrypt-then-mac* mode with associated data (**AEAD**), as well as to hash the *target* with associat...
1. Does AES-GCM take replay attacks into consideration? 2. If an attacker sniffs the AES-GCM secured message and somehow gains knowledge of the initialization vector (IV), can they inject falsely fabricated data (ciphers) or perform a replay attack in disguise to confuse the recipient? (Since the IV is also supposed...
While setting up PGP for the first time, I am presented with various encryption standards I can use being: 1. RSA (2048, 3072, 4096 bits) with an option for + RSA (2048, 3072, 4096 bits) 2. DSA (2048 bits) with an option for + Elgamal (2048, 3072, 4096 bits) 3. ECDSA/EdDSA (ed25519, brainpoolP256r1, brainpoolP3...
I was working on implementing shamir secret sharing in GF(2^256), According to my knowledge multiplication in a finite field is defined as mul(a,b) = (a*b)%mod, where mod is the irreducible polynomial. But when I saw the implementation [here][1], It uses bitmasking to multiply and when I compare my multiplication r...
1. Does AES-GCM take replay attacks into consideration? 2. If an attacker intercepts the AES-GCM secured message and gains access to the initialization vector (IV), can they inject falsely fabricated data (ciphers) or replay past data (replay attack) to confuse the recipient? (Since the IV is also sent along with the ...
> According to my knowledge multiplication in a finite field is defined as mul(a,b) = (a*b)%mod, where mod is the irreducible polynomial. Actually, there are other plausible ways to represent values in a finite field; these other plausible ways yield different ways of multiplication. However, that's not the case ...
> 1. Does AES-GCM take replay attacks into consideration? The GCM decryptor is stateless and so it cannot prevent replay attacks by itself. What GCM does is give the tools for the protocol using GCM to detect replays. One common approach is to include a message counter into the AAD (Additional Authenticated Data) ...
A field $(\mathbb F,+,*)$ is a set closed under two operations $+$ and $*$, with $(\mathbb F,+)$ a [commutative group][1] having [identity element][2] noted $0$, $(\mathbb F\setminus\{0\},*)$ a commutative group with identity noted $1$, and $*$ [distributive][3] w.r.t. $+$. Equivalently, it's a [commutative ring][4] $(...
A field $(\mathbb F,+,*)$ is a set closed under two operations $+$ and $*$, with $(\mathbb F,+)$ a [commutative group][1] having [identity element][2] noted $0$, $(\mathbb F\setminus\{0\},*)$ a commutative group with identity noted $1$, and $*$ [distributive][3] w.r.t. $+$. Equivalently, it's a [commutative ring][4] $(...
A field $(\mathbb F,+,*)$ is a set closed under two operations $+$ and $*$, with $(\mathbb F,+)$ a [commutative group][1] having [identity element][2] noted $0$, $(\mathbb F\setminus\{0\},*)$ a commutative group with identity noted $1$, and $*$ [distributive][3] w.r.t. $+$. Equivalently, it's a [commutative ring][4] $(...
> 1. Does AES-GCM take replay attacks into consideration? The GCM decryptor is stateless and so it cannot prevent replay attacks by itself. What GCM does is give the tools for the protocol using GCM to detect replays. One common approach is to include a message counter into the AAD (Additional Authenticated Data) ...
> 1. Does AES-GCM take replay attacks into consideration? The GCM decryptor is stateless and so it cannot prevent replay attacks by itself. What GCM does is give the tools for the protocol using GCM to detect replays. One common approach is to include a message counter into the AAD (Additional Authenticated Data) ...
$H_k$ is a cryptographic hash function keyed using a section of key material $k$. 1. Is the following a roughly equivalent method of authenticating that the section of key material is associated with the section of message material $m$? $$H_k(k \oplus m) \sim H_k(m)$$ 2. Is there anything wrong with choosing o...
Safe implicit value validation: $H_k(k \oplus m) \sim H_k(m)$?
Recently, I read here on Crypto SE that $2^{60}$ doesn't provide enough resistance to current adversaries. Could someone please provide me with good references related to that threshold, or any updated versions of it, say, $2^{70}$ or $2^{80}$? I made an effort to find the exact discussion, but, unfortunately, I was...
What is the recommended key length for <a href="https://en.wikipedia.org/wiki/DomainKeys_Identified_Mail">DKIM</a>? I'm currently thinking about a 1024-bit key vs. a 2048-bit one. From the crypto point of view for RSA, 2048 or 4096 bits is clearly recommended--no discussion on that point. Having glanced over various...
$H_k$ is a cryptographic hash function that's keyed using a section of key material $k$ *(for whatever definition of "keyed" that's appropriate for the given hash function $H$)*. 1. Are the following two methods roughly equivalent ways of authenticating that the section of key material $k$ is associated with the sec...
A field $(\mathbb F,+,*)$ is a set closed under two operations $+$ and $*$, with $(\mathbb F,+)$ a [commutative group][1] having [identity element][2] noted $0$, $(\mathbb F\setminus\{0\},*)$ a commutative group with identity noted $1$, and $*$ [distributive][3] w.r.t. $+$. Equivalently, it's a [commutative ring][4] $(...
I am using the NIST test suite to test random binary numbers. when I tried it for data.pi, the generated report has some items that can not be interpreted. for example, the coeffecients named C0~C10. I am using 20 bit streams. My question is how do these coefficients relate to the 20 streams? and what do they represe...
A field $(\mathbb F,+,*)$ is a set closed under two operations $+$ and $*$, with $(\mathbb F,+)$ a [commutative group][1] having [identity element][2] noted $0$, $(\mathbb F\setminus\{0\},*)$ a commutative group with identity noted $1$, and $*$ [distributive][3] w.r.t. $+$. Equivalently, it's a [commutative ring][4] $(...
I am using DES encryption when writing a file in an embedded device. When I decrypt the file. I get a partially corrupted file. Kind of randomly some 8-byte blocks are corrupted. Some are not. When I regenerate the file, It shows the same corruption. But If I reset the device, the file is okay. My DES encryption fu...
Finding out corrupted S Box value in DES implementation?
Common PIR schemes only protect the client's privacy, not the server's, while Symmetric PIR(SPIR) can do both. In many papers, it is mentioned that we can use the Naor and Pinkas method (https://dl.acm.org/doi/pdf/10.1145/301250.301312) to turn a PIR scheme into SPIR one, however when implementing this, I found this...
While working with AES 256 in CBC mode, I learned that it requires Key Expansion - forward (for encryption) and reverse (for decryption). Does AES CTR mode also requires such a step ? Or can the 256 bit key be used as is ?
I have a challenge in which I need to decrypt 32(?) bytes of plaintext, which by encryption resulted in 48 (this for sure) bytes of data. It's a black box challenge, but managed to figure out the above and below. According to this https://security.stackexchange.com/questions/207633/decrypting-aes-128-cbc-leads-to...
How to get the rest of 10 bytes (from total 32 bytes plaintext) of plaintext from a 48 byte ciphertext using AES-128?
How to get the rest of 10 bytes (from total 32 bytes plaintext) of plaintext from a 48 byte ciphertext using AES-128 when knowing 22B of plaintext?
I have a challenge in which I need to decrypt 32(?) bytes of plaintext, which by encryption resulted in 48 (this for sure) bytes of data. It's a black box challenge, but managed to figure out the above and below. According to this https://security.stackexchange.com/questions/207633/decrypting-aes-128-cbc-leads-to...
A field $(\mathbb F,+,*)$ is a set closed under two operations $+$ and $*$, with $(\mathbb F,+)$ a [commutative group][1] having [identity element][2] noted $0$, $(\mathbb F\setminus\{0\},*)$ a commutative group with identity noted $1$, and $*$ [distributive][3] w.r.t. $+$. Equivalently, it's a [commutative ring][4] $(...
I have a challenge in which I need to decrypt 32(?) bytes of plaintext, which by encryption resulted in 48 (this for sure) bytes of data. It's a black box challenge, but managed to figure out the above and below. According to this https://security.stackexchange.com/questions/207633/decrypting-aes-128-cbc-leads-to...
n, e and modulus of RSA are given and n is very large. p and q are primes generated by ```pow(7, random_seed, modulus)```, and the seed that p and q used is very close. How can I get p and q, or is there any other way to decrypt this RSA?
If Diffie-Hellman is broken then given $g^x$ and $g^y$ we can construct $g^{xy}$. Can we do the reverse? Given $g^{xy}$ and $g^{x}$, can we construct $g^{y}$?
If we have a Diffie-Hellman oracle then given $g^x$ and $g^y$ we can construct $g^{xy}$. Can we construct $g^{x^{-1}}$ given $g^x$?
**Edit:** *One half of the answer to this question also applies to a recently asked and now deleted question regarding the impact of an algorithm which breaks DLP over integers but has no impact on factoring. It would be tricky to go pure RSA.* This is a question based on hypothetical scenarios, please bear with me....
I have temporal data from experiment and by setting a threshold, I convert them to zeros and ones. I saved these binary bits to txt file (normal txt file from MATLAB) with each line has 32 bits (total number of bits is a little over 20 million). When running the NIST test suite, I use ./assess 500000 with 40 bit str...
I use an offline password manager, I want to use a future proof very strong master password and I'm going to choose one of these options from the EFF's large wordlist, a randomly chosen 8 word passphrase (104 bits),or a 10 word (128 bits) or I can even use a 12 word generated passphrase.. Which one should I choose? a...
How strong should my password manager's master password be?
I use an offline password manager, I want to use a future proof very strong master password and I'm going to choose one of these options from the EFF's large wordlist, a randomly chosen 8 word passphrase (104 bits), or a 10 word (128 bits) or I can even use a 12 word generated passphrase... Which one should I choose...
I use an offline password manager, I want to use a future proof very strong master password and I'm going to choose one of these options from the EFF's large wordlist, a randomly chosen 8 word passphrase (104 bits), or a 10 word (128 bits) or I can even use a 12 word generated passphrase... Which one should I choose? ...
Is RFC 6979 guaranteed to prevent the reuse of nonces for different signed hashes?
Does RFC 6979 unconditionally prevent nonce-reuse attacks?