instruction
stringlengths
15
30k
Well, first of all, you need to be clear about the meanings of various cryptographical primitives. - Cryptographic hash function; this is a function that takes an input string, and generates a hash. The idea is that we don't know how to create two input strings with the same hash, and so the hash can be used as a ...
The wikipedia page on [computational indistinguishability](https://en.wikipedia.org/wiki/Computational_indistinguishability) says that two ensembles are not distinguishable if "any non-uniform probabilistic polynomial time algorithm A" cannot tell them apart. To help me better understand the definition, I searched for ...
First of all, the Guillou-Quisquater digital signature scheme is: >Note everything is mod n. Message is denoted by m. >Private key: s >Public key: Hash function H, e, L=s^e >To sign: Alice chooses random r. Computes c=H(m,x) x=r^e, y=rs^c. Send Bob x and y. >To verify: Bob computes c=H(m,x) and accept i...
Is Guillou-Quisquater existentially unforgeable against adaptive message attack under a random oracle model?
In the last week, the discrete logarithm problem was broken for the binary fields [$\mathbb{F}_{2^{(14 \times 127)}}$][1] and [$\mathbb{F}_{2^{(27 \times 73)}}$][2]. Pairing-based cryptography using binary fields currently relies on fields such as $\mathbb{F}_{2^{4\times353}}$ (80-bit level of security) and $\mathbb...
The [TLS](http://datatracker.ietf.org/wg/tls/) protocol includes an optional Server Key Exchange message that is signed by the server. It seems to me that this message is digitally signed only to prove to the client that the message originated from the server. The general purpose of a Digital Signature is to provid...
What is the most used Algorithm in Steganography? I made some research about the algorithm and I think Least Significat Bit(LSB) is the most used algorithm, is there any more efficient algorithm that can be use for Steganography aside from LSB?
What is the most used Algorithm/Technique in Steganography? I made some research about the algorithm/technique and I think Least Significat Bit(LSB) is the most used algorithm, is there any more efficient algorithm/technique that can be use for Steganography aside from LSB?
Your question is really too general - and perhaps off-topic, as steganography is quite a different field to cryptography. That being said, the answer to your question really depends on many things. Steganography is the art of hiding information in plain-sight. This information could be hidden in either; analogue o...
One of the simplest possible cipher modes is setting each successive key as a function F of the previous one. K[0] = Master key C[i] = E(K[i],P[i]), K[i]=F(K[i-1]) This is similar to the counter mode CTR, buy the key is incremented instead of the plaintext. Obviously this mode is slower than the others, sin...
Why nobody considers counter re-keying as a Block Cipher Mode?
A tweakable blockcipher where the tweak is set to a counter, and the plaintext gets encrypted directly has the same properties as your idea. When these properties are desired, you can use either a specialized tweakable blockcipher such as threefish, or you turn a normal blockcipher into a tweakable blockcipher. W...
A tweakable blockcipher where the tweak is set to a counter, and the plaintext gets encrypted directly has the same properties as your idea. When these properties are desired, you can use either a specialized tweakable blockcipher such as threefish, or you turn a normal blockcipher into a tweakable blockcipher. W...
A tweakable blockcipher where the tweak is set to a counter, and the plaintext gets encrypted directly has the same properties as your idea. When these properties are desired, you can use either a specialized tweakable blockcipher such as threefish, or you turn a normal blockcipher into a tweakable blockcipher. W...
A tweakable blockcipher where the tweak is set to a counter, and the plaintext gets encrypted directly has the same properties as your idea. When these properties are desired, you can use either a specialized tweakable blockcipher such as threefish, or you turn a normal blockcipher into a tweakable blockcipher. W...
The [TLS](http://datatracker.ietf.org/wg/tls/) protocol includes an optional Server Key Exchange message that is signed by the server. It seems to me that this message is digitally signed only to prove to the client that the message originated from the server. The general purpose of a Digital Signature is to provid...
I'm having some fun designing a key stretching algorithm that can be implemented in pure Python. It's built entirely out of the standard library's hash functions in an attempt to at least wrest some speed out of this particular language. I came up with the following construct for mutating memory. Given a hasher init...
Is the following key stretching algorithm as memory hard as I think it is?
Suppose the attacker knows X, Z such that H(X || Y) = Z If bit-length(Y) < 80 then a brute force attack using meet-in-the-middle is possible. What if bit-length(Z) = 256 (such as in SHA-256) bit-length(X) = 128 bit-length(Y) = 256. Are there any published paper with results/experiments with SHA-256/51...
How hard is a known prefix hash preimage attack?
Suppose the attacker knows X, Z such that H(X || Y) = Z If bit-length(Y) < 60 then a brute force attack is possible. What if bit-length(Z) = 256 (such as in SHA-256) bit-length(X) = 128 bit-length(Y) = 256. Are there any published paper with results/experiments with SHA-256/512 in full or reduced ro...
Fastest multiplication algorithm for efficient exponentiation in C++?
I'm having some fun designing a key stretching algorithm that can be implemented in pure Python. It's built entirely out of the standard library's hash functions in an attempt to at least wrest some speed out of this particular language. I came up with the following construct for mutating memory. Given a hasher init...
After reading some excellent papers on [SipHash][1], I understood that good non-cryptographic hashes such as [MurmurHash][2] and [CityHash][3] are not secure for [MAC][4] usage, due to a certain type of DDos attack becoming possible, thanks to a combination of Hash-table degeneracy into a list and predictable collision...
After reading some excellent papers on [SipHash][1], I understood that good non-cryptographic hashes such as [MurmurHash][2] and [CityHash][3] are not secure for [MAC][4] usage, due to a certain type of DDos attack becoming possible, thanks to a combination of Hash-table degeneracy into a list and predictable collision...
After reading some excellent papers on [SipHash][1], I understood that good non-cryptographic hashes such as [MurmurHash][2] and [CityHash][3] are not secure for [MAC][4] usage, due to a certain type of DDos attack becoming possible, thanks to a combination of Hash-table degeneracy into a list and predictable collision...
After reading some excellent papers on [SipHash][1], I understood that good non-cryptographic hashes such as [MurmurHash][2] and [CityHash][3] are not secure for [MAC][4] usage, due to a certain type of DDos attack becoming possible, thanks to a combination of Hash-table degeneracy into a list and predictable collision...
After reading some excellent papers on [SipHash][1], I understood that good non-cryptographic hashes such as [MurmurHash][2] and [CityHash][3] are not secure for [MAC][4] usage, due to a certain type of DDos attack becoming possible, thanks to a combination of Hash-table degeneracy into a list and predictable collision...
After reading some excellent papers on [SipHash][1], I understood that good non-cryptographic hashes such as [MurmurHash][2] and [CityHash][3] are not secure for [MAC][4] usage, due to a certain type of DDos attack becoming possible, thanks to a combination of Hash-table degeneracy into a list and predictable collision...
Keccak, the construction selected for SHA-3 is very interesting. It seems unlike other primitives and has chosen very simple constants. ([Keccak talk PDF][1]) The initial values of the state in Keccak is all zero, why? The round constants have just a few bits set, why is this? Previous primitives like SHA-2, u...
Why are the constants so simple in Keccak?
After reading some excellent papers on [SipHash][1], I understood that good non-cryptographic hashes such as [MurmurHash][2] and [CityHash][3] are not secure for [MAC][4] usage, due to a certain type of DDos attack becoming possible, thanks to a combination of Hash-table degeneracy into a list and predictable collision...
After reading some excellent papers on [SipHash][1], I understood that good non-cryptographic hashes such as [MurmurHash][2] and [CityHash][3] are not secure for [MAC][4] usage, due to a certain type of DDos attack becoming possible, thanks to a combination of Hash-table degeneracy into a list and predictable collision...
The format is not an official standard, but it is pretty straight forward. There are indeed 4 fields, in order $p$, $q$, $d$ and $u$ (I'm not quite sure what the function of the $u$ is?, it's not the CRT representation that is common in standards). First decode the base64: it starts with 0x04 0x00 0x8b 0x91 0xff 0x...
First of all, the Guillou-Quisquater digital signature scheme is: >Note everything is mod n. Message is denoted by m. >Private key: s >Public key: Hash function H, e, L=s^e >To sign: Alice chooses random r. Computes c=H(m,x) x=r^e, y=rs^c. Send Bob x and y. >To verify: Bob computes c=H(m,x) and accept i...
I've been tasked with building up some security exercises (basic CTF training kind of stuff) for work. This should contain a bit of crypto, but my knowledge in this space has been limited to using the right tools, not trying to roll my own, etc, so coming up with an example of bad crypto, but believably real, has been ...
Bad/Crackable Encryption Example?
I've been tasked with building up some security exercises (basic CTF training kind of stuff) for work. This should contain a bit of crypto, but my knowledge in this space has been limited to using the right tools, not trying to roll my own, etc, so coming up with an example of bad crypto, but believably real, has been ...
So what you are doing here are two Diffie-Hellman key exchanges in parallel – one with the server's static Diffie-Hellman key pair $(x,y)$ and the client's ephemeral key pair $(a,A)$ to calculate $k = k'$, and one with completely ephemeral keys to calculate the actual `pre_master_secret`. $k$ is only used as a MAC key ...
So what you are doing here are two Diffie-Hellman key exchanges in parallel – one with the server's static Diffie-Hellman key pair $(x,y)$ and the client's ephemeral key pair $(a,A)$ to calculate $k = k'$, and one with completely ephemeral keys to calculate the actual `pre_master_secret`. $k$ is only used as a MAC key ...
Why nobody considers counter re-keying as a standard Block Cipher Mode?
First of all, the Guillou-Quisquater digital signature scheme is: >Note everything is $\bmod n$. Message is denoted by $m$. >Private key: $s$ >Public key: Hash function $H$, $e$, $L=s^e\bmod n$ >To sign: Alice chooses random $r$. Computes $c=H(m||x)$ with $x=r^e\bmod n$; $y=r\cdot s^c\bmod n$; send Bob $x...
I am trying to do a homework in which implement a variation of [this paper][1] and I don't know how to generate a polynomial of degree m-1. This polynomial is used to generate the y0 and y1 values (forgive me for I don't know how to write super-script and sub-scripts here). I am using JCE for doing the coding. What do ...
Use the notations form the Wikipedia article [Paillier Cryptosystem](http://en.wikipedia.org/w/index.php?title=Paillier_cryptosystem&oldid=535048381) , assume that the chipertext $c$ and $c^{\lambda} \mod n^2$ are both given, is it possible to compute $\lambda$ easily?
I am trying to do a homework in which implement a variation of [this paper][1] and I don't know how to generate a polynomial of degree $m-1$. This polynomial is used to generate the $y_0$ and $y_1$ values. I am using JCE for doing the coding. What do I need to do to achieve this? [1]: http://cs.unc.edu/~fabia...
How to generate a random polynomial of degree $m$?
I'm encrypting a file with AES-256 in CBC mode. I needed to add an HMAC for authentication and validation of the file contents and passphrase, so I used a SHA-256 HMAC over chunks of my file cumulatively. My main question is how to derive both an HMAC key and my AES key from an input passphrase. I'm currently takin...
Deriving HMAC key and cipher key from passphrase?
Comparing to [this question](http://crypto.stackexchange.com/questions/6456/how-hard-are-discrete-logarithms-problems-in-mathbb-z-n-and-mathbb-z), assume $C, M \in \mathbb Z^*_{n^2}$, $e >3$, is it hard to compute $M$ that $C=M^e \mod n^2$ when $C, e, n$ are given?
Is there any complexity analysis between Karatsuba and Montgomery multiplication algorithms? It seems that Karatsuba is more general in the sense that is not modulo tuned while Montgomery it is. Does a also a hybrid model using Karasuba and Montogomery exists?
Which one is fastest? Karatsuba or Montgomery multiplication?
Comparing to [this question](http://crypto.stackexchange.com/questions/6456/how-hard-are-discrete-logarithms-problems-in-mathbb-z-n-and-mathbb-z), assume $C, M \in \mathbb Z^*_{n^2}$, $e \ge 3$, is it hard to compute $M$ that satisfies $C=M^e \mod n^2$ when $C$ and $(n, e)$ are given?
Modern stream ciphers usually predicts the usage of a nonce (also termed as IV) in the cryptosystem. The cost of initializing the cipher with the nonce varies from algorithm to algorithm (for instance, this cost seems very high on HC-256 and negligible on Salsa 20). I would like to know the correct usage pattern of a n...
Yes, no. ---------- > Does it needs to be new for every transmitted message? Yes, always, otherwise this qualifies as IV reuse, the keystream produced by the stream cipher is the same (since keystream is independent of plaintext) and you end up with the familiar $M_0 \oplus M_1$. I think you answered your...
In projective coordinates point-at-infinity can be identified with z=0. How to identify the point-at-infinity in affine coordinate. Whether x=0 and y=0 can be considered as point-at-infinity in affine coordinate?
Assuming the ability to launch Chosen Plaintext Attacks (CPA), how many oracle calls an attacker needs to break the affine cipher? and how
In the Paillier cryptosystem [1] the encryption of $m \in \mathbb{Z}_N$ with randomness $r \in \mathbb{Z}_n^*$ is $c = g^m r^n \bmod{n^2}$. A proof of correct encryption could look like presented in section 4.2 of [2]: >"Suppose a prover $P$ presents a sceptical verifier $V$ with a ciphertext $c$ and claims that it...
In the Paillier cryptosystem [1] the encryption of $m \in \mathbb{Z}_N$ with randomness $r \in \mathbb{Z}_n^*$ is $c = g^m r^n \bmod{n^2}$. A proof of correct encryption could look like presented in section 4.2 of [2]: >"Suppose a prover $P$ presents a sceptical verifier $V$ with a ciphertext $c$ and claims that it...
In the last week, the discrete logarithm problem was broken for the binary fields [$\mathbb{F}_{2^{(14 \times 127)}}$][1] and [$\mathbb{F}_{2^{(27 \times 73)}}$][2]. Pairing-based cryptography using binary fields currently relies on fields such as $\mathbb{F}_{2^{4\times353}}$ (80-bit level of security) and $\mathbb...
This is theoretical question. I'd like to know if it's possible (and what are eventually the consequences), not that I'm going to do it in one of my projects. ;) The first hashing functions created were based on a symmetric cipher (just like the first Unix _crypt_ was based on _DES_). The idea was simple. Use the pa...
I'm aware that it's crucial to include the IV when calculating the HMAC of a ciphertext (assuming an IV is used). Can anyone explain, in simple terms, why this is? Furthermore, assume that there is other metadata associated with the cipher, which needs to be known to correctly decrypt the ciphertext (for example, t...
I need to transmit long encrypted messages to a smartcard over a limited capacity link so I need to fragment the messages somewhere before sending thzm. My problem is that I split the message into 64-byte blocks and then apply a pkcs7 padding. The result is that the padded message always ends with a full block of 16...
Padding always the same, problem or not?
I am looking for a way to generate an "insecure" public key pair. and by insecure I actually mean a pair that is breakable using brute-force (or other encryption) methods. As far as I know PGP started with 128bit-keys. and at this point I can only find tools to generate keys using 1024bit or more. Is there a way ...
One thing that is constantly reiterated in this forum is the important of following conventions in cryptography; not creating your own protocol, using primitives precisely for what they've been designed to do, etc. From the (naive) perspective of someone with little experience in cryptography, it seems to me that ques...
The professor left us a question in El Gammal signature, given the Hash function and message M, one chose a random r and computer h=g^r and H(M||h). if H(M) is used instead of H(M||h), the signature can be existentially forged. I am struggling with the problem and I think maybe we can get one message known signed tw...
I want to find two strings containing special words like "yes" or "no", mixed with random characters, for which the MD5 hash is equal. An example of what I'm looking for: First string : YES/d6g45d78h74jfhcf MD5 : 4cf349066ce85e0c947eb1d0c94c13b1 Next string : NO/djf986f98edf8dfv4 MD5 : 7fdefd9bd8a46db...
Can I find two specific words with the same md5 hash?
On a [recent question](http://crypto.stackexchange.com/questions/6459/deriving-hmac-key-and-cipher-key-from-passphrase/6468#comment11666_6468) it became apparent that there's a significant difference between an HMAC of input data and a hash of input data. What exactly is the difference between an HMAC and a hash of...
What is the difference between a HMAC and a hash of data?
Any body knows of library or platform implementing homomorphic hashing ?
Any practical implementation of homomorphic hashing?
The professor left us a question on ElGamal signatures: > Given the hash function $H$ and message $M$, choose a random $r$ and compute $h=g^r$ and $H(M||h)$. Show that, if $H(M)$ is used instead of $H(M||h)$, the signature can be existentially forged. I am struggling with the problem, and I think that maybe we ca...
Why do we need to hash both the message and the $h$ value in ElGamal signature?
Why is RSA encryption significantly faster than decryption?
As the topic says, since when can ECC cryptography be freely used? Isn't it widely used because of patents? There is no alternative to it on embedded devices and smart cards.
When do ECC patents end?
Let me preface this by saying that I am not a lawyer and if you are planning on using ECC in a system you sell, you should hire a lawyer. There are [a number of ECC related patents][1]. However "in all of these cases, it is the implementation technique that is patented, not the prime or representation, and there are...
As the topic says, since when can ECC cryptography be freely used? Isn't it widely used because of patents? There is no alternative to it on embedded devices and smart cards. Just to mention: i am not from USA.
Browser vendors use ASN.1 encoding for RSA certificates in the TLS protocol. RSA public keys are just a number, so why do we need encode them to something else? That increases the risk of security problems.
Why are RSA keys encoded with ASN.1 for TLS?
As the topic says, since when can ECC cryptography be freely used? Isn't it widely used because of patents? There is no alternative to it on embedded devices and smart cards. Just to mention: i am not from USA. I'm a simple user who wants ECC to be wide supported.
Let me preface this by saying that I am not a lawyer and if you are planning on using ECC in a system you sell, you should hire a lawyer. There are [a number of ECC related patents][1]. However "in all of these cases, it is the implementation technique that is patented, not the prime or representation, and there are...
Is [Truecrypt](http://www.truecrypt.org/) use of [cascading encryption](http://www.truecrypt.org/docs/?s=cascades) safe? Is it useful? Truecrypt is arguably one of the most popular and widely used encryption applications in use today, yet it seems to use a very unconventional scheme. The software offers [cascadi...
Is Truecrypt's multiple/cascading encryption safe?
Any body knows of library or platform implementing homomorphic hashing ? Wiki: http://en.wikipedia.org/wiki/Homomorphic_signatures_for_network_coding Note : this is not same as homomorphic encryption
Any practical implementation of homomorphic hashing/signatures?
Usually, in cryptography, one is interested in debiasing a stream of independent (true) random bits, and several algorithms exist to do this. What about the converse? Let's assume I have a stream of independent and unbiased random bits at my disposal, and that I would like to generate a stream of statistically independ...
How to efficiently generate a stream of independent, but biased random bits?
It is conjectured that SHA-1 has been broken from the "research" perspective but no in real world. That is that there is an algebraic attacks that explore weaknesses on its algrebraic construction. The same happens for MD5 but MD5 has been practically broken by finding collisions in real world. Can we still use HMAC wi...
Is SHA-1 still practical secure under specific scenarios?
A [homomorphic hash function][1] is a function $H : A \to B$ between to sets with some algebraic structure $(A, *)$ and $(B, \star)$ such that * $H$ is collision resistant, i.e. it is hard to find $x \neq y$ such that $H(x) = H(y)$ and * $H$ is a homomorphism, i.e. $H(x * y) = H(x) \star H(y)$. Are there any pra...
Are there any practical implementation of a homomorphic hashing or signature scheme?
A [homomorphic hash function][1] is a function $H : A \to B$ between two sets with some algebraic structure $(A, *)$ and $(B, \star)$ such that * $H$ is collision resistant, i.e. it is hard to find $x \neq y$ such that $H(x) = H(y)$ and * $H$ is a homomorphism, i.e. $H(x * y) = H(x) \star H(y)$. Are there any pr...
There's plenty of research in this area. I'll give you just a small sampling: * [Speeding Up Homomorpic Hashing Using GPUs](http://dl.acm.org/citation.cfm?id=1817431). Kaiyong Zhao. ICC 2009. * [Transitive Signature Schemes](http://people.csail.mit.edu/rivest/pubs/MR02b.pdf). Silvio Micali, Ronald Rivest. CT-RS...
There's plenty of research in this area. I'll give you just a small sampling: * [Speeding Up Homomorpic Hashing Using GPUs](http://dl.acm.org/citation.cfm?id=1817431). Kaiyong Zhao. ICC 2009. * [Transitive Signature Schemes](http://people.csail.mit.edu/rivest/pubs/MR02b.pdf). Silvio Micali, Ronald Rivest. CT-RS...
I think I understand why RSA is hard to attack but I'd like to get clarification if I actually do. Assume there are two people, Alice and Bob, who are attempting to communicate privately but that we can listen to all of their messages to each other. Assume we know they're attempting to communicate using RSA and tha...
1. i want to generate a Random Elliptic curve, what are the conditions i should satisfied? 2. For NIST 2^224-2^96+1 curve, reduction technique is there (448 bit into 224 bit reduction using prime, ((z1+z2+z3-z4-z5) mod prime )), what is the logic behind in this one?
While generating a random Elliptic curve what are the conditions i have to considerd?
There are a number of small mistakes in the question. Let's clean up that first. $\gcd(e,n)=1$ is likely, but neither necessary nor sufficient for RSA to work; the right condition is $\gcd(e,p-1)=\gcd(e,q-1)=1$. Notice this implies $e$ odd for any non-trivial choice of $p$ and $q$. Even in textbook RSA, the right...