instruction
stringlengths
15
30k
How to distribute session keys in public key cryptography?
In a Feistel cipher (as shown below), it seems that the security of the cipher would be entirely dependent upon the function $F$. What requirements on $F$ are necessary for a secure Feistel cipher? Is there any relationship between the function $F$ and the number of rounds necessary to have a secure cipher? ![Feiste...
Are there any specific requirements for the function $F$ in a Feistel cipher?
It may be an interesting avenue to explore. I've read the highlight reel of the digital cash literature but I do not know it well enough to know how well these issues have been addressed. A few things to consider for #2: 1. In a quick read of Lucre, it seems that the payee does no verification before passing th...
Having taken [The Design of Rijndael][1] from the library just yesterday, I had a look on this problem, too. Fixee wrote in a comment: > However, my question is not so much about security implications, but rather > "how does omissions of MixColumns make the inverse cipher similar to the cipher?" > and "how does th...
I've got an application (detailed below) that calls for the use of a cipher that is commutative. I've been doing some googling & reading, and there are two algorithms that seem to get mentioned in these discussions--SRA (*not* RSA) and Pohlig-Hellman exponentiation. (Supposedly SRA is a variant of RSA?). I need some...
software implementation of a commutative cipher?
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 password as the PRNG-seed)*. The other half is that given a s...
To clarify a little, you need "encryption" that is commutative, deterministic (otherwise the commutative ciphertexts won't necessarily match even if the plaintexts do), and has a private encryption function (otherwise given that it is deterministic and the plaintext space is small, an exhaustive search would be possibl...
Say I have an authentication protocol where the shared secret is never transmitted. The server passes a challenge to the client and the client calculates a response using an algorithm where the challenge and the secret is used. When choosing the algorithm, what are the benefits and drawbacks of using either a hash (...
Say I have an authentication protocol where the shared secret is never transmitted. The server passes a challenge to the client and the client calculates a response using an algorithm where the challenge and the secret is used. When choosing the algorithm, what are the benefits and drawbacks of using either a hash (...
Say I have an authentication protocol where the shared secret is never transmitted. The server passes a challenge to the client and the client calculates a response using an algorithm where the challenge and the secret is used. When choosing the algorithm, what are the benefits and drawbacks of using either a hash...
Hash or encryption function for challenge-response protocol?
I have designed an SQL aggregate function in Oracle that bitwise XORs all MD5 sums of the values stored in a column. For example, if my table is: +-----+----------+---------+ | Key | Sequence | Value | +-----+----------+---------+ | 1 | 1 | 'Hello' | | 1 | 2 | 'World' |...
Is it a good idea to use bitwise XOR on a set of MD5 sums?
About **difficulty of insuring that $p-1$ is not smooth**: it is easy 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 prime candidates $p=2 \cdot k \cdot p_1+1$, for consecutive $k$ such that $p$ is of app...
There are two points to consider here: **How likely is it that two different strings give the same MD5 hash?** This is known as a hash collision. A good hash function makes this probability as small as possible (this would be about $1/2^{128}$ for MD5). If you have a larger number of strings to hash, the probabil...
I have designed an SQL aggregate function in Oracle that bitwise XORs all MD5 sums of the values stored in a column. For example, if my table is: +-----+----------+---------+ | Key | Sequence | Value | +-----+----------+---------+ | 1 | 1 | 'Hello' | | 1 | 2 | 'World' |...
I am a beginner in cryptography, I designed an Password Based encryption-decryption algorithm which uses a random salt and a password to encrypt a message. I'm using SHA-512 for hashing, matrix operations for shuffling, bitwise XOR for mixing data and retrieving. The length of the salt and the cipher text is 256...
How to implement avalanche effect?
I am a beginner in cryptography. I designed an password based encryption-decryption algorithm, which uses a random salt and a password to encrypt a message. I'm using SHA-512 for hashing, matrix operations for shuffling, bitwise XOR for mixing data and retrieving. The length of the salt and the ciphertext is 256 ...
How can I make my cipher show the avalanche effect?
I am a beginner in cryptography. I designed an password based encryption-decryption algorithm, which uses a random salt and a password to encrypt a message. I'm using SHA-512 for hashing, matrix operations for shuffling, bitwise XOR for mixing data and retrieving. The length of the salt and the ciphertext is 256 letter...
I have designed an SQL aggregate function in Oracle that bitwise XORs all MD5 sums of the values stored in a column. For example, if my table is: +-----+----------+---------+ | Key | Sequence | Value | +-----+----------+---------+ | 1 | 1 | 'Hello' | | 1 | 2 | 'World' |...
There are two points to consider here: **How likely is it that two different strings give the same MD5 hash?** This is known as a hash collision. A good hash function makes this probability as small as possible (this would be about $1/2^{128}$ for MD5). If you have a larger number of strings to hash, the probabil...
To clarify a little, you need "encryption" that is commutative, deterministic (otherwise the commutative ciphertexts won't necessarily match even if the plaintexts do), and has a private encryption function (otherwise given that it is deterministic and the plaintext space is small, an exhaustive search would be possibl...
I have designed an SQL aggregate function in Oracle that bitwise XORs all MD5 sums of the values stored in a column. For example, if my table is: +-----+----------+---------+ | Key | Sequence | Value | +-----+----------+---------+ | 1 | 1 | 'Hello' | | 1 | 2 | 'World' |...
I've got an application (detailed below) that calls for the use of a cipher that is commutative. I've been doing some googling & reading, and there are two algorithms that seem to get mentioned in these discussions--SRA (*not* RSA) and Pohlig-Hellman exponentiation. (Supposedly SRA is a variant of RSA?). I need some...
Software implementation of a commutative cipher?
How would you generate a list of unique random numbers - alpha numeric, fixed length?
I quote Bobby's question here since I encountered the same one... http://crypto.stackexchange.com/questions/1199/random-coin-flip-using-elgamal-and-a-trusted-party Consider the following protocol for two parties to flip a fair coin. Trusted party T publishes her public key pk A chooses a random bit b_A, enc...
I quote Bobby's question here since I encountered the same one... http://crypto.stackexchange.com/questions/1199/random-coin-flip-using-elgamal-and-a-trusted-party Consider the following protocol for two parties to flip a fair coin. Trusted party T publishes her public key pk A chooses a random bit b_A, enc...
In RSA, suppose we know that e=N and we are given the value of e. (N = p*q for some large primes p and q; gcd(e, φ(N) = 1) Can we calculate d (d = e^(-1) mod φ(N)) without factoring N?
I quote Bobby's question here since I encountered the same one... http://crypto.stackexchange.com/questions/1199/random-coin-flip-using-elgamal-and-a-trusted-party Consider the following protocol for two parties to flip a fair coin. 1. Trusted party $T$ publishes her public key $K_{pub}$ 2. $A$ chooses a ra...
In RSA, suppose we know that $e=N$ and we are given the value of $e$. ($N = p\cdot q$ for some large primes $p$ and $q$; $\gcd(e, \varphi(N) = 1)$ Can we calculate $d$ ($d = e^{-1} \mod \varphi(N)$) without factoring $N$?
I take the definition of _safe prime_ as: a prime $p$ is _safe_ when $(p-1)/2$ is prime. Safe primes of appropriate size are the standard choice for the modulus of cryptosystems related to the discrete logarithm problem, such as [Diffie-Hellman][1]. A modulus $p=2^k \pm s$ with $s$ small makes exponentiation $\bm...
Are safe primes $p=2^k \pm s$ with $s$ small less recommandable than others as a discrete log modulus?
I take the definition of _safe prime_ as: a prime $p$ is _safe_ when $(p-1)/2$ is prime. Safe primes of appropriate size are the standard choice for the modulus of cryptosystems related to the discrete logarithm problem, such as [Diffie-Hellman][1]. A modulus $p=2^k \pm s$ with $s$ small makes exponentiation $\bm...
In [RSA][1], suppose we know that $e=N$ and we are given the value of $e$. ($N = p\cdot q$ for some large primes $p$ and $q$; $\gcd(e, \varphi(N) = 1)$ Can we calculate $d$ ($d = e^{-1} \mod \varphi(N)$) without factoring $N$? [1]: http://en.wikipedia.org/wiki/RSA_%28algorithm%29
What is the property of RSA where N=e?
I quote Bobby's question here since I encountered the same one... http://crypto.stackexchange.com/questions/1199/random-coin-flip-using-elgamal-and-a-trusted-party Consider the following protocol for two parties to flip a fair coin. 1. Trusted party $T$ publishes her public key $K_{pub}$ 2. $A$ chooses a ra...
What is the appropriate public key encryption for secure coin flipping?
I am creating a service that will return an set of objects that will be used by multiple systems. At the end of the process one (or more) of the objects will be sent back to our system for association. My service basically checks our system and gets valid solutions. I want to create a hash to validate that the obj...
Out of the below two random bit generators, which is more cryptographically stronger? 1. HMAC-DRBG 2. HASH-DRBG Is there any other criteria to select between these two?
A secret [_even_ permutation][1] $P$ of the set of non-negative integers less than $n$ is chosen. That might be a [Feisltel cipher][2] with a random key. We are given in sequence the $P(x)$ for $x$ from $0$ to $n-3$, and must output the ordered pair $(P(n-2),P(n-1))$. How do we efficiently do that? What’s a pract...
How do we find the last two correspondences in an otherwise known even permutation?
Out of the below two random bit generators, which is more cryptographically stronger? 1. HMAC-DRBG 2. HASH-DRBG Is there any other criteria to select between these two? Edit: These Deterministic Random Bit Generators are defined in [NIST Pub 800-90][1] [1]: http://csrc.nist.gov/publications/nistpubs/...
Out of the below two random bit generators, which is more cryptographically stronger? 1. HMAC-DRBG 2. HASH-DRBG Is there any other criteria to select between these two? Edit: These Deterministic Random Bit Generators are defined in [NIST SP 800-90][1] [1]: http://csrc.nist.gov/publications/nistpubs/8...
Out of the below two random bit generators, which is more cryptographically stronger? 1. HMAC-DRBG 2. Hash-DRBG Is there any other criteria to select between these two? Edit: these Deterministic Random Bit Generators are defined in [NIST SP 800-90][1]. [1]: http://csrc.nist.gov/publications/nistpubs/...
Out of the following two Deterministic Random Bit Generators, which is cryptographically stronger? 1. HMAC-DRBG 2. Hash-DRBG Is there any other criteria to select between these two? Edit: these are defined in [NIST SP 800-90][1]. [1]: http://csrc.nist.gov/publications/nistpubs/800-90/SP800-90revised_...
A secret [_even_ permutation][1] $P$ of the set of non-negative integers less than $n$ is chosen. That might be a [Feisltel cipher][2] with a random key. We are given in sequence the $P(x)$ for $x$ from $0$ to $n-3$, and must output the ordered pair $(P(n-2),P(n-1))$. How do we efficiently do that? What’s a pract...
A secret [_even_ permutation][1] $P$ of the set of non-negative integers less than $n$ is chosen. That might be a [Feisltel cipher][2] with a random key. We are given in sequence the $P(x)$ for $x$ from $0$ to $n-3$, and must output the ordered pair $(P(n-2),P(n-1))$. How do we efficiently do that? What’s a pract...
A secret [_even_ permutation][1] $P$ of the set of non-negative integers less than $n$ is chosen. That might be a [Feisltel cipher][2] with a random key. We are given in sequence the $P(x)$ for $x$ from $0$ to $n-3$, and must output the ordered pair $(P(n-2),P(n-1))$. What's an efficient [online algorithm][3] for...
Having taken [The Design of Rijndael][1] from the library just yesterday, I had a look on this problem, too. Fixee wrote in a comment: > However, my question is not so much about security implications, but rather > "how does omissions of MixColumns make the inverse cipher similar to the cipher?" > and "how does th...
How can we generalize the conversion of Diffie-Hellman to El Gamal public-key encryption scheme? The goals is to be eventually able to show that any 2-round key-exchange protocol can be converted into a public encryption scheme that is CPA-secure. The 2-round key-exchange protocol mentioned should satisfy the requir...
I quote Bobby's question here since I encountered the same one... http://crypto.stackexchange.com/questions/1199/random-coin-flip-using-elgamal-and-a-trusted-party Consider the following protocol for two parties to flip a fair coin. 1. Trusted party $T$ publishes her public key $K_{pub}$ 2. $A$ chooses a ra...
I am creating a service that will return an set of objects, which will be used by multiple systems. At the end of the process, one (or more) of the objects will be sent back to our system for association. My service basically checks our system and gets valid solutions. I want to create a hash to validate that the ...
Is a using salt important when creating a hash data validator?
Out of the two deterministic random bit generators defined in section 10.1 of [NIST SP 800-90][1] (i.e. based on hash functions), which one is cryptographically stronger? 1. Hash-DRBG (Section 10.1.1) 2. HMAC-DRBG (Section 10.1.2) Is there any other criteria to select between these two? [1]: http://csrc.n...
Is HMAC-DRBG or Hash-DRBG stronger?
The conversion of Diffie-Hellmen into Elgamal is assisted by a few factors that are not inherent to key exchange/agreement protocols in general, but a general conversion may be possible. **The DH $\rightarrow$ Elgamal case.** In Diffie-Hellman, Alice generates $a$ and sends a representation of it: $g^a$. Bob generat...
The conversion of Diffie-Hellmen into Elgamal is assisted by a few factors that are not inherent to key exchange/agreement protocols in general, but a general conversion may be possible. **The DH $\rightarrow$ Elgamal case.** In Diffie-Hellman, Alice generates $a$ and sends a representation of it: $g^a$. Bob generat...
I'm trying to calculate how many possible combinations of files there can be using a signed 64-bit file length, but can't seem to find a formula (or I'm using the wrong keywords). For example, the number of unique files that have a length of 256 bytes is $2^{256*8}$ = $2^{4096}$. I assume the total number of combinatio...
How many possible combinations of input files are possible using a 63-bit length?
I'm trying to calculate how many possible combinations of files there can be using a signed 64-bit file length, but can't seem to find a formula (or I'm using the wrong keywords). For example, the number of unique files that have a length of 256 bytes is $2^{256*8}$ = $2^{2048}$. I assume the total number of combinatio...
I recently learned about the hashing algorithm [bcrypt][1], which allows you to specify a "work factor" for the hash which can be incremented to stay ahead of Moore's Law. I understand there are some other hashing algorithms that also do this. Are there any two-way encryption algorithms with this property? For examp...
Are there two-way encryption algorithms that include a work factor?
1.) Proving the security of a scheme with the ROM takes two steps; first you prove that the sceme is secure in this idealized world where a random oracle exists and then you implement this scheme in the real world by replacing the RO with a hash function. Why wouldn't you prove the security of the scheme with the hash ...
I was wondering whether RSA can be cracked given: - The public key - A plaintext of a known cipher text(s). In other words the decrypted message from an encrypted one (but without knowing the private key) I.E.: you have managed to find the plaintext of an already encrypted message using th...
It depends on what you mean by "cracking", and also what you mean by "RSA". "Plain RSA", also sometimes described as "textbook RSA", is the lone modular exponentiation. By itself, it is very weak. For instance, if $n$ is the modulus and $e$ the public exponent, suppose that you want to "decrypt" a cipher text $c_1$ ...
Your second question was about programmability. This hasn't been directly addressed yet by @Thomas' answer or the comments, so I'll focus on that question only. Unfortunately I don't know of a simple primitive that is secure in the random oracle model that requires programmability, but I'll use one that is hopefully cl...
This question is regarding implementation of HASH_DRBG algorithm. As per NIST SP800 90 document for HASH DRBG Generation , section 10.4.1 "Derivation Function Using a Hash Function (Hash_df)" The Hash_df algorithm says "4.1 temp = temp || Hash (counter || no_of_bits_to_return || input_string)." I believe || ...
NIST SP800 90 Hash_df binary or ascii to be used?
Section 8, Security considerations, of [RFC3526](http://www.ietf.org/rfc/rfc3526.txt), which defines groups used for Diffie-Hellman has a table recommending some random exponent sizes. In particular, it says: - The strength of a key exchanged using the 1536 bit group has - about 90 bits strength for a 180 bit r...
Why are the random exponents so much bigger in the Socialist Millionaire protocol versus Diffie-Hellman key exchange?
Binary or ascii to be used in the hash function?
This question is regarding implementation of HASH_DRBG algorithm. As per NIST SP800 90 document for HASH DRBG Generation , section 10.4.1 "Derivation Function Using a Hash Function (Hash_df)" The Hash_df algorithm says "4.1 temp = temp || Hash (counter || no_of_bits_to_return || input_string)." I believe || ...
I was wondering whether plain RSA encryption can be cracked given: - The public key - A plaintext of a known cipher text(s). In other words the decrypted message from an encrypted one (but without knowing the private key) I.E.: you have managed to find the plaintext of an already encrypted...
**For Diffie-Hellman**, adequate security is achieved provided that: - we work modulo a prime $p$ big enough to resist discrete logarithm (1536 bits are sufficient); - the order of the subgroup generated by $g$ is a multiple of a big-enough prime integer $q$ ($q$ should have length $2n$ bits to achieve $2^n$ secu...
Is it safe to store initial counter value for AES-CTR alongside with ciphertext?
I'm working on problem 12.4 from Katz-Lindell. The problem is as follows: Given a public encoding function 'enc' and a textbook RSA signature scheme where signing occurs by finding enc(m) and raising it to the private key 'd' mod N, how can we demonstrate the scheme's insecurity for enc(m) = 0||m||0^(L/10) , where L...
I'm working on problem 12.4 from [Katz-Lindell][1]. The problem is as follows: > Given a public encoding function $\newcommand{\enc}{\operatorname{enc}}\enc$ and > a textbook RSA signature scheme where signing occurs by finding $\enc(m)$ and > raising it to the private key $d \bmod N$, how can we demonstrate the s...
I'm working on problem 12.4 from [Katz-Lindell][1]. The problem is as follows: > Given a public encoding function $\newcommand{\enc}{\operatorname{enc}}\enc$ and > a textbook RSA signature scheme where signing occurs by finding $\enc(m)$ and > raising it to the private key $d \bmod N$, how can we demonstrate the s...
For RSA and El Gamal (and most other public key cryptosystems), one of the key ideas is that factoring and finding discrete logs are hard. There are other systems that rely on certain properties of lattices. What are the other one-way-ish functions that have cryptosystems designed around them?
Your second question was about programmability. This hasn't been directly addressed yet by @Thomas' answer or the comments, so I'll focus on that question only. Unfortunately I don't know of a simple primitive that is secure in the random oracle model that requires programmability, but I'll use one that is hopefully cl...
I'm implementing the HASH_DRBG algorithm. As per [NIST-SP800 90][1] document for HASH DRBG Generation, section 10.4.1 "Derivation Function Using a Hash Function (Hash_df)", the Hash_df algorithm contains this step 4.1: > temp = temp || Hash (counter || no_of_bits_to_return || input_string). I believe || here r...
Does hash_df use binary or an ASCII hexadecimal representation for numbers to be passed to the hash function?
MD5, like other hash functions, uses the [Merkle-Damgard][1] construction. You take the message and break it up into fixed-size blocks. You start with an intialization vector (IV), which you feed into a compression function along with the first block. Take the output (it will be the same length as the IV), and feed it ...
i understand the need for padding in MD5, but why do we append the message length to the padding, i heard it strengthens the hash but how, please provide an example if possible and how it applies to this quote "The inclusion of the length-block effectively encodes all messages such that no encoded input is the tail ...
I understand the need for padding in MD5. But why do we append the message length to the padding? I heard it strengthens the hash but how? Please provide an example if possible and how it applies to this quote: > The inclusion of the length-block effectively encodes all messages such > that no encoded input i...
Why does the padding in MD5 contain the message length?
An RSA signature scheme with public key $(n,e)$, private exponent $d$, and encoding function $enc$ (including but not limited to that in the question), signs message $m$ as $$Sign(m) = enc(m)^d\bmod n$$ Such scheme is insecure if an adversary can figure out $k>0$ distinct messages $m_i$, and integers $u_i$, $r$, $s$...
MD5, like other hash functions, uses the [Merkle-Damgard][1] construction. You take the message and break it up into fixed-size blocks. You start with an intialization vector (IV), which you feed into a compression function along with the first block. Take the output (it will be the same length as the IV), and feed it ...
An RSA signature scheme with public key $(n,e)$, private exponent $d$, and encoding function $enc$ (including but not limited to the question's $enc$), signs message $m$ as $$Sign(m) = enc(m)^d\bmod n$$ Such scheme is insecure if an adversary can figure out $k>0$ distinct messages $m_i$, and integers $u_i$, $r$, $s$...
An RSA signature scheme with public key $(n,e)$, private exponent $d$, and encoding function $enc$ (including but not limited to the question's $enc$), signs message $m$ as $$Sign(m) = enc(m)^d\bmod n$$ Such scheme is insecure if an adversary can figure out $k>0$ distinct messages $m_i$, and integers $u_i$, $r$, $s$...
MD5, like other hash functions, uses the [Merkle-Damgard][1] construction. You take the message and break it up into fixed-size blocks. You start with an intialization vector (IV), which you feed into a compression function along with the first block. Take the output (it will be the same length as the IV), and feed it ...
The [Merkle–Damgård hash construction][1] customarily pads the message to be hashed with a single bit set to 1, a minimal number of bit(s) set to 0, and the representation of the length of the message in binary over some fixed number of bits. The padded message is then formed of a number of blocks $B_i$. The hash is co...
The [Merkle–Damgård hash construction][1] customarily pads the message $M$ to be hashed with a single bit set to 1, a minimal number of bit(s) set to 0, and the representation of the length of the message in binary over some fixed number of bits. The padded message is then formed of a number of blocks $B_i$. The hash i...
The [Merkle–Damgård hash construction][1] customarily pads the message $M$ to be hashed with a single bit set to 1, a minimal number of bit(s) set to 0, and the representation of the length of the message in binary over some fixed number of bits. The padded message is then formed of a number of blocks $B_i$. The hash i...
Is there an example of two known strings have the same hash (MD5) value, i.e. a MD5 collision?