instruction
stringlengths
15
30k
Regarding HKDF (RFC 5869) - HKDF has two steps, extract and expand. Some answers on this site suggest that you can extract once, and then generate multiple keys from the resulting PRK by multiple invocations of HKDF-expand (with different info strings). Other answers say this is not how HKDF should be used, and p...
Taken directly from the [RFC](http://tools.ietf.org/html/rfc5869): > The second stage "expands" the pseudorandom key to the desired > length; the number and lengths of the output keys depend on the > specific cryptographic algorithms for which the keys are needed. The use of the plural here suggests (at l...
I have the following set of equations: $$M_{1}=\frac{y_1-y_0}{x_1-x_0}$$ $$M_{2}=\frac{y_2-y_0}{x_2-x_0}$$ $$M_1, M_2, x_1, y_1, x_2, y_2, $$ are known and they are chosen from a $$GF(2^m)$$. I want to find $$ x_0,y_0 $$ Does the previous set of equations is solvable? And more... If I have the follo...
Regarding HKDF (RFC 5869) - HKDF has two steps, extract and expand. Some answers on this site suggest that you can extract once, and then generate multiple keys from the resulting PRK by multiple invocations of HKDF-expand (with different info strings). (See D.W.'s answer in http://crypto.stackexchange.com/questions...
Regarding HKDF (RFC 5869) - HKDF has two steps, extract and expand. Some answers on this site suggest that you can extract once, and then generate multiple keys from the resulting PRK by multiple invocations of HKDF-expand (with different info strings). Other answers say this is not how HKDF should be used, and p...
Assume for the sake of the question that I have two variable-length bit strings, each with 128 bit cryptographic randomness, and I want to extract two 128 bit keys via HKDF-SHA256. Which alternative is better (if any), and why? a) use a single HKDF-extract on the concatenation of the two strings, and two HKDF-exp...
The reason that a _field_ must be used in Shamir's reconstruction scheme is that the calculations used in the reconstruction need to divide one "number" by another, and division is not defined in $\mathbb Z$, the set of integers: $\frac{m}{n}$ is not necessarily a member of $\mathbb Z$. So, why not use $\mathbb R$,...
The reason that a _field_ must be used in Shamir's reconstruction scheme is that the calculations used in the reconstruction need to divide one "number" by another, and division is not defined in $\mathbb Z$, the set of integers: $\frac{m}{n}$ is not necessarily a member of $\mathbb Z$. So, why not use $\mathbb R$,...
Let's say I pick a 3000+ bit prime $p$ for which I also know that $q = (p - 1) / 2$ is a prime. If I've understood correct, then I can pick pretty much any $g$. Is generating $g^x$ now inevitably slow for any large $x$ regardless of choice of $g$? Do I still only select some $2n$ bit value for $x$ - where $n$ is ...
Is generating public key inevitably slow in classic Diffie-Hellman if the private key is large?
I am looking for a proof-of-work scheme which cannot be effectively parallelized. For example, in [hashcash](http://www.hashcash.org/) (and by extension bitcoin) you have some collision-resistant hash function $f()$, a target $T$ and some constant $C$. You obtain the proof of work by running $P=f(C, N)$ for some non...
Parallel-resistant proof-of-work scheme?
Just to be sure we're on the same page, I interpret your question as defining encryption of a string $P_1 P_2 \cdots P_\ell$ with a counter $\mathsf{ctr}$, key $K$, and an $n$-bit blockcipher $E$ as follows: $$ \mathcal{E}_K(\mathsf{ctr}, P_1P_2\cdots P_\ell) = C_0 C_1 C_2 \cdots C_\ell$$ where $C_0 = E_K(\mathsf{ctr...
I am looking for a proof-of-work scheme which cannot be effectively parallelized. For example, in [hashcash](http://www.hashcash.org/) (and by extension bitcoin) you have some collision-resistant hash function $f()$, a target $T$ and some constant $C$. You obtain the proof of work by running $P=f(C, N)$ for some non...
I am looking for a proof-of-work scheme which cannot be effectively parallelized. For example, in [hashcash](http://www.hashcash.org/) (and by extension bitcoin) you have some collision-resistant hash function $f()$, a target $T$ and some constant $C$. You obtain the proof of work by running $P=f(C, N)$ for some non...
How can one show how to reduce the qudratic residue problem to an integer factorization? Thanks,
I have the following set of equations: $$M_{1}=\frac{y_1-y_0}{x_1-x_0}$$ $$M_{2}=\frac{y_2-y_0}{x_2-x_0}$$ $$M_1, M_2, x_1, y_1, x_2, y_2, $$ are known and they are chosen from a $$GF(2^m)$$. I want to find $$ x_0,y_0 $$ Does the previous set of equations is solvable? And more... If I have the foll...
I have the following set of equations: $$M_{1}=\frac{y_1-y_0}{x_1-x_0}$$ $$M_{2}=\frac{y_2-y_0}{x_2-x_0}$$ $$M_1, M_2, x_1, y_1, x_2, y_2, $$ are known and they are chosen from a $$GF(2^m)$$. I want to find $$ x_0,y_0 $$ Does the previous set of equations is solvable? And more... If I have the foll...
How can one show how to reduce the quadratic residuosity problem to an integer factorization?
How can one show how to reduce the [quadratic residuosity problem](https://en.wikipedia.org/wiki/Quadratic_residuosity_problem) to an integer factorization?
I've read something to the effect that the HMAC construct is able to lessen the problem of collisions in the underlying hash. Does that mean that something like HMAC-MD5 still might be considered safe for authenticating encrypted data?
Is HMAC-MD5 considered secure?
The reason that a _field_ must be used in Shamir's reconstruction scheme is that the calculations used in the reconstruction need to divide one "number" by another, and division is not defined in $\mathbb Z$, the set of integers: $\frac{m}{n}$ is not necessarily a member of $\mathbb Z$. So, why not use $\mathbb R$,...
Most cryptographic libraries I've encountered uses some variant of `processPlaintext(...)` and then `doFinal()` to produce the ciphertext and resets the state. In the context of packet communications, it feels like it would be optimal to setup key and IV **once** and then use that single initialisation in some way f...
Using same AES-GCM setup for multiple packets?
Say that I have $$ C_1 = AES_{k_1}(M_1) $$ How difficult would it be to find a key, K<sub>2</sub> and plaintext M<sub>2</sub> $$ C_2 = AES_{k_2}(M_2) $$ such that $$ C_1 == C_2 $$ How would using a block cipher algorithm other than AES effect this problem?
How difficult is it to find the "pre-image" of a block cipher?
> In the context of packet communications, it feels like it would be optimal to setup key and IV **once** and then use that single initialisation in some way for all packets on the same channel. It might be optimal for efficiency standpoint, but we also care about security; it isn't necessary very good for security....
Just to be sure we're on the same page, I interpret your question as defining encryption of a string $P_1 P_2 \cdots P_\ell$ with a counter $\mathsf{ctr}$, key $K$, and an $n$-bit blockcipher $E$ as follows: $$ \mathcal{E}_K(\mathsf{ctr}, P_1P_2\cdots P_\ell) = C_0 C_1 C_2 \cdots C_\ell$$ where $C_0 = E_K(\mathsf{ctr...
Since the counter values are not authenticated, an attacker can try to swap the order of messages in order to modify things. If a message arrives out of order, the MAC will be correct, since the ciphertext has not been modified, but after decryption, the first block of message will be messed up and the rest of the mess...
Okay, here's the situation I'm in: I'm trying to write a cloud storage application where everything the user uploads is unreadable by the server, encrypted client-side before being sent. Currently, the flow looks like this:<br> -User inputs password<br> -Password is salted and a 256-bit SHA-3 hash is taken<br> -A...
What's the most secure way to derive a key from a password REPEATABLY?
Okay, here's the situation I'm in: I'm trying to write a cloud storage application where everything the user uploads is unreadable by the server, encrypted client-side before being sent. Currently, the flow looks like this: - User inputs password - Password is salted and a 256-bit SHA-3 hash is taken - A new tr...
I'm currently reading the paper [(Leveled) fully homomorphic encryption without bootstrapping][1] , and the following paragraph was near the start: ![](https://i.stack.imgur.com/ZdDiC.png) What is meant by the symbol used? Is it merely to represent polynomial time or something else entirely? [1]: http:/...
> Is there a better way to do this? Yes there is, using tools specifically designed for this problem - namely key derivation functions. Good ones include [PBKDF2](http://en.wikipedia.org/wiki/PBKDF2) and [bcrypt](http://en.wikipedia.org/wiki/Bcrypt). A more modern, better alternative is [scrypt](http://en.wikipedia....
> Is there a better way to do this? Yes there is, using tools specifically designed for this problem - namely key derivation functions (KDF). Good ones include [PBKDF2](http://en.wikipedia.org/wiki/PBKDF2) and [bcrypt](http://en.wikipedia.org/wiki/Bcrypt). A more modern, better alternative is [scrypt](http://en.wiki...
> Is there a better way to do this? Yes there is, using tools specifically designed for this problem - namely key derivation functions (KDF). Good ones include [PBKDF2](http://en.wikipedia.org/wiki/PBKDF2) and [bcrypt](http://en.wikipedia.org/wiki/Bcrypt). A more modern, better alternative is [scrypt](http://en.wiki...
After much deliberation, I've decided to use a normal Encrypt-then-MAC scheme instead of an authenticated encryption mode such as GCM as authenticated encryption primitive. This is due to the lack of good, clean and reliable implementation across all the platforms I intend to support. **Background** This is for a...
Is this an acceptable authenticated encryption?
I'm currently working with a secure transport protocol that defines the IV to be a counter (incremental nonce) to be encrypted with the same key. This is a followup to a protocol that did not provide any kind of IV. Could you please describe the possible attack vectors on CBC encryption using this encrypted nonce? ...
Let say that I wrote a 26 letter alphabet, each letter of my alphabet represent a letter from the latin alphabet. I'm writing in 3 languages, only I know which languages. Grammar is the one from my native language. Each time I need to write a word I randomly chooses in which language I'm going to write it. Ca...
Can you break a multi language code using Frequency analysis?
Why do people say that using hash twice or more is bad? yes there is key derivation that do that job, but in a low bandwidth network countries, the solution i see is to use a simple hashing system on the server to gain one second or two. Is rainbow table effective when using more than one hash? because on internet,...
why hash(hash(str)) is bad?
After much deliberation, I've decided to use a normal Encrypt-then-MAC scheme instead of an authenticated encryption mode such as GCM as authenticated encryption primitive. This is due to the lack of good, clean and reliable implementation across all the platforms I intend to support. **Background** This is for a...
This call for a few different answers. 1. First concerning any rainbow table or similar approach, nothing prevents you from defining $HH(x)=H(H(x))$ and then to apply the desired method to the composed function $HH$. Even if $HH$ has slightly different properties from a usual hash function (see below), this will st...
All natural languages use some symbols more than they use others (or maybe not? Is there a linguistics expect among us to correct me?). Therefore, if your cipher doesn't mask the frequency of the characters (eg. a simple permutation or substitution) then you are vulnerable to frequency analysis. Perhaps Chinese is s...
All natural languages use some symbols more than they use others (or maybe not? Is there a linguistics expect among us to correct me?). Therefore, if your cipher doesn't mask the frequency of the characters (eg. a simple permutation or substitution) then you are vulnerable to frequency analysis. Perhaps Chinese is s...
All natural languages use some symbols more than they use others (or maybe not? Is there a linguistics expect among us to correct me?). Therefore, if your cipher doesn't mask the frequency of the characters (eg. a simple permutation or substitution) then you are vulnerable to frequency analysis. Perhaps Chinese is s...
A paper I found ([http://eprint.iacr.org/2012/064.pdf](http://eprint.iacr.org/2012/064.pdf), which was submitted to a cryptography conference about two years ago), is based on the analysis of some 7.1 million 1024-bit RSA keys published online. By subjecting the *modulus* of each public key to an algorithm first postul...
Does it make sense to block RSA keys under 1024 bits?
Hard to answer impartially, expect opinion-colored answers here. The paper you are mentioning has essentially nothing to do with keysizes. Instead they show that bad use of randomness during RSA key generation may have major security impact. If so, why did they essentially find problems with 1024-bit key ? Well, mos...
What is the difference between the keylength and the length of a password for AES-256?
AES: keylength and password length?
WEP is now considered as insecure. But how about the 256-bit WEP? 'A 256-bit WEP system is available from some vendors. As with the other WEP-variants 24 bits of that is for the IV, leaving 232 bits for actual protection. These 232 bits are typically entered as 58 hexadecimal characters. ((58 × 4 bits =) 232 bits) + 24...
Was 256-bit WEP cracked as well?
WEP is now considered as insecure. But how about the 256-bit WEP? Could someone explain why a 256-bit encryption isn't enough? 'A 256-bit WEP system is available from some vendors. As with the other WEP-variants 24 bits of that is for the IV, leaving 232 bits for actual protection. These 232 bits are typically ente...
How was 256-bit WEP cracked as well?
Yes, we can almost certainly break this, given enough ciphertext. One approach would be to use a dictionary and use word patterns. For instance, if the ciphertext word is `qddxfozogf`, then the plaintext word was probably `ammunition`. Notice how the 2nd and 3rd letters are the same; and the 5th and 10th letters, ...
Could you explain the '[Breaking 104 bit WEP in less than 60 seconds][1]' paper to a general public, without skipping too much technical details. Could you an answer questions, like: how is '1.24/256' a significant difference compared to '1/256'? And how this seemingly small difference could lead a '104-bit WEP key...
I have the following set of equations: $$M_{1}=\frac{y_1-y_0}{x_1-x_0}$$ $$M_{2}=\frac{y_2-y_0}{x_2-x_0}$$ $$M_1, M_2, x_1, y_1, x_2, y_2, $$ are known and they are chosen from a $$GF(2^m)$$. I want to find $$ x_0,y_0 $$ Does the previous set of equations is solvable? And more... If I have the foll...
I have the following set of equations: $$M_{1}=\frac{y_1-y_0}{x_1-x_0}$$ $$M_{2}=\frac{y_2-y_0}{x_2-x_0}$$ $$M_1, M_2, x_1, y_1, x_2, y_2, $$ are known and they are chosen from a $$GF(2^m)$$. I want to find $$ x_0,y_0 $$ Does the previous set of equations is solvable? And more... If I have the foll...
Let say that I wrote a 26 letter alphabet, each letter of my alphabet represent a letter from the latin alphabet. I'm writing in 3 languages, only I know which languages. Grammar is the one from my native language. Each time I need to write a word I randomly chooses in which language I'm going to write it. Ca...
Suppose you got a prime $p = 2\mathbb\Pi_{i=0}^{n-1}q_i+1$, where $2^{k-1} \lt q_i \lt 2^k$ for some $k$ and all $0 \le i \lt n$, and that you also got a generator $g$ of one of the prime order sub groups of $\mathbb Z_p^*$. Also assume that the factorization of $\frac{p-1}{2}$ is unknown. Are there ways to find the...
I've been trying to implement the new SIMON block cipher in Ruby as a personal challenge. The spec didn't include a pseudocode version of the decryption but I thought I had it figured out. The code I wrote is located at https://github.com/Rami114/Personal/blob/master/Simon/Simon.rb I've based this on the spec availa...
I read about how is an input message prepared to be hashed by MD4,MD5 or SHA-1: > Step1 Append padding bits > > The input message is "padded" (extended) so that its length (in bits) > equals to 448 mod 512. Padding is always performed, even if the length > of the message is already 448 mod 512. Padding is perfo...
How is input message for SHA-2 padded?
I've been trying to implement the new SIMON block cipher in Ruby as a personal challenge. The spec didn't include a pseudocode version of the decryption but I thought I had it figured out. The code I wrote is located at https://github.com/Rami114/Personal/blob/master/Simon/Simon.rb I've based this on the spec availa...
I'd like to test and see if certain software uses P-521 ECC curves, or if it uses another variant. Without having access to the sourcecode, or the specification, is there any way for me to test which ECC curve a given implementation of software uses? Take a x509 certificate as an example, aside from ASN.1 informa...
How can I tell which curve a given ECDSA implementation uses? (P-521 or something else)
I'd like to test and see if certain software uses P-521 ECC curves, or if it uses another variant. Without having access to the sourcecode, or the specification, is there any way for me to test which ECC curve a given implementation of software uses? Take a x509 certificate as an example, aside from ASN.1 informa...
After spending more than two weeks reading well over 750 pages while checking the following documents… - "Sponge Functions" - hxxp://sponge.noekeon.org/SpongeFunctions.pdf - "Cryptographic sponge functions" - hxxp://sponge.noekeon.org/CSF-0.1.pdf - "Security Analysis of Extended Sponge Functions" - hxx...
After spending more than two weeks reading well over 750 pages while checking the following documents… - "Sponge Functions" - hxxp://sponge.noekeon.org/SpongeFunctions.pdf - "Cryptographic sponge functions" - hxxp://sponge.noekeon.org/CSF-0.1.pdf - "Security Analysis of Extended Sponge Functions" - hxx...
After spending more than two weeks reading well over 750 pages while checking the following documents… - "Sponge Functions" - hxxp://sponge.noekeon.org/SpongeFunctions.pdf - "Cryptographic sponge functions" - hxxp://sponge.noekeon.org/CSF-0.1.pdf - "Security Analysis of Extended Sponge Functions" - hxx...
After spending more than two weeks reading well over 750 pages while checking the following documents… - "Sponge Functions" - http://sponge.noekeon.org/SpongeFunctions.pdf - "Cryptographic sponge functions" - http://sponge.noekeon.org/CSF-0.1.pdf - "Security Analysis of Extended Sponge Functions" - htt...
After spending more than two weeks reading well over 750 pages while checking the following documents… - "Sponge Functions" - http://sponge.noekeon.org/SpongeFunctions.pdf - "Cryptographic sponge functions" - http://sponge.noekeon.org/CSF-0.1.pdf - "Security Analysis of Extended Sponge Functions" - htt...
I need to take a potentially weak user password and derive a strong key for AES encryption in JavaScript. How can I do this? I expect the hardest problem is generating a good random salt - perhaps an SSL request could be used to ask a server to provide half of the salt. This would work but I'd rather keep it simp...
Suppose ECDSA is used without hashing the message, but directly using a short message (say 10-bytes long) as the value z (using the definitions at http://en.wikipedia.org/wiki/Elliptic_Curve_DSA). (This is because we need extremely fast signing with ECDSA in a specific embedded platform. We also pre-compute kG and k...
Is there any weak message for an ECDSA signature?
My question is based on the following situation: Bob and Alice work for a company that expects them to exchange data encrypted. They could do so using regular public-key cryptography, but Joe (their boss) wants to be part of the procedure to ensure nothing is encrypted or decrypted without his knowledge. Therefore, ...
Does any public key crypto support and/or allow a 3rd party "control-key"?
Suppose ECDSA is used without hashing the message, but directly using a short message (say 10-bytes long) as the value `z` (using the definitions at http://en.wikipedia.org/wiki/Elliptic_Curve_DSA) because we need extremely fast signing with ECDSA in a specific embedded platform. We also pre-compute `kG` and `k^-1` val...
So this might sound like a crazy question but bear with me for a minute. I can't find any info on the internet and so am here, although this might have been a good place to start. I've recently developed an encryption engine using the .net's AES managed classes. I use a 256 bit key generated by the `Rfc2898DeriveByt...
My question is based on the following situation: Bob and Alice work for a company that expects them to exchange data encrypted. They could do so using regular public-key cryptography, but Joe (their boss) wants to be part of the procedure to ensure nothing is encrypted or decrypted without his knowledge. Therefore, ...
My question is based on the following situation: Bob and Alice work for a company that expects them to exchange data encrypted. They could do so using regular public-key cryptography, but Joe (their boss) wants to be part of the procedure to ensure nothing is encrypted or decrypted without his knowledge. Therefore, ...
My question is based on the following situation: Bob and Alice work for a company that expects them to exchange data encrypted. They could do so using regular public-key cryptography, but Joe (their boss) wants to be part of the procedure to ensure nothing is encrypted or decrypted without his knowledge. Therefore, ...
Let's say I create my PGP keys with my appropriate name and email address. 1. Will these personal information be exposed if I publish my public key? 2. When I encrypt a message for sending it to my communication partner, if someone intercepts this encrypted message, will he or she get to know about my personal in...
Is my identity exposed when publishing my public key or encrypting with PGP?
In the family of the believed (experts haven't come yet with a solution) intractable problems in cryptography belongs the [Polynomial Reconstruction problem][1] in which an attacker is given $n$ points in which at least $t$ belong to the evaluation of a polynomial $p$ of degree $k$ and the attacker wishes to reconstru...
Is the polynomial reconstruction problem really "intractable"?
In the family of the believed (experts haven't come yet with a solution) intractable problems in cryptography belongs the [Polynomial Reconstruction problem][1] in which an attacker is given $n$ points in which at least $t$ belong to the evaluation of a polynomial $p$ of degree $k$ and the attacker wishes to reconstru...
Apparently it is *not* possible to compute all MD5 values from `0x0000000000000000` to `0xFFFFFFFFFFFFFFFF`. As far as I understand this operation is hard because cryptographic hash functions make it difficult to calculate a message for a given digest (*Pre-image resistance*). Next storing all MD5 hashvalues re...
Has it become easier to pre-compute tables after MD5 collisions?
Found this security problem: For example: - Alice has an RSA public key: e(exp) = 37 and phi function (totient, Na = (pa-1)*(qa-1)) is 55 => Key: (37, 55) - Bob has an RSA public key: e(exp) = 37 and phi function (totient, Nb = (pb-1)*(qb-1)) is 77 => Key: (37, 77) So I see that the `gcd(55, 77)` is...
Why is it a security problem that two RSA keys have the gcd of their RSA-Modules not equal 1, so are no co-prime?
I'm storing the salted hash of a credit card number in a database. What I'd like to be able to do is determine if two different entries in the same database correspond to the same credit card. Specifically, let $C_1$ and $C_2$ be two credit card numbers (which may or may not be the same). Let $S_1$ and $S_2$ be two ...
I found this security problem, for example: - Alice has an RSA public key: $e = 37$ and $\phi$ (totient, $N_A = (pa-1)(qa-1)$) is $55$, so the key is $(37, 55)$. - Bob has an RSA public key: $e = 37$ and $\phi$ (totient, $N_B$ = $(p_B-1) (q_B-1)$) is $77$, so the key is $(37, 77)$. So I see that $\gcd(55, 77)$...
Why is it a security problem that two RSA moduli are not co-prime?
I've just skimmed over most of the paper ["On Message Integrity in Symmetric Encryption"](http://terpconnect.umd.edu/~gligor/Message_Int6.ps). I've included (the last) part of the abstract below: > We show that generic compositions of confidentiality-secure encryption > schemes with Manipulation Detection Code (MDC...
Apparently it is *not* possible to compute all MD5 values from `0x00000000000000000000000000000000` to `0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF`. As far as I understand this operation is hard because cryptographic hash functions make it difficult to calculate a message for a given digest (*Pre-image resistance*). Ne...