instruction
stringlengths
15
30k
Can the AES encryption and decryption algorithms be described as a polynomial for a specific key?
Let $b$ be the number of elements in the block cipher's domain. $\:$ Let $n$ be the block cipher's key size. <br> If $\:\frac{2^n}{b!}\:$ is negligible, then one can construct an [eTCR (page 4) hash](http://books.google.com/books?id=tbf4quWHW9kC&pg=PA93&lpg=PA93&dq=%22eTCR+hash%22&source=bl&ots=4jW4ZAU2N5&sig=p-jFvTM...
In a recent blog post of Bruce Schneier, Bruce suggested that he prefers classic discrete log crypto over ecc because "I no longer trust the constants. I believe the NSA has manipulated them through their relationships with industry." Can someone elaborate on a case study what the above phrase would mean in the real w...
AES is a block cipher that consists of non-linear and linear parts to provide the Shannon requirements of confusion and diffusion respectively. The linear parts can for sure be described as a polynomial and more specifically the `SiftRows,MixColumnds,AddRoundKey` parts but what about the non-linear one?
Assume that some entity really holds the private key corresponding to the recommended/dubious constants of Dual_EC_DRBG. According to [this presentation][1], they would be able to reconstruct the internal state from only 32 bytes of random output and thereby predict all future output as well. Would the backdoor a...
What exactly could be accomplished with a backdoor in Dual_EC_DRBG?
Could you choose the number of PBKDF2 iterations based upon the system time? I've heard a few people recommend that the number of iterations for PBKDF2 should be doubled every two years (starting with the recommended 1000 iterations in the year 2000 when [PKCS #5](http://tools.ietf.org/html/rfc2898) was released). ...
Can I dynamically calculate an appropriate number of iterations for PBKDF2 based on the system time, rather than using a fixed value?
In a [recent article](http://www.theguardian.com/world/2013/sep/05/nsa-how-to-remain-secure-surveillance), Bruce Schneier suggested that he prefers classic discrete log crypto over ECC because ["I no longer trust the constants. I believe the NSA has manipulated them through their relationships with industry."](https://...
In an *exponential ElGamal encryption scheme* where the key generation is done in a distributed way among $n$ trustees we have that each trustee $i$ (where $1 \leq i \leq n$): 1. Selects a private key share $x_i \in \mathbb{Z}_q^{\star}$. 2. Computes a public key share $h_i = g^{x_i} \mbox{ mod } p$, where $g$ ...
I was just wondering if I add more security by combining two or more symmetric encryptions on a plain text. For Example: Plaintext -> AES -> Twofish -> Serpent Of course a different key and IV (produced with a cryptographic secure prng) is used for each algorithm. Speed fortunately is not important. Or does...
Combining multiple symmentric encryption algorithms - implications?
Combining multiple symmetric encryption algorithms - implications?
How are the exponents $a$ and $b$ selected? In case they are private/public keys of the two users then changing the generator will change $a$ or $b$ as well.
Say I have a function that calculates a pseudo random permutation and this function is easy to invert. For example: P(i) = AES(k, i) where k is a publicly known key. So anyone can compute `P(i)` and also get back `i` if `P(i)` is known. Would the following function be hard to invert? F(i) = P(i) ...
Why is salsa20 secure?
I have a very simple compression function, which looks like this in C++: unsigned long long compress(unsigned long long current_block, unsigned long long last){ for(int i = 0; i<16; i++){ last += current_block; last = last ^ (last << 13); last = last ^ (last >> 11); } ...
I have a very simple compression function, which looks like this in C++: unsigned long long compress(unsigned long long current_block, unsigned long long last){ for(int i = 0; i<16; i++){ last += current_block; last = last ^ (last << 13); last = last ^ (last >> 11); } ...
Suppose A has at some point in time produced ciphertext C from message M with key K. Suppose A has then passed C to B, who stored it and passed it to a third party D, who also possesses K and decrypts to get M, and based on M, performs certain operations. Assume that D has no contact with A and B. Now A is ince...
Is the Salsa20 construction secure in general?
Say I have a function that calculates a pseudo random permutation and this function is easy to invert. For example $P(i) = AES_k(i)$ where $k$ is a publicly known key. So anyone can compute $P(i)$ and also get back $i$ if $P(i)$ is known. Would the following function be hard to invert? $$F(i) = P(i) \oplus i$$...
Suppose Alice has at some point in time produced ciphertext $C$ from message $M$ with key $k$. Suppose Alice has then passed $C$ to Bob, who stored it and passed it to a third party Dave, who also possesses $k$ and decrypts to get $M$, and based on $M$, performs certain operations. Assume that Dave has no contact ...
Suppose Alice has at some point in time produced ciphertext $C$ from message $M$ with key $k$. Suppose Alice has then passed $C$ to Bob, and also made a commitment to her key $k$ (thanks to nightcracker for this addition). Bob then stored it and passed it to a third party Dave, who also possesses $k$ and decrypts ...
Differential cryptanalysis works on _differences_. Linear cryptanalysis works on _linearity_. Neat, isn't it ? Instead of speaking of how they _differ_, it is easier to list their common features. Both kinds of attacks: - Use a lot of known pairs plaintext/ciphertext (many input messages encrypted with the same ...
what is the main differences between **linear cryptanalysis** and **differential cryptanalysis** which is related with the **DES**? I want to know only differences between these two.
Salsa20 in Davies-Meyer mode with a fixed key (message): is it one-way?
What is the ideal cipher model? What assumptions does it make about a block cipher? How does it relate to assuming that my block cipher is a pseudo-random permutation (PRP)? When is the ideal cipher model appropriate to use? How do I tell whether a particular block cipher can reasonably be modelled using the ideal ...
What is the ideal cipher model?
What is the main difference between *"linear cryptanalysis"* and *"differential cryptanalysis"*? For example in relation to *"DES"*?
What is the difference between "linear cryptanalysis" and "differential cryptanalysis"?
What is the main difference between linear cryptanalysis and differential cryptanalysis? For example in relation to DES?
1. What is the ideal cipher model? 2. What assumptions does it make about a block cipher? 3. How does it relate to assuming that my block cipher is a pseudo-random permutation (PRP)? 4. When is the ideal cipher model appropriate to use? 5. How do I tell whether a particular block cipher can reasonably be mode...
I would like an $\operatorname{HMAC}$ that's based on two different hash functions ($H_1$ and $H_2$), so that a break of the combined $\operatorname{HMAC}$ would imply a break of $\operatorname{HMAC}(H_1)$ and of $\operatorname{HMAC}(H_2)$. The combined HMACs in TLS and SSL have attempted to achieve this property, but...
I would like an $\operatorname{HMAC}$ that's based on two different hash functions ($H_1$ and $H_2$), so that a break of the combined $\operatorname{HMAC}$ would imply a break of $\operatorname{HMAC}(H_1)$ and of $\operatorname{HMAC}(H_2)$. The combined HMACs in TLS and SSL have attempted to achieve this property, but...
Why does openssl BN_generate_prime return only a fraction of the safe primes within the given bit range?
The smallest safe prime you got from OpenSSL was 3221226167 = 0xC00002B7. The largest was 4294967087 = 0xFFFFFF2F. This makes me hypothesize that OpenSSL is setting the two high bits to one, and choosing the rest of the bits randomly. If that is accurate, that would explain the range of primes you did. As far as ...
The smallest safe prime you got from OpenSSL was 3221226167 = 0xC00002B7. The largest was 4294967087 = 0xFFFFFF2F. This makes me hypothesize that OpenSSL is setting the two high bits to one, and choosing the rest of the bits randomly. If that is accurate, that would explain the range of primes you did. As far as ...
I believe the basic idea is the following: <br><br><br> Choose $m$ so that $\: \sum p_i \:$ can be efficiently recovered from $\; \operatorname{mod}\left(\sum p_i\hspace{.03 in},m\right) \:\:$. Each party $i$ chooses $\:n\hspace{-0.03 in}-\hspace{-0.04 in}1\:$ elements $\:q_{i,\hspace{.03 in}j}\:$ of $\:\{0,\hspac...
for example, i want to encrypt p1, p2 with CBC. However i use p2 as iv of CBC what risk is coming not using random number for iv?
what is dangerous to use plaintext as iv in CBC?
Is it dangerous to use plaintext as IV in CBC? For example: I want to encrypt $p1$, $p2$ with CBC. However I use $p2$ as the IV for CBC purposes. What would be the risk of not using a IV based on random number(s)?
Is it dangerous to use plaintext as IV in CBC?
I'm taking up a cryptography class and this is for an assignment. We're asked to find the differences between AES/RSA in the different modes of operation vs the one timepad method. 1. From wiki, I can see that in all the different modes of operation(Eg CBC), the ek(encryption) is done. However, not much is said abou...
When cryptographers create algorithms, they usually provide some argument that the algorithm is secure. They need to start the argument with some set of assumptions. For example, the in public-key cryptography, they may begin with the assumption that factoring large numbers is hard. Many algorithms use use a block c...
Despite the fact that Marsaglia's MWC RNG (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 CSRNG (cryptographically secure random number generator) even though it passes several statistical randomness tests, including *ENT* and *Die-...
What stops the MWC RNG from being a CSPRNG?
Despite the fact that Marsaglia's MWC RNG (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* a...
When cryptographers create algorithms, they usually provide some argument that the algorithm is secure. They need to start the argument with some set of assumptions. For example, the in public-key cryptography, they may begin with the assumption that factoring large numbers is hard. Many algorithms use use a block c...
When cryptographers create algorithms, they usually provide some argument that the algorithm is secure. They need to start the argument with some set of assumptions. For example, the in public-key cryptography, they may begin with the assumption that factoring large numbers is hard. Many algorithms use use a block c...
When cryptographers create algorithms, they usually provide some argument that the algorithm is secure. They need to start the argument with some set of assumptions. For example, the in public-key cryptography, they may begin with the assumption that factoring large numbers is hard. Many algorithms use use a block c...
If I want to protect myself from implementation of algorithm issues and inherent design flaws of algorithms in password hashing, what would be most secure way to combine two hashes? 1. bcrypt(pbkdf2(pw)) 2. pbkdf2(bcrypt(pw)) 3. f, l = split(pw); pw = bcrypt(f) + pbkdf2(l) 4. pw = bcrypt(pw) + pbkdf2(pw) ## p...
If I want to protect myself from implementation of algorithm issues and inherent design flaws of algorithms in password hashing, what would be most secure way to combine two hashes? 1. bcrypt(pbkdf2(pw)) 2. pbkdf2(bcrypt(pw)) 3. f, l = split(pw); pw = bcrypt(f) + pbkdf2(l) # loses entropy, bad 4. pw = bcrypt...
You have two algorithms, $A$ and $B$, that claim to compute two (essentially) injective, hard-to-invert and costly-to-compute functions $F$ and $G$. Your fear is that either of the algorithms instead compute functions $F'$ and $G'$, that may be neither injective, hard-to-invert, nor costly-to-compute. This may happen b...
I've just started a cryptography course. I am beginning to understand the concepts (I'm only in week 2) but I just can't get my head around the theories and principles when written as equations. I've been posed the below question to answer: Consider a very simple symmetric block encryption algorithm in which ...
You have two algorithms, $A$ and $B$, that claim to compute two (essentially) injective, hard-to-invert and costly-to-compute functions $F$ and $G$. Your fear is that either of the algorithms instead compute functions $F'$ and $G'$, that may be neither injective, hard-to-invert, nor costly-to-compute. This may happen b...
I've just started a cryptography course. I am beginning to understand the concepts (I'm only in week 2) but I just can't get my head around the theories and principles when written as equations. I've been posed the below question to answer: > Consider a very simple symmetric block encryption algorithm in which...
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* ...
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* ...
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* ...
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* ...
Why isn't this best practice? Because it adds needless complexity. It solves a problem we don't have. The odds of a cryptanalytic breakthrough that yields a shortcut attack on bcrypt or PBKDF2 is... slim to none. It's very unlikely that the mathematics of bcrypt/PBKDF2 are going to be the weakest link in your syste...
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've just started a [cryptography course][1]. I am beginning to understand the concepts (I'm only in week 2) but I just can't get my head around the theories and principles when written as equations. I've been posed the below question to answer: > Consider a very simple symmetric block encryption algorithm in ...
After looking at [this][1] security issue, I started to think in a password-based authentication that places the burden of PBKDF2 (or whatever is the hashing function) on the client. So I came up with the following scheme: When the user types the password, the client software (browser or whatever) hashes the passwor...
After looking at [this security issue at DjangoProject][1], I started to think in a password-based authentication that places the burden of PBKDF2 (or whatever is the hashing function) on the client. So I came up with the following scheme: When the user types the password, the client software (browser or whatever) h...
When cryptographers create algorithms, they usually provide some argument that the algorithm is secure. They need to start the argument with some set of assumptions. For example, the in public-key cryptography, they may begin with the assumption that factoring large numbers is hard. Many algorithms use use a block c...
When cryptographers create algorithms, they usually provide some argument that the algorithm is secure. They need to start the argument with some set of assumptions. For example, the in public-key cryptography, they may begin with the assumption that factoring large numbers is hard. Many algorithms use use a block c...
An encryption system in which the sender and receiver of a message share a single, common key that is used to encrypt and decrypt the message is symmetric key cryptography. Is the key public or it is secret? how sender and receiver both know the key?
how key is share in symmetric key cryptography?
As far as I know, SSH2 first does a key exchange based on the server host key and brings up transport authentication and encryption derived from this kex. The real authentication (password or public key) is done over this secure transport. If you set the cipher to 'none', you wouldn't want to allow password authenti...
Is SSH public key authentication weakened by 'none' cipher?
What is the precise meaning or relation between the following terms: 1) Universal hash family 2) Pairwise independent hash functions 3) 2-Universal hash family 4) strongly universal hash family 5) delta-Universal hash family. If any of these terms are equal kindly discuss in what way? If any one of these sets is ...
Say I am using a random key to construct a stream cipher with, say, AES in CTR mode, which will never be used to encrypt more than one data stream. Is there any advantage, no matter how small, to using a random IV instead of an IV of zero? I repeat, the key will never be used twice.
I read that Silver–Pohlig–Hellman algorithm solves the discrete logarithm with prime module $p$ in $O(\log^2(p))$ if $p-1$ is a smooth number. This seems pretty fatal for cryptography, since it is a polynomial over the key length, right? So my questions are: 1. How probable is this to happen? 2. (How) can it be ...
Has any work been done on analyzing the SHA3 sponge construction for use as an entropy pool (e.g. `/dev/random`)? All the use cases I've heard of consts of a sequence of input operations followed by a sequence of output operations where as an entropy pool would require security to be maintained for any sequence of i...
Who uses [RSA's BSAFE library](http://www.emc.com/security/rsa-bsafe.htm)? Does anyone know what products use it, or have any statistics on how many end users use something that is built on BSAFE? Background: BSAFE is one of the oldest cryptography libraries, and among commercially available cryptographic libraries...
Who uses the RSA BSAFE library?
It has been [well known for a long time][1] that NSA played a primary role in the development of the Digital Signature Algorithm (DSA). DSA is a sort of hybrid of the ElGamal and Schnorr signature schemes. My question is this. Based on what we know now, why did NSA invent a new scheme rather than just adopt ElGam...
when i reading about this [paper][1], in the `Setup of SIM` **section 5.2**, it says that "According to the definition of PFS game", i wonder what the definition of PFS game is? [1]: http://isyou.info/jisis/vol1/no23/jisis-2011-vol1-no23-03.pdf
what is PFS game?
First of all, there is a difference between writing to `/dev/random` and/or `/dev/urandom` and *increasing the entropy count maintained in the Kernel*. This is the reasony why, by default, `/dev/random` is world-writable - any input will only augment, but never replace the internal state of the RNG; if you write com...
Let's assume that the Intel RDRAND instruction does not return fully random numbers, e.g. because it has been engineered with a backdoor for the NSA. If the Intel RDRAND instruction is used directly by a software implementation, what post-processing could be performed to make sure that the output would be indistingu...
Symmetric key cryptography is an encryption system in which the sender and receiver of a message share a single, common key that is used to encrypt and decrypt the message. Is the key public or it is secret? How can the sender and the receiver both know the key?
How is the key shared in symmetric key cryptography?
I'm currently in the planning phase of an authentication and storage-ish service. The client needs a file ("ENCFILE") which he will work with. This file will be encrypted with AES256, and stored on the server. In order to authenticate and download the file, and decrypt it, the user will need: 1. A username 2....
What is the probability of the first N hash digits colliding? for example i made a [script][1] that appends the first 5 digits of the file's sha1 hash to the name of the file. So will the probability of a collision be 16^5=1048576? Am i properly calculating the probability of a collision. [1]: https://gist....
First of all, there is a difference between writing to `/dev/random` and/or `/dev/urandom` and *increasing the entropy count maintained in the Kernel*. This is the reasony why, by default, `/dev/random` is world-writable - any input will only augment, but never replace the internal state of the RNG; if you write com...
Here's the question: For example, if I have a bit stream that is 64K bytes long and there is about 16 *8 bits worth of entropy randomly dispersed in that byte stream, so I have 16*8 bits worth of entropy. However, if I SHA256 that byte stream, I will now only have 32 bytes total rather than 64K bytes. Some...
How much entropy is lost via hashing?
Here's the question: For example, if I have a bit stream that is 64K bytes long and there is about 16 *8 bits worth of entropy randomly dispersed in that byte stream, so I have 16*8 bits worth of entropy. However, if I SHA256 that byte stream, I will now only have 32 bytes total rather than 64K bytes. Some...
Best ways to estimate avg bits of entropy in a byte stream. I know there are different statistical tests out there (nist, dieharder, nsa, etc), which all do different ways of analyzing entropy. In particular, they will estimate the "p" value, which I believe is often a result of the Shannon Entropy. What I'm ha...
Here's the question: For example, if I have a bit stream that is 64K bytes long and there is about 16 *8 bits worth of entropy randomly dispersed in that byte stream, so I have 16*8 bits worth of entropy. However, if I SHA256 that byte stream, I will now only have 32 bytes total rather than 64K bytes. Some...
wikipedia's article on [RSA blind signatures][1] says that you need to raise the message m to the secret exponent d modulo the public modulus N. Implicit within that, it seems to me, is that m needs to be less than N. Problem with that is that that's not a restriction imposed upon signatures. So for blind signatu...
(I updated the title, as I think there was some confusion as to the question) Here's the question: For example, if I have a bit stream that is 64K bytes long and there is about 16 *8 bits worth of entropy randomly dispersed in that byte stream, so I have 16*8 bits worth of entropy. However, if I SHA256 that b...
How much entropy is lost via hashing when you add known or low entropy data?
(I updated the title, as I think there was some confusion as to the question) Here's the question: For example, if I have a bit stream that is 64K bytes long and there is about 16 *8 bits worth of entropy randomly dispersed in that byte stream, so I have 16*8 bits worth of entropy. However, if I SHA256 that b...
*Entropy is a function of the distribution.* That is, the process used to generate a byte stream is what has entropy, not the byte stream itself. If I give you the bits 1011, that could have four bits of entropy or it could have zero. In fact, it only has one bit of entropy, but you have no way of verifying that. He...
Wikipedia's article on [RSA blind signatures][1] says that you need to raise the message $m$ to the secret exponent $d$ modulo the public modulus $N$. Implicit within that, it seems to me, is that m needs to be less than $N$. Problem with that is that that's not a restriction imposed upon signatures. So for blind...
I was trying to understand cryptography from Information Seurity book by mark stamp and I am confused by a question: The question is : Suppose that Alice has a secure block cipher, but the cipher only uses an 8-bit key. To make this cipher "more secure," Alice generates a random 64-bit key K, and iterates the c...
Encrypting 8 times with 8 bit key beneficial?