instruction
stringlengths
15
30k
Here is the proof I came up with. Please let me know if you see any problems with it... **Statement to prove**: If an encryption scheme is secure in the IND\$-CPA sense, then it is secure in the IND-CPA sense as well. i.e. IND\$-CPA $\Rightarrow$ IND-CPA The contrapositive is easier to prove: $\neg$IND-CPA $\Ri...
If it were possible to compute digits of pi from an arbitrary location (to generate the stream) in constant time, then it would be an excellent cipher. Unfortunately, this isn't possible. Maurer suggested using the surface of the moon for a source of random information instead: http://download.springer.com/static/pd...
I have a Raspberry Pi single-board computer that happened to have an hardware true random number generator, based on some quantum effects on the processor silicon, baked into its BCM2835 chip and I can pump its randomness by dumping bits from `/dev/hwrng` device in Raspbian, its Debian-based Linux operating system. ...
With a true random number generator at hand, how to implement one-time pad?
If it were possible to compute digits of pi from an arbitrary location (to generate the stream) in constant time, then it would be an excellent cipher. Unfortunately, this isn't possible. Maurer suggested using the surface of the moon for a source of random information instead: [link](http://download.springer.com/st...
I've been reading the wikipedia page, trying to get a better understanding of how to produce a collision. http://en.wikipedia.org/wiki/MD5#Collision_vulnerabilities The wikipedia page above states: "two colliding files is a template file with a 128-byte block of data, aligned on a 64-byte boundary that can be ch...
I know that keys [must not be reused](http://crypto.stackexchange.com/questions/2991/why-must-iv-key-pairs-not-be-reused-in-ctr-mode) in AES-CTR, or when using any stream cipher for that matter. Yet the attacks described do not seem to apply to AES-CBC. Is reusing the same key several times dangerous in AES-CBC mod...
I heard that key/IV pairs [must not be reused](http://crypto.stackexchange.com/questions/2991/why-must-iv-key-pairs-not-be-reused-in-ctr-mode) in AES-CTR, or when using any stream cipher for that matter. Yet the attacks described do not seem to apply to AES-CBC. Is reusing the same key several times dangerous in AE...
Is my understanding of CPA indistinguishability experiment correct?
I've read Whirlpool hash function can produce footprints that could be used as a pseudo random generator. Is it ok so to use it to encrypt some datas using something like EncryptedData = Concat(DataBlock XOR Whirlpool(DataBlock + SecretKey)) ?
I've read that the Whirlpool hash function can produce footprints that could be used as a pseudorandom generator. Is it ok to use it to encrypt some data using something, like <br> EncryptedData = Concat(DataBlock XOR Whirlpool(DataBlock + SecretKey)) ?
Occasionally, for instance in very constrained environment, it can be useful to use only a few cryptographic primitives for all processing. (When you only have a hammer everything looks like a nail.) In such environments, it may be useful to use key derivation function to derive stream to be used as a stream cipher,...
Occasionally, for instance in very constrained environment, it can be useful to use only a few cryptographic primitives for all processing. (When you only have a hammer everything looks like a nail.) In such environments, it may be useful to use key derivation function to derive stream to be used as a stream cipher,...
I've read that the Whirlpool hash function can produce footprints that could be used as a pseudorandom generator. Is it *"OK"* to use it to encrypt some data using something like the following? EncryptedData = Concat(DataBlock XOR Whirlpool(DataBlock + SecretKey))
Occasionally, for instance in very constrained environment, it can be useful to use only a few cryptographic primitives for all processing. (When you only have a hammer everything looks like a nail.) In such environments, it may be useful to use key derivation function to derive stream to be used as a stream cipher,...
I'd like to extract the entropy of data without injecting "pseudo" entropy (eg, by encrypting with AES-CTR). For example, let's say I have a series of bytes, but only the low bit is changing (or something is changing that I'm not aware of beforehand). Is there a known way to extract the random part of the data w...
Despite the fact that Marsaglia's MWC PRNG (multiply-with-carry random number generator) is considered to be *"the mother of all RNGs"*, it does not seem to be considered to be a CSPRNG (cryptographically secure pseudo-random number generator) even though it passes several statistical randomness tests, including *ENT* ...
I'd like to extract the entropy of data without injecting "pseudo" entropy (eg, by encrypting with AES-CTR). For example, let's say I have a series of bytes, but only the low bit is changing (or something is changing that I'm not aware of beforehand). Is there a known way to extract the random part of the data witho...
It's rather kind of lame questions, and I can't find good and clear explanation: 1. In which step of Rijandel **S-box** is generated? 2. Does the **S-box** is re-used in every round of cipher or is generated in every iteration? 3. In coursarea movie where is explanation of **AES**: https://class.coursera.org/c...
It's rather kind of lame questions, and I can't find good and clear explanation: 1. In which step of Rijandel **S-box** is generated? 2. Does the **S-box** is re-used in every round of cipher or is generated in every iteration? 3. In coursarea movie where is explanation of **AES**: https://class.coursera.org/c...
I will answer considering Linux OS, as being one of most popular Unix-like OS (between OSes which have `urandom`). If you need other OS, please, inform me. Also I will answer using [source code of random.c][1] driver from Linux 3.3.3 Kernel, because it is one of best documentation of `/dev/random` mechanics. And the o...
I will answer considering Linux OS, as being one of most popular Unix-like OS (between OSes which have `urandom`). If you need other OS, please, inform me. Also I will answer using [source code of random.c][1] driver from Linux 3.3.3 Kernel, because it is one of best documentation of `/dev/random` mechanics. And the o...
Please forgive this beginner’s question. I have not been able to find an answer online or in the literature, searching under all the search terms I can think of. Nevertheless I suspect the answer is well-known, hence I am asking here. Suppose we define a PRG as the xor of two LCGs modulo a 64-bit prime: something li...
As you know in the past few weeks it has emerged that NIST/NSA have been involved in weakening encryption standards over a long period of time so that they can retain the ability to break encryption used by corporations and the general public. We've already seen evidence of that with the Dual_EC_DRBG which has been rec...
What is the security loss from reducing Rijndael to 128 bits block size from 256 bits?
How broken is a xor of two LCGs?
Please forgive this beginner’s question. I have not been able to find an answer online or in the literature, searching under all the search terms I can think of. Nevertheless I suspect the answer is well-known, hence I am asking here. Suppose we define a PRG as the xor of two LCGs modulo a 64-bit prime: something li...
Suppose we define a PRG as the xor of two LCGs modulo a 64-bit prime: something like the following Python code. p = 14692456042302986707 alpha, beta = 1416483285059710267, 1922202445720274864 gamma, delta = 8868330555542893802, 9736145736144160231 def prg(x, y): while True: ...
Suppose we define a PRG as the xor of two LCGs modulo a 64-bit prime: something like the following Python code. p = 14692456042302986707 alpha, beta = 1416483285059710267, 1922202445720274864 gamma, delta = 8868330555542893802, 9736145736144160231 def prg(x, y): while True: ...
Suppose we define a PRG as the xor of two LCGs modulo a 64-bit prime: something like the following Python code. p = 14692456042302986707 alpha, beta = 1416483285059710267, 1922202445720274864 gamma, delta = 8868330555542893802, 9736145736144160231 def prg(x, y): while True: ...
Suppose we define a PRG as the xor of two LCGs modulo a 64-bit prime: something like the following Python code. p = 14692456042302986707 alpha, beta = 1416483285059710267, 1922202445720274864 gamma, delta = 8868330555542893802, 9736145736144160231 def prg(x, y): while True: ...
It's rather kind of lame questions, and I can't find good and clear explanation: 1. In which step of Rijandel is **S-box** generated? 2. Is the **S-box** reused in every round of cipher or is generated in every iteration? 3. In a course-ware movie where they explained **AES** (class.coursera.org/crypto-preview/...
Where is the S-Box generated in Rijandel/AES?
Let $E_k$ : {0,1}$^l$ be a block cipher encryption function with block-size $l$ and key-length $n$. In class, we saw that a double encryption with two independent keys $E{}'_{k_1k_2}(x)$ = $E_{k_1}(E_{k_2}(x))$, can be brute-forced in $O(2^n)$ time and $O((l + n)2^n)$ space using the meet-in-the-middle attack: ...
1. Does anyone know if OpenSSL's default CSPRNG is Dual_EC_DRBG or not? Their wiki is not very clear 2. Related to the first question, does anyone have any experience with OpenSSL on Mac changing the default CSPRNG? It is quite interesting that there is not much info anywhere on the Internet related to this. Tha...
There are four concerns here: 1. Pad generation 2. Pad transmission 3. Message privacy 4. Message authenticity **Pad generation** The security of the one-time pad depends on the assumption that the pads are generated from a truly random source. This is actually quite a big ask. Suppose for a moment ...
There are four concerns here: 1. Pad generation 2. Pad transmission 3. Message privacy 4. Message authenticity **Pad generation** The security of the one-time pad depends on the assumption that the pads are generated from a truly random source. This is actually quite a big ask. Suppose for a moment ...
Security issues related to block size boil down to the following: a [pseudorandom permutation][1] is not a [pseudorandom function][2], and the difference becomes visible when you query the function too many times. Imagine a function which accepts as inputs, and offers as outputs, elements from a set of size $N$. For in...
This is a hypothetical question and I only have a basic understanding of Cryptography. If one were to follow the very best cryptographic practices for storing passwords, could it ever be possible to publish literally all information (the usernames, the hashes, the salts, the algorithms used) and still be reasonably ...
Could completely public password hashes ever be reliably secure?
First off, I'm extremely sorry if this comes off as a "homework dump", but to clarify, it isn't. I don't want the answer, I want to know how to get to the answer. My cryptography professor gave us an assignment to do, and without explaining this concept, he believes we all understand how to do it, and I definitely don'...
How to convert hexadecimal to plaintext?
First off, I'm extremely sorry if this comes off as a "homework dump", but to clarify, it isn't. I don't want the answer, I want to know how to get to the answer. My cryptography professor gave us an assignment to do, and without explaining this concept, he believes we all understand how to do it, and I definitely don'...
How to decode an OTP message?
This is a hypothetical question and I only have a basic understanding of cryptography. If one were to follow the very best cryptographic practices for storing passwords, could it ever be possible to publish literally all information (the usernames, the hashes, the salts, the algorithms used) and still be reasonably ...
This is a hypothetical question and I only have a basic understanding of Cryptography. If one were to follow the very best cryptographic practices for storing passwords, could it ever be possible to publish literally all information (the usernames, the hashes, the salts, the algorithms used) and still be reasonably ...
Is there any existing analysis for this construction to turn a tweakable blockcipher into a PRF?
encryption and decryption time for RSA-crt in java?
Suppose we define a PRG as the xor of two LCGs modulo a 64-bit prime: something like the following Python code. p = 14692456042302986707 alpha, beta = 1416483285059710267, 1922202445720274864 gamma, delta = 8868330555542893802, 9736145736144160231 def prg(x, y): while True: ...
I am creating a program in *C* language with DES (Data Encryption Standard) functionality, but don't know how to apply the initial permutation. Is it achieved by swapping the values? If *"yes"*, then how is the index of the original message created?
How is the initial permutation of DES created?
Since there is not much info anywhere on the Internet related to this: 1. Does anyone know if OpenSSL's default CSPRNG is Dual_EC_DRBG or not? Their wiki is not very clear… 2. Related to the first question, does anyone have any experience with OpenSSL on Mac changing the default CSPRNG?
I manually set the RSA private key, given the private exponent and modulus. When I use this key to decrypt a message encrypted using a public key(also set with public exponent and modulus) seems to fail with a :"Need public exponent" message in OpenSSL. My question is, should RSA private key require also the public...
In Advanced Encryption Standard, if I used "Counter Mode", how should I handle the nonce? Should I divide the nonce value into two? For example: I have 128-bit of nonce, should I divide it so I get two parts with 64-bit each? The first 64-bit is my chosen nonce value (for example `a0a1a2a3a4a5a6a7`) and the second 6...
I manually set the RSA private key, given the private exponent and modulus. When I use this key to decrypt a message encrypted using a public key (also set with public exponent and modulus) seems to fail with a: "Need public exponent" message in OpenSSL. Should RSA private key also require the public exponent for de...
How broken is it? It is broken. As fgrieu notes, the high bit is highly biased. In other words, the high bit is fairly predictable. This is enough to distinguish the output of this generator from a truly random bitstream. That means the stream cipher is broken: that's the definition of what it means for a stream c...
I have a use case where I need to encrypt some text in the browser using javascript. Only the encrypted text will be stored on the server. The user should then be able to take the encrypted result and decrypt it with GPG on the command line. I want to use GPG as it's easily available and the AES appears to support iter...
Despite the fact that Marsaglia's MWC PRNG (multiply-with-carry random number generator) is considered to be *"the mother of all RNGs"*, it does not seem to be considered to be a CSPRNG (cryptographically secure pseudo-random number generator) even though it passes several statistical randomness tests, including *ENT* ...
How broken is it? It is broken. As fgrieu notes, the high bit is highly biased. In other words, the high bit is fairly predictable. This is enough to distinguish the output of this generator from a truly random bitstream. That means the stream cipher is broken: that's the definition of what it means for a stream c...
From my understanding what you are looking for is this: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.38.9766 I copy and paste from the abstract: We present a protocol for two parties to generate an RSA key in a distributed manner. At the end of the protocol the public key: a modulus N = PQ, and an encrypti...
**Distinguishing attack.** How broken is it? It is broken. As fgrieu notes, the high bit is highly biased. In other words, the high bit is fairly predictable. This is enough to distinguish the output of this generator from a truly random bitstream. That means the stream cipher is broken: that's the definition of w...
**Distinguishing attack.** How broken is it? It is broken. As fgrieu notes, the high bit is highly biased. In other words, the high bit is fairly predictable. This is enough to distinguish the output of this generator from a truly random bitstream. That means the stream cipher is broken: that's the definition of w...
**Distinguishing attack.** How broken is it? It is broken. As fgrieu notes, the high bit is highly biased. In other words, the high bit is fairly predictable. This is enough to distinguish the output of this generator from a truly random bitstream. That means the stream cipher is broken: that's the definition of w...
**Distinguishing attack.** How broken is it? It is broken. As fgrieu notes, the high bit is highly biased. In other words, the high bit is fairly predictable. This is enough to distinguish the output of this generator from a truly random bitstream. That means the stream cipher is broken: that's the definition of w...
I don't have a proof myself, but here's how you could analyze this / prove it secure yourself, if you want to have a go. Your construction is basically $F(M) = E_0(G(M))$, where $G(M) = E_1(M_1) \oplus \dots E_{\lambda+|M_m|}(0))$ (that long thing defined in the question). To prove this secure, it suffices to prove...
I don't have a proof myself, but here's how you could analyze this / prove it secure yourself, if you want to have a go. Your construction is basically $F(M) = E_0(G(M))$, where $G(M) = E_1(M_1) \oplus \dots \oplus E_{\lambda+|M_m|}(0)$ (that long thing defined in the question). To prove this secure, it suffices to...
I'm doing a lot of reading about [Feistel networks][1]. Something occurred to me a bit ago that I hadn't realized previously, namely that in any Feistel construction there are bits of the plaintext that are never given as input to the round function without having been mixed with the previous round function's output. ...
Is this a structural weakness of Feistel networks?
I'm not looking necessarily for implementations in any language (although it would help to list those resources as well), but what I am most interested in is a discussion of what advantages and disadvantages certain encryption methods have when applied to a given scenario. Just for a frame of reference: 1. I want a...
Is there a developer's resource that ties encryption methods and strengths to the appropriate usage scenarios?
No, this is not a structural weakness of Feistel networks. For instance, we know it can't hurt diffusion properties. Actually, we know that it's not a structural weakness. How do we know that? Because we have a proof of security for Feistel networks (under certain conditions and assumptions). Those proofs imply th...
**Distinguishing attack.** How broken is it? It is broken. As fgrieu notes, the high bit is highly biased. In other words, the high bit is fairly predictable. This is enough to distinguish the output of this generator from a truly random bitstream. That means the stream cipher is broken: that's the definition of w...
I have an information that I would like to encrypt and give it to someone else. I would like to encrypt it using N separate passwords (say 5) and give each password to some other persons. However the tricky part is that I would like to have any M of them (M<=N, say M=4) to be able to get together and decipher the messa...
I found [this paper that explains how to attack a reduced round tiger hash](http://www.iacr.org/archive/asiacrypt2007/48330539/48330539.pdf), but I'm having a hard time understanding some of the mathematical notation. Could someone explain the section "Message Modification by Meet-in-the-Middle" in plain English? Her...
Can you help me understand this "Message Modification by Meet-in-the-Middle" related to Tiger Hash?
I have two questions regarding the Block Cipher Modes: 1. Which one of the modes is considered the best? I know CBC has a problem of IV since the next block of the plain text is XORed with the result of cipher text of the last block and the same with OFB. Is CTR the best one or not? 2. In "SSL with blockciphers ...
I started reading about the most recent cryptanalysis of RC4 and it's variants. One of the papers I just finished reading (["Two Linear Distinguishing Attacks on VMPC and RC4A and Weakness of RC4 Family of Stream Ciphers" by Alexander Maximov](http://eprint.iacr.org/2007/070.pdf)) handles Linear Distinguishing Attacks....
How much does a successful Linear Distinguishing Attack "break" the attacked stream cipher?
As you know in the past few weeks it has emerged that NIST/NSA have been involved in weakening encryption standards over a long period of time so that they can retain the ability to break encryption used by corporations and the general public. We've already seen evidence of that with the Dual_EC_DRBG which has been rec...
key-exchange protocol allows two parties to establish a shared key over public network. Lacking of authentication the original Diffie–Hellman key exchange is insecure under man-in- -the-middle attack. Later the concept of authenticated key exchange protocol is proposed.In the family of authenticated DH protocols,ther...
There is a theorem in cryptography that states that secure encryption and secure PRNG are equivalent, and in fact you just proved half of it. Given a secure PRNG, you can create a secure encryption algorithm using the method you just provided *(using the key as the PRNG-seed)*. The other half is that given a secure...
There are a number of zero-knowledge proofs for proving knowledge of a plaintext. These work with public key cryptosystems but not block ciphers. For example, with Elgamal: $\langle g^r, m\cdot y^r \rangle$ it is sufficient to prove knowledge of $r$ in $g^r$. This can be done with a [Schnorr proof][1] (and made non-int...
Short answer to the question is 'no', if the users of the service can choose their passwords. **Details** There is no way to force people to select passwords that are secure. When password is long, at least some (lazy) users will make passwords that are long, but contain little entropy. When password or PIN ge...
What are the possible cryptographic implications of Zhang's proof of the Twin Prime Conjecture?
How does Dissent protect against Sybil Attacks?
I am just learning about the RSA algorithm. Looking at the first two steps: 1. Choose two distinct prime numbers p and q. 2. Compute n = pq. I have some probably stupid questions: - Why do p and q have to be prime numbers? Why couldn't they be any integers or odd integers? Or does that break the whole alg...
What makes RSA secure by using prime numbers?
I'm not quite sure the benefits of working over a prime modulus in Shamir's secret share- but doesn't limiting the numbers you pull from make the secret easier to guess? Instead of being over the real numbers, with infinite elements, limiting yourself to some prime limits the possibilities-albeit that number can get ve...
When would one prefer a proof of knowledge instead of a zero-knowledge proof?
I am using a KDF to derive a key, `p'` from a password `p`. I would like to know if the password is correct before using the derived key. Bruce Schneier's PasswordSafe [format V3](http://sourceforge.net/p/passwordsafe/git-code/ci/master/tree/docs/formatV3.txt) has "H(P') is SHA-256(P'), and is used to verify that th...
This is a hypothetical question and I only have a basic understanding of Cryptography. If one were to follow the very best cryptographic practices for storing passphrases, could it ever be possible to publish literally all information (the usernames, the hashes, the salts, the algorithms used) and still be reasonabl...
Could completely public passphrase hashes ever be reliably secure?
It is important to make sure that password based key derivation takes place *before* passphrase correctness is checked. Otherwise, possible attacker can choose if they attack against passphrase correctness check or pbkdf function. (Appears ok on the both functions.) PasswordSafe ------------ In case of very hig...
I am just learning about the RSA algorithm. Looking at the first two steps: 1. Choose two distinct prime numbers $p$ and $q$. 2. Compute $n = pq$. I have some probably stupid questions: - Why do $p$ and $q$ have to be prime numbers? Why couldn't they be any integers or odd integers? Or does that break the...
I am using a KDF to derive a key, `p'` from a password `p`. I would like to know if the password is correct before using the derived key. Bruce Schneier's PasswordSafe [format V3](http://sourceforge.net/p/passwordsafe/git-code/ci/master/tree/docs/formatV3.txt) has > H(P') is SHA-256(P'), and is used to verify th...
AES has several different variants: - AES-128 - AES-192 - AES-256 But why would someone prefer use one over another?
I don't believe that there's any way to generate the vanity hashes without iterating. In base 58, there's $\log_2(58) \approx 5.858$ bits per letter, so fixing 8 letters would need in average $58^8/2 = 2^{\log_2(58)·8}/2 \approx 2^{46}$ iterations. Note that Bitcoin addresses always start with a 1 by convention (this c...
I am using a KDF to derive a key, `p'` from a password `p`. I would like to know if the password is correct before using the derived key. Bruce Schneier's PasswordSafe [format V3](http://sourceforge.net/p/passwordsafe/git-code/ci/master/tree/docs/formatV3.txt) has > H(P') is SHA-256(P'), and is used to verify th...
It is important to make sure that password based key derivation takes place *before* passphrase correctness is checked. Otherwise, possible attacker can choose if they attack against passphrase correctness check or pbkdf function. (Appears ok on the both functions.) - **PasswordSafe** In case of very high entr...
I am study hash functions. I get understand colision resistance imply second pre-image resistance, but I can't get, yet, Why Second pre-image imply pre-image resistance?. Anybody Could be help me with this proof please?