instruction
stringlengths
15
30k
As for the first reason: in the future you probably need the decompressed form of the message. There won't be much you can *do* with the compressed message. But PGP is *application level*; you may want to verify that message at any time. Now you may want to verify the signature over that decompressed data without compr...
I am trying to work through an example of Baek and Zheng’s “threshold identity-based decryption scheme” and I tried a lot to solve this, but somewhere I’m doing something wrong. I hope someone can help me rectify my error, telling me where I might be making a mistake. > [![enter image description here][1]][1] ...
I'm developing network based application for control and telemetry on Linux based embedded system. I'm using **ZMQ** network library and Google **Protocol Buffers** serialization library for communication purposes. I took a look at [CurveZMQ][1] however there is no official binding for C++ and I do not want to mess ...
I'm developing network based application for control and telemetry on Linux based embedded system. I'm using **ZMQ** network library and Google **Protocol Buffers** serialization library for communication purposes. I took a look at [CurveZMQ][1] however there is no official binding for C++ and I do not want to mess ...
Suppose you want to select a prime $p$ such that finding e.g. $log_2(3)$ in $\mathbb{Z}_p$ is expected to be either at least as hard as the general Discrete Logarithm Problem in $\mathbb{Z}_p$, or at least both problems infeasible. How large would $p$ have to be? Intuitively, the problem of finding $log_2(3)$ seems ...
Suppose you want to select a prime $p$ such that finding e.g. $log_2(3)$ in $\mathbb{Z}_p$ is expected to be either at least as hard as the general Discrete Logarithm Problem in $\mathbb{Z}_p$, or at least both problems infeasible. How large would $p$ have to be? Intuitively, the problem of finding $log_2(3)$ seems ...
I am trying to work through an example of Baek and Zheng’s “threshold identity-based decryption scheme” and I tried a lot to solve this, but somewhere I’m doing something wrong. I hope someone can help me rectify my error, telling me where I might be making a mistake. > [![enter image description here][1]][1] ...
I'm a crypto enthusiastic and student of cryptography. I'm developing a project with other students and our idea was to develop a hardware circuit to help people trying to understand cryptography, so we thought of a very simple DES circuit of 8 bits. We are currently developing the logic system on Logisim, but we ar...
I'm a crypto enthusiastic and student of cryptography. I'm developing a project with other students and our idea was to develop a hardware circuit to help people trying to understand cryptography, so we thought of a very simple DES circuit of 8 bits. We are currently developing the logic system on Logisim, but we ar...
I am researching on collision probability of MD5 on various attacks against it. Can someone help me with finding what is the least probability that there will be collision in specific attack on MD5? For example: MD5 has probability of collision $1 / 2^{64}$ under birthday paradox but does this apply to any inpu...
> MD5 has probability of collision $1/2^{64}$ under birthday paradox but does this apply to any input given to MD5? Not quite. In the general case, the probability of a collision depends on the number of messages. The $2^{64}$ comes into play because we need $\approx 2^{64}$ *messages* for a $50$% probability that a...
I am researching the collision probability of MD5 and various attacks against it. Can someone help me how to learn the least probability that there will be a collision in a specific attack on MD5? **For example:** MD5 has a collision probability of $1 / 2^{64}$ under the Birthday Paradox. Does this apply to any in...
> MD5 has a collision probability of $1 / 2^{64}$ under the Birthday Paradox. Does this apply to any input given to MD5? As explained in [the other answer][1], $2^{64}$ is the birthday bound of messages until probable collision, not a collision probability. For two random messages you'd expect a $1/2^{128}$ probabi...
> MD5 has a collision probability of $1 / 2^{64}$ under the Birthday Paradox. Does this apply to any input given to MD5? Not quite. In the general case, the probability of a collision depends on the number of messages. The $2^{64}$ comes into play because we need $\approx 2^{64}$ *messages* for a $50$% probability ...
How do I implement asymmetric key algorithm into wireless medium using NS 2.35? **For example:** node $A$ is a sender and $B$ is a receiver. Now, $A$ is sending a packet using $B$s public key (encryption) and $B$ decrypts that packet using its private key . My question is: how to produce the key into that wirele...
Supposing a rotor machine of the 1940s or 50s, with 36 characters instead of 26, the encryption of the ten additional characters as the most frequent bigrams or trigrams would weaken the code? What better use of these (or any) additional characters?
The encryption of bigrams and trigrams weakens the code?
Why does the "strong LRSW" assumption by Ateniese et al. [Untraceable RFID Tags via Insubvertible Encryption, CCS'05] hold ONLY for type 3 pairings and NOT for symmetric pairings? Whereas, the LRSW assumption by Lysyanskaya et al. [Pseudonym Systems, SAC'99] does hold for all types of pairings.
I am trying to work through an example of Baek and Zheng’s “threshold identity-based decryption scheme” and I tried a lot to solve this, but somewhere I’m doing something wrong. I hope someone can help me rectify my error, telling me where I might be making a mistake. > [![enter image description here][1]][1] ...
Supposing a rotor machine of the 1940s or 50s, with 36 characters instead of 26. Would the encryption of the ten additional characters as the most frequent bigrams or trigrams weaken the code? What better use of these (or any) additional characters would there be?
Would the encryption of bigrams and trigrams weaken the code?
I would use HMAC-SHA256. While [poncho's answer][1] that both are secure is reasonable, there are several reasons I would prefer to use SHA-256 as the hash: * Attacks only get better. SHA-1 collision resistance is [already broken][2], so it's not impossible that other attacks will also be possible in the future. ...
As for "how to build the substitution as hardware", it should be easy if you know any of the hardware description language (eg. VHDL or Verilog). Simply write the Sboxes of DES, then the synthesis software will handle the rest. You can also "synthesis" by hand, although that may take a lot of effect. Still, I'm not...
how many pairs of plaintext-ciphertext are needed before we break AES?
Does any know the difference between triple des dukpt decryption algorithm with PIN variant and Data variant? I have done Triple DES DUKPT PIN variant, which generate session key from KSN and BDK. And then decrypt message using the session key. How about Data variant? How is it different from PIn variant? Thank y...
I'm reading a cryptanalysis on Blowfish, and I've come across something that I don't quite get. Let's denote $$\delta = a \oplus a'$$ where *a* and *a'* are bytes that cause a collision in some S-box when entered as the position to use in said box. The structure of Blowfish looks like this: ![Diagram from ...
Is there a formal definition of what a distinguisher is?
Exactly what the title says. If I have a RSA encrypted file, and the exact same file but decrypted, can I tell the key that was used from that information?
Is it possible to get an RSA encryption key by comparing the unencrypted and encrypted file?
I'm reading the ECDSA paper and they say you can only use ECDSA with odd-power fields p or with binary fields 2^m. Why not other power prime fields?
Why not to use curve over field of p^m with p > 2 for ECDSA?
I've read about the possibility of inverting the Mersenne Twister after 624 numbers of output. 624 matches the state size of my implementation of the Twister. Coincidence? If the generator only output 623 numbers, i.e. less than the state size, might inversion still be possible with really clever maths? Or is this ...
Can it ever be impossible to invert a PRNG?
> I've read about the possibility of inverting the Mersenne Twister after 624 numbers of output. 624 matches the state size of my implementation of the Twister. Coincidence? If the generator only output 623 numbers, i.e. less than the state size, might inversion still be possible with really clever maths? Or is this ma...
> I've read about the possibility of inverting the Mersenne Twister after 624 numbers of output. 624 matches the state size of my implementation of the Twister. Coincidence? If the generator only output 623 numbers, i.e. less than the state size, might inversion still be possible with really clever maths? Or is this ma...
I'm reading the ECDSA paper and they say you can only use ECDSA with odd-power fields $p$ or with binary fields $2^m$. Why not other power prime fields?
Why not to use curve over field of $p^m$ with $p > 2$ for ECDSA?
In the NSA's document, "[The Case for Elliptic Curve Cryptography][1]" ([archived][2]), we have > +---------------+-------------------------+-----------------+ | Symmetric Key | RSA and Diffie-Hellman | Elliptic Curve | | Size (bits) | Key Size (bits) | Key Size (bits) | +-------------...
I've read about the possibility of inverting the Mersenne Twister after 624 numbers of output. 624 matches the state size of my implementation of the Twister. Coincidence? If the generator only output 623 numbers, i.e. less than the state size, might inversion still be possible with really clever maths? Or is this ...
What is the name of an algorithm that hashes its result as an embed of larger set of data that results back to the hash? For instance where $f(x)$ is the hashed result and $x$ is the dataset, and $f(x)=foobar, x={...foobar....}$
I’m a bit confused about what the simulator of the special-honest verifier zero-knowledge property of a $\Sigma$-protocol is supposed/allowed to do and how to prove that it is indeed efficient (i.e. it runs in a time polynomial in the security parameter). A 3-move protocol between a prover $P$ and a verifier $V$ is ...
Given a cryptographic pseudo-random number generator G, prove that H with H(s) = G(!s) is also a cryptographic pseudo-random number generator. (s is a binary string; !s is its complement) For this, we have to prove the two properties of a cryptographic pseudo-random number generator, the expansion and the pseudo-ran...
Original HMAC algorithm is as follows: >H(K XOR opad || H(K XOR ipad || text)) What if `text` would replaced with `H(text)`? Will it weaken the HMAC algorithm?
Is calculating HMAC from hashed input a good idea?
> Will it weaken the HMAC algorithm? No, assuming that $H$ is a collision resistant hash function (which is a stronger constraint than what HMAC puts on the hash function). The security property that a MAC (such as HMAC) has is that "given a large set of $message, tag=HMAC(K, message)$ pairs (where $K$ is an unkn...
> What if `text` would replaced with `H(text)`? Will it weaken the HMAC algorithm? Yes. It makes collision attacks on the hash function apply to the MAC, which isn't normally the case with HMAC. You can find a pair $(m, m')$ that hash to the same value, get the MAC for one of them and move it to the other. That m...
It is well known that if OWFs/PRGs exist, then there is a zero knowledge proof for any NP-complete language, say G3C (graph coloring in 3 colors). The zero-knowledge notion maintains that any malicious verifier that interacts with the prover can be simulated by a PPT algorithm (including the communication) and thus, do...
> What if `text` would replaced with `H(text)`? Will it weaken the HMAC algorithm? Yes. It makes collision attacks on the hash function apply to the MAC, which isn't normally the case with HMAC. You can find a pair $(m, m')$ that hash to the same value, get the MAC for one of them and move it to the other. That m...
Given a cryptographic pseudo-random number generator $G$, prove that $H$ with $H(s) = G(!s)$ is also a cryptographic pseudo-random number generator. Here $s$ is a binary string; $!s$ is its complement. For this we have to prove the two properties of a cryptographic pseudo-random number generator: the expansion and t...
If one-way functions exist, then there is a distribution over graphs (or SAT formulas, or ...) having the property you're asking for. In short, just put the OWF through the Cook-Levin reduction. In a little more detail, Cook-Levin transforms the NP witness-finding question "what is a preimage of $y = f(x)$?" (for r...
What is the name of an algorithm that hashes its result as an embed of larger set of data that results back to the hash? For instance where $f(x)$ is the hashed result and $x$ is the dataset, and $f(x)=foobar, \\ x={\dots foobar \dots}$ Differently stated: I'm interested in a hashing algorithm that generates a ...
> What if `text` would replaced with `H(text)`? Will it weaken the HMAC algorithm? Yes. It makes collision attacks on the hash function apply to the MAC, which isn't normally the case with HMAC. You can find a pair $(m, m')$ that hash to the same value, get the MAC for one of them and move it to the other. That m...
I see a lot of papers about FPGA implementations. For what kind of "concrete" application should we implement cryptographic algorithms on FPGA ? Which secured application require such a huge data processing performance ?
Suppose you want to select a prime $p$ such that finding e.g. $log_2(3)$ in $\mathbb{Z}_p$ is expected to be either at least as hard as the general Discrete Logarithm Problem in $\mathbb{Z}_p$, or at least both problems infeasible, e.g. because you want to use $g=2,h=3,p$ as domain parameters for some scheme. How large...
I am trying to work through an example of Baek and Zheng’s “threshold identity-based decryption scheme” and I tried a lot to solve this, but somewhere I’m doing something wrong. I hope someone can help me rectify my error, telling me where I might be making a mistake. > [![enter image description here][1]][1] ...
Answering both your question > For what kind of "concrete" application should we implement cryptographic algorithms on FPGA? Which secured application require such a huge data processing performance ? and [your related comment](http://crypto.stackexchange.com/questions/27559/cryptography-and-fpga#comment64590_27...
Answering both your question > For what kind of "concrete" application should we implement cryptographic algorithms on FPGA? Which secured application require such a huge data processing performance ? and [your related comment](http://crypto.stackexchange.com/questions/27559/cryptography-and-fpga#comment64590_27...
Answering both your question > For what kind of "concrete" application should we implement cryptographic algorithms on FPGA? Which secured application require such a huge data processing performance ? and [your related comment](http://crypto.stackexchange.com/questions/27559/cryptography-and-fpga#comment64590_27...
> For what kind of "concrete" application should we implement cryptographic algorithms on FPGA? Which secured application require such a huge data processing performance ? Well, FPGAs are ideal for a wide variety of applications, from high-volume applications to state-of-the-art products. Imagine you are… - a ...
> For what kind of "concrete" application should we implement cryptographic algorithms on FPGA? Which secured application require such a huge data processing performance ? Well, FPGAs are ideal for a wide variety of applications, from high-volume applications to state-of-the-art products. Imagine you are… - a ...
I understand that encrypting files in CTR mode is not perfectly safe, because it potentially leaves the files open for cryptanalysis, if the attacker has access to previous versions of the same files. But is this really feasible when we are talking about encrypting files? Lets say we got a program that reads and wri...
Having a large set of ECC public keys $P_i = n_iB$ on a fixed curve $E$ over a prime field, is there a way to determine if coefficients $n_i$ were generated using a bad PRNG? In other words, can a quality of PRNG be tested by knowning the ECC public keys?
Testing PRNG quality from ECC public keys?
Consider the following variant of Diffie-Hellman key exchange protocol for two parties: 1. Assume Alice and Bob share $\mathbb{G}$ of order $q$ generated by $g$ 2. Alice samples $a$ uniformly from $\mathbb{Z}^q$, and sends $h := g^a$ to Bob 3. Bob samples $b$ uniformly from $\mathbb{Z}^q$, and sends $h^b = g^{...
I'm quickly assuming your question asks how to retrieve the public (RSA-) key from a set of samples of unencrypted and encrypted messages. If you're question is about: "How can I get my files back after being infected by CryptoWall?" I suggest you read [the hits by the search function][1] on [InfoSec][2]. Please ...
Having a large set of ECC public keys $P_i = n_iB$ on a fixed curve $E$ over a prime field, is there a way to determine if coefficients $n_i$ were generated using a bad PRNG? In other words, can a quality of PRNG be tested by knowning the ECC public keys? If I had a bad generator, can I exploit it to make the discre...
Having a large set of ECC public keys $P_i = n_iB$ on a fixed curve $E$ over a prime field, is there a way to determine if coefficients $n_i$ were generated using a bad PRNG? In other words, can a quality of PRNG be tested by knowning the ECC public keys?
Let's say you want to break down a message, for simplicity it is just a bit 0-1, $m$ into two messages $(m_1, m_2)$ as follows: If $m =0$, then $(m_1, m_2) = (0, 0), (1,1)$ with probability 0.5, 0.5. If $m=1$, then $(m_1, m_2) = (0,1), (1,0)& with probabilities 0.5, 0.5. It's clear how the message can be retrieve...
What is this encryption system called?
Let $G$ be a PRG. Are the following $G'$ constructions based on $G$ necessarily PRGs?
Lots of modern encryption (RSA comes to mind) are based on the fact that factoring large numbers is hard. However, multiplying large numbers is much easier, and table lookups are very easy. Since these large numbers are semiprimes (in all encryption methods I can think of, anyways), why not just make a table of the pro...
Why isn't a table used to solve the large number factoring problem?
TL;DR: use (D)TLS. This is exactly the kind of problem it was meant to solve. If possible, use cert pinning too (if you get to deploy the code on both ends of the channel, this should be possible). The general rule is: don't design your own crypto protocol unless both of the following apply. 1. You have done...
The [prime number theorem](https://en.wikipedia.org/wiki/Prime_number_theorem) says that there are approximately $N/\log{N}$ primes less than $N$. If we are using $2048-bit$ RSA, that means the primes we are using are $1024$ bits. So, how many $1024$ bit prime numbers are there? Approximately $2^{1025}/\log{2^{1025}...
I'm confused. I thought that tossing a 6-sided die 100 times had a greater than 256-bit entropy because 6^99 < 2^256 < 6^100. (A similar concept appeared in [this XKCD comic][1], where choosing four random words from a dictionary of presumably 2048 words has a 44-bit entropy, presumably because 2048^4 = 2^44.) On...
What is the difference between Shannon entropy and saying that tossing a 6-sided die 100 times has more than 256-bit entropy?
Let's say you want to break down a message, for simplicity it is just a bit $0$ or $1$, $m$ into two messages $(m_1, m_2)$ as follows: If $m =0$, then $(m_1, m_2) = (0, 0)$ with probability $1/2$ and $(m_1, m_2) = (1,1)$ with probability $1/2$. Similarly, if $m=1$, then $(m_1, m_2) = (0,1)$ or $(1,0)$ each with prob...
The [prime number theorem](https://en.wikipedia.org/wiki/Prime_number_theorem) says that there are approximately $N/\log{N}$ primes less than $N$. If we consider $2048$ bit RSA, that means the primes we are using are $1024$ bits. How many $1024$ bit prime numbers are there? Approximately $2^{1025}/\log{2^{1025}} =...
I am curious to know how an ECDH algorithms select a module value, if both ends A & B can generate same shared key using the public key of each other ? If I understood DH correctly, both A and B send each other their public key. Then at each side the ECDH operation takes as parameter self ECC key and the public key o...
How ECDH algorithm selects modulus value?
I am trying to understand the small subgroup attack on Diffie-Hellman. I will present the attack and try to explain why it works. Let be a group $\mathbb{Z}_p^*$ where $p$ is a large prime, so the order of this group is a composite, so there exist subgroups. Say $\mathbb{G}_w$ is one small subgroup of primer order $...
I'm confused. I thought that tossing a 6-sided die 100 times had a greater than 256-bit entropy because $6^{99} < 2^{256} < 6^{100}$. (A similar concept appeared in [this XKCD comic][1], where choosing four random words from a dictionary of presumably 2048 words has a 44-bit entropy, presumably because $2048^4 = 2^{...
How can I calculate points on an elliptic curve defined over $\mathbb F_p$, for example $y^2 \equiv x^3 + 1 \pmod p$, with coordinates in $\mathbb F_{p^2}$?
Since most of our asymmetric encryption algorithms are going to be out-of-date in a couple of year due to Shor's algorithm, I was wondering about the future of FHE schemes. I have found this paper, which states: *"It is impossible to construct secure group homomorphic encryption in the quantum world, if the plain...
Is full Homomorphic encryption quantum resistant?
How can I calculate points on an elliptic curve defined over $\mathbb F_p$, for example $y^2 \equiv x^3 + 1 \pmod p$, with coordinates in $\mathbb F_{p^2}$? (points might have complex number format in $\mathbb F_{p^2}$)
Since most of our asymmetric encryption algorithms are going to be out-of-date in a couple of year due to Shor's algorithm, I was wondering about the future of FHE schemes. I have found [this][1] paper, which states: *"It is impossible to construct secure group homomorphic encryption in the quantum world, if the ...
Alright I may need to explain myself better Let's I have a text field somewhere (ie an interactive user submitted text field on a PHP script, or a console application. Basically anything that accepts user input.) How can I detect if said text field contains only a PGP encrypted/signed message? I could just finger...
Reading the question [“HMAC-SHA1 vs HMAC-SHA256”](http://crypto.stackexchange.com/q/15382/12164), I figured out that the known attacks on SHA1 don't apply to its HMAC version. So, HMAC-SHA1 is quite strong *right now*. In a protocol like SSL, if it gets broken tomorrow, we can “simply” turn off all the cipher-suites...
In many implementation, the result of the algorithm Diffie-Hellman is hashed. I red that: > Hashing the shared secret point prevents an attacker from gaining more information about the EC private keys used to generate the shared point. **Could someone give me an example on how get information about the private ke...
> In a protocol like SSL, if it gets broken tomorrow, we can “simply” turn off all the cipher-suites that use HMAC-SHA1. But what if it is used as MAC protection for encrypted data storage? This isn't as big a problem as it may seem at first. Even with old data it can still be possible to upgrade the MAC later if y...
Let's say I have a text field somewhere (i.e. an interactive user submitted text field on a PHP script, or a console application. Basically anything that accepts user input.) How can I detect if said text field contains only a PGP encrypted/signed message? I could just fingerprint the `BEGIN PGP ENCRYPTED MESSAGE` h...
I have seen a talk by Rüdiger Weis, where he says that you can combine two symmetric ciphers using XOR. According to him, that has the effect that its sufficient if only one of the ciphers is secure. How does he do that? I have thought of ciphertext = twofish(message) XOR aes(message) but I can't see how th...
**Motivation** Consider the following variant of Diffie-Hellman key exchange protocol for two parties: 1. Assume Alice and Bob share $\mathbb{G}$ of order $q$ generated by $g$ 2. Alice samples $a$ uniformly from $\mathbb{Z}^q$, and sends $h := g^a$ to Bob 3. Bob samples $b$ uniformly from $\mathbb{Z}^q$, an...
In many implementations, the result of the Diffie-Hellman algorithm is hashed. I read that: > Hashing the shared secret point prevents an attacker from gaining more information about the EC private keys used to generate the shared point. **Could someone give me an example of how to get information about the priva...
[Bitcoin's mini private key format][1] works by brute forcing random data to produce a secret so that when appending `?` and then hashing with sha256 it will produce a hash that starts with `0x00`. This way the user knows the secret is well formed and can proceed to hash it without appending `?` to produce their privat...
Is entropy being lost when the hash of a secret has a specific format?
From the linked page, a minikey is a 30-character string over the base58 alphabet with the first byte fixed to `'S'`, so effectively 29 bytes. This gives a space of $log_2(58^{29}) \approx 169.88$ bits. Assuming that SHA is a random function, the probability of the hash starting with an 0-byte after appending a `?` is ...
From the linked page, a minikey is a 30-character string over the base58 alphabet with the first byte fixed to `'S'`, so effectively 29 characters. This gives a space of $log_2(58^{29}) \approx 169.88$ bits. Assuming that SHA is a random function, the probability of the hash starting with an 0-byte after appending a `?...
If you have a uniformly random string $s$ as long as your message $m$, then $s \oplus m$ is a one-time pad (using $\oplus$ for XOR). If a cipher is secure, then its ciphertext should look like uniform randomness to anyone who does not have the key (even if they know the message). The XOR combination is then effectiv...