instruction
stringlengths
15
30k
How does one measure the decrease in security, if any, of RC4 when mapping to a specific range of values?
I don't have an answer (yet), but I'd like to suggest a potentially interesting reformulation (or variant) of the problem as a form of secure multi-party computation: >Given $k$, $n$ and $m$, is there a protocol by which $n$ participants $i \in \lbrace 1, \dotsc, n \rbrace$ may, without the help of a trusted externa...
I'd like to suggest a potentially interesting reformulation (or variant) of the problem as a form of secure multi-party computation: >Given $k$, $n$ and $m$, is there a protocol by which $n$ participants $i \in \lbrace 1, \dotsc, n \rbrace$ may, without the help of a trusted external party, each compute a share $s_i...
What are the most authoritative papers on the security analysis of ECDSAs? I`m mainly looking for comparisons of how secure different curves are considered to be, what potential methods are there of discovering a private key based on the public key, and possibly the methods of cracking the entire curve. Moreover,...
Well, depending on what's reasonable and what you can compute reliably by hand, you MIGHT be able to compute discrete logs in a moderate-size group (like $Z_n$ for moderate $n$). Exponentiation via repeated squaring is doable I think. Probably more practical would be a MD5-like ad hoc confusion-diffusion primitive....
According to the [Wikipedia entry][1] for the Alternating Step pseudorandom number generator, there is no public cryptanalysis for this device since it was invented back in 1987 by C.G. Gunther. I have several questions about this: 1. If it hasn't been cracked since 1987, why is it not considered to be a candidate f...
Why isn't the alternating step generator used more often?
I want to know more about cryptography and security. Let's say that there there is a binary file encrypted with AES (key + iv). If key is known, but iv is not is it trivial to fully decrypt file? How hard is it? Thank you for your time.
AES: Key is known IV not, can data be decrypted?
Let's say that there is a binary file encrypted with AES in CBC mode (i.e. using a key and initialization vector). If key is known, but IV is not, is it easy to fully decrypt the file? How hard is it?
Can CBC ciphertext be decrypted if the key is known, but the IV not?
Well, depending on what's reasonable and what you can compute reliably by hand, you MIGHT be able to compute modular exponents in a moderate-size group (like $Z_n$ for moderate $n$). Exponentiation via repeated squaring is doable I think. Probably more practical would be a MD5-like ad hoc confusion-diffusion primit...
A number of cryptographic functions have constants built in. For example, the constants used in [RFC 2104][1] for HMAC, or the constants used in s-boxes (e.g., DES and AES), or MD5. In general, how are constants such as these generated so as not to arouse suspicion of tampering or weakening? [1]: http://tools.i...
How to choose constants in a cryptographic function?
I was looking through the working of SSL V3, and found that a connection state is defined by a set of things including `client write mac secret`,`server write mac secret`, `server write mac secret`, `client write mac secret`.... I couldn't found the use of these in the SSL working As I understood from reading SSL af...
I was looking through the working of SSL V3, and found that a connection state is defined by a set of things including `client_write_mac_secret`,`server_write_mac_secret`, `server_write_key`, `client_write_key`.... I couldn't found the use of these in the SSL working As I understood from reading SSL after having a h...
I was looking through the working of SSL V3, and found that a connection state is defined by a set of things including `client_write_mac_secret`,`server_write_mac_secret`, `server_write_key`, `client_write_key`.... I couldn't found the use of these in the SSL working As I understood from reading SSL after having a h...
I was looking through the working of [SSL V3][1], and found that a connection state is defined by a set of things, including * client write mac secret, * server write mac secret, * server write key, * client write key. I couldn't found the use of these in the SSL protocol. As I understood from reading, afte...
What is the purpose of four different secrets shared by client and server in SSL/TLS?
The generation of key materials is given by key_block = MD5(master_secret + SHA('A' + master_secret + ServerHello.random + ClientHello.random)) + MD5(master_secret + SHA('BB' + master_secret + ServerHello.random + ClientHello.random)) + MD5...
I would like to learn more about cryptography. Let's say you encrypt multiple files with CBC encryption using the same key, but each file has unique (and pseudo random) iv. Does this weakens the security of the data? Is it easier to obtain key if you have many instances of the same data encoded with different iv. Le...
Encrypting (CBC) identical files with same key and different iv, is it less secure?
I am often told that any key can be broken and that it is only a matter of time and resources for any key to be broken. I know that this it technically true. However, I think that there is probably a point where it makes sense to say a key is uncrackable (for example, if it would cost 100 times the world GDP to crack i...
How much would it cost in U.S. dollars to brute force a 256 bit key in a year?
256-bit key cracking through exhaustive search is [totally out of reach of Mankind][1]. And it takes quite a lot of wishful thinking to even envision a 128-bit key cracking: - trying one key must be reduced to the flip of a single logic gate (compared to the hundreds of thousands which are actually required); - t...
Im trying to figure out what the best way to encrypt data sent between a webpage and the user(both ways) is, when hosted in an environment that doesn't support SSL. The purpose of encryption would be obscuring content for delivery through filters that aid in internet censorship. What ways would that be possible to acom...
I came across the requirement that, in RSA, p-1 and q-1 shouldn't be smooth, shouldn't consist of lots of small factors. Therefore my question: 1. How complicated is it to check whether p-1 is smooth? (And how is it done?) 2. Knowing the complexity of finding out, is it reasonable to actually check? For insta...
Is it reasonable to assure that p-1 and q-1 aren't smooth?
I came across the requirement that, in RSA, $p-1$ and $q-1$ shouldn't be smooth, shouldn't consist of lots of small factors. Therefore my question: 1. How complicated is it to check whether $p-1$ is smooth? (And how is it done?) 2. Knowing the complexity of finding out, is it reasonable to actually check? For...
I came across the requirement that, in RSA, $p-1$ and $q-1$ shouldn't be smooth, shouldn't consist of lots of small factors. Therefore my question: 1. How complicated is it to check whether $p-1$ is smooth? (And how is it done?) 2. Knowing the complexity of finding out, is it reasonable to actually check? For...
I came across the requirement that, in RSA, $p-1$ and $q-1$ shouldn't be smooth, shouldn't consist of lots of small factors. Therefore my question: 1. How complicated is it to check whether $p-1$ is smooth? (And how is it done?) 2. Knowing the complexity of finding out, is it reasonable to actually check? For...
I came across the requirement that, in RSA, $p-1$ and $q-1$ shouldn't be smooth, shouldn't consist of lots of small factors. Therefore my question: 1. How complicated is it to check whether $p-1$ is smooth? (And how is it done?) 2. Knowing the complexity of finding out, is it reasonable to actually check? For...
How to provide a secure and authentic communication channel using cryptography?
On point 1: Especially if one is happy with probable (rather than provable) primes, it is not overly complicated to generate $p$ such that $p-1$ is not smooth. The idea is to first choose a big random prime $p_1$ still much smaller than we want $p$ to be, then test candidates $p = k \times p_1+1$, for consecutive $k$ s...
On point 1: Especially if one is happy with probable (rather than provable) primes, it is not overly complicated to generate $p$ with assurance that $p-1$ is not smooth. The idea is to first choose a big random prime $p_1$ still much smaller than we want $p$ to be, then test candidates $p = k \times p_1+1$, for consecu...
On point 1: Especially if one is happy with probable (rather than provable) primes, it is not overly complicated to generate $p$ with assurance that $p-1$ is not smooth. The idea is to first choose a big random prime $p_1$ still much smaller than we want $p$ to be, then test candidates $p = k \times p_1+1$, for consecu...
On point 1: Especially if one is happy with probable (rather than provable) primes, it is not overly complicated to generate $p$ with assurance that $p-1$ is not smooth. The idea is to first choose a big random prime $p_1$ still much smaller than we want $p$ to be, then test candidates $p = k \times p_1+1$, for consecu...
There is some Thermodynamic Limitations. A good explanation about Thermodynamic Limitations is by Bruce Schneier in [Applied Cryptography][1]: > One of the consequences of the second law of thermodynamics is that a > certain amount of energy is necessary to represent information. To > record a single bit by changi...
On point 1 (difficulty of insuring that $p-1$ is not smooth): Especially if one is happy with probable (rather than provable) primes, it is not overly complicated to generate $p$ with assurance that $p-1$ is not smooth. The idea is to first choose a big random prime $p_1$ still much smaller than we want $p$ to be, then...
On point 1 (difficulty of insuring that $p-1$ is not smooth): Especially if one is happy with probable (rather than provable) primes, it is not overly complicated to generate $p$ with assurance that $p-1$ is not smooth. The idea is to first choose a big random prime $p_1$ still much smaller than we want $p$ to be, then...
On point 1 (difficulty of insuring that $p-1$ is not smooth): Especially if one is happy with probable (rather than provable) primes, it is not overly complicated to generate $p$ with assurance that $p-1$ is not smooth. The idea is to first choose a big random prime $p_1$ still much smaller than we want $p$ to be, then...
On point 1 (difficulty of insuring that $p-1$ is not smooth): Especially if one is happy with probable (rather than provable) primes, it is not overly complicated to generate $p$ with assurance that $p-1$ is not smooth. The idea is to first choose a big random prime $p_1$ still much smaller than we want $p$ to be, then...
On point 1 (difficulty of insuring that $p-1$ is not smooth): Especially if one is happy with probable (rather than provable) primes, it is not overly complicated to generate $p$ with assurance that $p-1$ is not smooth. The idea is to first choose a big random prime $p_1$ still much smaller than we want $p$ to be, then...
On point 1 (difficulty of insuring that $p-1$ is not smooth): Especially if one is happy with probable (rather than provable) primes, it is not overly complicated to generate $p$ with assurance that $p-1$ is not smooth. The idea is to first choose a big random prime $p_1$ still much smaller than we want $p$ to be, then...
On point 1 (difficulty of insuring that $p-1$ is not smooth): Especially if one is happy with probable (rather than provable) primes, it is not overly complicated to generate $p$ with assurance that $p-1$ is not smooth. The idea is to first choose a big random prime $p_1$ still much smaller than we want $p$ to be, then...
On point 1 (difficulty of insuring that $p-1$ is not smooth): Especially if one is happy with probable (rather than provable) primes, it is not overly complicated to generate $p$ with assurance that $p-1$ is not smooth. The idea is to first choose a big random prime $p_1$ still much smaller than we want $p$ to be, then...
On point 1 (difficulty of insuring that $p-1$ is not smooth): Especially if one is happy with probable (rather than provable) primes, it is not overly complicated to generate $p$ with assurance that $p-1$ is not smooth. The idea is to first choose a big random prime $p_1$ still much smaller than we want $p$ to be, then...
On point 1 (difficulty of insuring that $p-1$ is not smooth): Especially if one is happy with probable (rather than provable) primes, it is not overly complicated to generate $p$ with assurance that $p-1$ is not smooth. The idea is to first choose a big random prime $p_1$ still much smaller than we want $p$ to be, then...
On point 1 (difficulty of insuring that $p-1$ is not smooth): Especially if one is happy with probable (rather than provable) primes, it is not overly complicated to generate $p$ with assurance that $p-1$ is not smooth. The idea is to first choose a big random prime $p_1$ still much smaller than we want $p$ to be, then...
On point 1 (difficulty of insuring that $p-1$ is not smooth): Especially if one is happy with probable (rather than provable) primes, it is not overly complicated to generate $p$ with assurance that $p-1$ is not smooth. The idea is to first choose a big random prime $p_1$ still much smaller than we want $p$ to be, then...
There is a reasonably clear description in section 2 of [Pascal Junod's thesis][1]. **A linear approximation, which allows guessing 1 key bit** Linear cryptanalysis begins by finding a linear equation which holds with probability distinct from $1/2$. We are talking about linearity in $\mathbb{Z}_2$, i.e. we XOR b...
I would like to maintain a list of unique data blocks (up to 1MiB in size), using the SHA-256 hash of the block as the key in the index. Obviously there is a chance of hash collisions, so what is the best way of reducing that risk? If I also calculate the (e.g.) MD-5 hash of the block, and use the combination (SHA-256,...
Best way to reduce chance of hash collisions: Multiple hashes, or larger hash?
To have approximately a 50% chance of a collision, you'd need $2^{128}$ data blocks. This comes from the [birthday problem][1]. Are you anticipating your list to be that large? I would doubt it as that would be an astronomical amount of data (much, much more than a petabyte). That said, it is very, very unlikely tha...
The risk of collision is only theoretical; it will not happen in practice. Time spent worrying about such a risk of collision is [time wasted][1]. Consider that even if you have $2^{90}$ 1MB blocks (that's a billion of billions of billions of blocks -- stored on 1TB hard disks, the disks would make a pile as large of t...
To walk you through RSA from start to end, here's how it works. 1. Choose two large distinct primes $p$, $q$. Calculate $n=pq$. 2. Calculate $\phi(pq)$. This happens to be $(p-1)(q-1)$. 3. Choose $e$ such that $gcd(e, \phi(p,q)) = 1$ and $e < \phi(p,q)$. 4. Compute $de = 1 \mod \phi(p,q)$. 5. Do some crypto; $c ...
The risk of collision is only theoretical; it will not happen in practice. Time spent worrying about such a risk of collision is [time wasted][1]. Consider that even if you have $2^{90}$ 1MB blocks (that's a billion of billions of billions of blocks -- stored on 1TB hard disks, the disks would make a pile as large of t...
What is Preimage Resistance, and how can the lack thereof be exploited? How is this different from collision resistance? Are there any known preimage attacks that would be considered feasible?
What is Pre-image Resistance, and how can the lack thereof be exploited?
**Preimage resistance** is about the most basic property of a hash function which can be thought. It means: > For a given $h$ in the output space of the hash function, it is hard to find any message $x$ with $H(x) = h$. A function with this property is also called **one-way function** (though this term is also us...
**Preimage resistance** is about the most basic property of a hash function which can be thought. It means: > For a given $h$ in the output space of the hash function, it is hard to find any message $x$ with $H(x) = h$. (Note that the *it is hard* here and in the next definitions is not formally defined, but can ...
What is **preimage resistance**, and how can the lack thereof be exploited? How is this different from collision resistance? Are there any known preimage attacks that would be considered feasible?
What is pre-image resistance, and how can the lack thereof be exploited?
I came across this while refreshing my cryptography brain cells. From the [**RSA** algorithm][1] I understand that it somehow __depends on the fact__ that, given a **large number (A)** it is computationally impossible to derive at the **two prime numbers (B & C) whose product it is**. But that isn't the Fermat Th...
What is the relation between RSA & Fermat's little theorem?
I came across this while refreshing my cryptography brain cells. From the [**RSA** algorithm][1] I understand that it somehow __depends on the fact__ that, given a **large number (A)** it is computationally impossible to derive at the **two prime numbers (B & C) whose product it is**. But that isn't the Fermat Th...
My prof told me that in a public-key cryptostem, if it is secure against ciphertext-only attacks, then it is also secure against a chosen-plaintext attack. Why is this true? Is there a proof that confirms this?
What is the principle of linear cryptanalysis, as applied to a block cipher ? For instance, [this page][1] gives the rough outline of differential cryptanalysis. [1]: http://scienceblogs.com/goodmath/2008/10/differential_cryptanalysis.php
My professor told me that in a public-key crypto-system, if it is secure against [ciphertext-only attacks][1], then it is also secure against a [chosen-plaintext attack][2]. Why is this true? Is there a proof that confirms this? [1]: http://en.wikipedia.org/wiki/Ciphertext-only_attack [2]: http://en.wikipedia...
Is it true that if a public key cryptosystem is secure against ciphertext-only attacks then it is also secure against chosen plaintext attacks?
My professor told me: > If a public-key crypto-system is secure against [ciphertext-only attacks][1], > then it is also secure against a [chosen-plaintext attack][2]. Why is this true? Is there a proof that confirms this? [1]: http://en.wikipedia.org/wiki/Ciphertext-only_attack [2]: http://en.wikipedia...
For public-key encryption, why does COA resistance imply CPA resistance?
Recentally, [an attack on AES][1] was discovered which reduces its computationally complexity, by a very slight amount. - The first key recovery attack on the full AES-128 with computational complexity $2^{126.1}$. - The first key recovery attack on the full AES-192 with computational complexity $2^{189....
When bruteforcing a password (e.g. the common attacks on DES), where you have ciphertext only, you need a way to assess whether a decrypted plaintext is the right one. I believe the EFF DES machine does this by checking if the chars are printable. Of course, this only works for ASCII files, not things like images. ...
I'd like to implement a "Product Registration" scheme into my software where upon initial use, the User must enter a key to unlock it. The key they enter is compared to their encrypted Username. They would have to acquire the key from myself if they wished to use the software. Their encrypted Username must be ...
Cipher for Product Registration?
Suppose one wanted to use RSA encryption for the sole purpose of sending key bits for use in private key crypto systems. A dedicated key exchange system so to speak. And say you didn't think that the presently used RSA key lengths were going to be secure in ten or fifteen years. What would be some of the technical diff...
I would like to maintain a list of unique data blocks (up to 1MiB in size), using the SHA-256 hash of the block as the key in the index. Obviously there is a chance of hash collisions, so what is the best way of reducing that risk? If I also calculate the (e.g.) MD-5 hash of the block, and use the combination (SHA-256,...
Suppose one wanted to use [RSA][1] encryption for the sole purpose of sending key bits for use in symmetric crypto systems, a dedicated key exchange system so to speak. And say you didn't think that the presently used RSA key lengths were going to be secure in ten or fifteen years. What would be some of the technic...
Are there practically upper limits of RSA key lengths?
On point 1 (difficulty of insuring that $p-1$ is not smooth): Especially if one is happy with probable (rather than provable) primes, it is not overly complicated to generate $p$ with assurance that $p-1$ is not smooth. The idea is to first choose a big random prime $p_1$ still much smaller than we want $p$ to be, then...
If $H$ is a typical secure hash function, then [$(k,x) \mapsto H(k \mid\mid x)$ is not a secure MAC construction](http://crypto.stackexchange.com/questions/1070/why-is-hkx-not-a-secure-mac-construction), because given a known plaintext $x_1$ and its MAC $m_1$, an attacker can extend $k \mid\mid x_1$ to a longer message...
Is H(k||length||x) a secure MAC construction?
This construction is not secure. It was proposed in [this paper][1] in a quick sentence for possibly fixing the insecure secret prefix construction from the other question: $\mathcal{H}(k||m)$. The author then proposes and analyzes an enveloping method: $\mathcal{H}(k_1||x||k_2)$. An attack involving finding an inte...
This construction is not secure. It was proposed in [this paper][1] in a quick sentence for possibly fixing the insecure secret prefix construction from the other question: $\mathcal{H}(k||m)$. The author then proposes and analyzes an enveloping method: $\mathcal{H}(k_1||x||k_2)$. An attack involving finding an inte...
This construction is not secure. It was proposed in [this paper][1] in a quick sentence for possibly fixing the insecure secret prefix construction from the other question: $\mathcal{H}(k||m)$. The author then proposes and analyzes an enveloping method: $\mathcal{H}(k_1||x||k_2)$. An attack involving finding an inte...
There a number of ways of using block ciphers to produce short ciphertexts: see [this post][1] and [this post][2]. A general technique is [format preserving encryption (FPE)][3]. I am not clear on the details of how you want to use it. Is the secret key being distributed with the software so that it can encrypt the ...
I recently ran across elliptic curve crpto-systems. [here][1] and [wiki][2] and [Rebahi, Y.; Pallares, J.J.; Nguyen Tuan Minh; Ehlert, S.; Kovacs, G.; Sisalem, D.; , "Performance analysis of identity management in the Session Initiation Protocol (SIP)," Computer Systems and Applications, 2008. AICCSA 2008. IEEE/ACS Int...
I'd like to suggest a potentially interesting reformulation (or variant) of the problem as a form of secure multi-party computation: >Given $k$, $n$ and $m$, is there a protocol by which $n$ participants $i \in \lbrace 1, \dotsc, n \rbrace$ may, without the help of a trusted external party, each compute a share $s_i...
I recently ran across elliptic curve crypto-systems [here][1], [wiki][2], [Rebahi, Y.; Pallares, J.J.; Nguyen Tuan Minh; Ehlert, S.; Kovacs, G.; Sisalem, D.; , "Performance analysis of identity management in the Session Initiation Protocol (SIP)," Computer Systems and Applications, 2008. AICCSA 2008. IEEE/ACS Internati...
Why is elliptic curve cryptography not widely used, compared to RSA?
Since no-one else has mentioned this yet, I guess I should point out that it _is_ possible to use public key signature schemes like (EC)DSA to generate software registration keys. For example, [Microsoft apparently uses this](http://groups.google.com/group/sci.crypt/browse_thread/thread/375cd254a2b8bbef) for their pro...
RSA was there first. That's actually enough for explaining its preeminence. RSA was first published in 1978 and the [PKCS#1][1] standard (which explains exactly how RSA should be used, with unambiguous specification of which byte goes where) has been publicly and freely available since 1993. The idea of using elliptic ...
This is mostly a supplement to @ThomasPornin's answer, not a complete answer on its own (but too long to fit in a comment). ECC uses a finite field, so even though elliptical curves themselves are relatively new, most of the math involved in taking a discrete logarithm over the field is much older. In fact, most of ...
Using a cryptographic hash to store e.g. passwords in a database is considered good practice (as opposed to storing them plaintext), but is subject to attacks on said cryptographic hash, assuming the database is compromised. Which properties of a cryptographic hash function make it suitable for for hashing passwords...
What makes a hash function good for password hashing?
Are there practical upper limits of RSA key lengths?
@Thomas has a great answer and I don't want to detract from it. However I wanted to better highlight how, as he notes, you are just exploiting the homomorphism of Elgamal. The variant of Elgamal with the message in the exponent is often called exponential Elgamal[ \[CGS\]][1]. It is additively homomorphic which mean...
@Thomas has a great answer and I don't want to detract from it. However I wanted to better highlight how, as he notes, you are just exploiting the homomorphism of Elgamal. The variant of Elgamal with the message in the exponent is often called exponential Elgamal[ \[CGS\]][1]. It is additively homomorphic which mean...
I've implemented an API for one of my clients, it relies on `nonces` and a `shared secret`. The structure: 1. Client's Site (**CS**) requests `nonce` from My App (**MA**), posting their `username` 2. **MA** verifies the `username` is valid, then generates a `nonce` in response 1. The `nonce` is only valid for ...