instruction
stringlengths
15
30k
Daniel J. Bernstein's [ChaCha][1] core is an evolution of the [Salsa20][2] core. Both are functions over the set of 512-bit bitstrings, partitioned as sixteen 32-bit words. Can we exhibit collisions, or second-preimages (with implies the former), for the ChaCha core? The Salsa20 core has the easily verified prope...
The following encryption scheme encrypts each block of length $n$ of the plaintext separately: $c_i = k_1 \oplus F(k_2 \oplus p_i)$ Where $F$ is a strong pseudo-random permutation (i.e. it is easy to calculate $F(.)$ and $F^{-1}(.)$, and $|k_1|=|k_2|=n$. > $a.$ Is this encryption safe against a CPA attack with...
When an SSH session is rekeyed due to either the time limit or data limit for rekeying having passed, does the Diffie-Hellman exchange take place within the encrypted channel provided by the existing session, or does it take place "in the open" the way it does when the client first connects to the SSH server? Lookin...
The following encryption scheme encrypts each block of length $n$ of the plaintext separately: $c_i = k_1 \oplus F(k_2 \oplus p_i)$ Where $F$ is a strong pseudo-random permutation (i.e. it is easy to calculate $F(.)$ and $F^{-1}(.)$), and $|k_1|=|k_2|=n$. > $a.$ Is this encryption safe against a CPA attack wit...
When an SSH session is rekeyed due to either the time limit or data limit for rekeying having passed, does the Diffie-Hellman exchange take place within the encrypted channel provided by the existing session, or does it take place "in the open" the way it does when the client first connects to the SSH server? Lookin...
I am new to crypto and trying to understand why it would be insecure to use AES to encrypt a key with the same key. Basically, something like this: encrypt(key, key) What happens when both key and message are the same (128 bits)? The obvious question would be why would I want to do that. If I have a secure ch...
The speed of individual algorithms strongly depends on their implementation. This goes for both hashing algorithms as well as encryption algorithms. This quickly becomes clear if you take a look at efforts like “[eBACS: ECRYPT Benchmarking of Cryptographic Systems](http://bench.cr.yp.to/)” and the results presented. ...
The speed of individual algorithms strongly depends on their implementation. This goes for both hashing algorithms as well as encryption algorithms. This quickly becomes clear if you take a look at efforts like “[eBACS: ECRYPT Benchmarking of Cryptographic Systems](http://bench.cr.yp.to/)” and the results presented. ...
I think non pairing based cryptography is less time consuming than pairing based.Because pairing based uses complex operations.Is there any advantages of pairing based over without using pairing based cryptography?
Are there online resources with an ascii character frequency table for HTML? There's tons of them for english, but I can't seem to find one for page source. I know that this is something that's likely to vary from site to site, but surely there's rule-of-thumb good-enough-usually tables where "<" is ranked higher th...
Daniel J. Bernstein's [ChaCha][1] core is an evolution of the [Salsa20][2] core. Both are functions over the set of 512-bit bitstrings, partitioned as sixteen 32-bit words. Can we exhibit collisions, or second-preimages (with implies the former), for the ChaCha **core**? Note: the question is _not_ about ChaCha (a s...
As far as I know, non pairing based cryptography is less time consuming than pairing based, because pairing based uses complex operations. Are there any advantages of pairing based cryptography over elliptic curves without pairings?
What is more efficient, pairing based cryptography or non pairing based cryptography?
As far as I know non pairing pairing based cryptography is less time consuming than pairing based because, pairing based uses complex operations.Are there any advantages of pairing based cryptography over elliptic curves without using pairing based cryptography pairings?
As far as I know non pairing pairing based cryptography is less time consuming than pairing based because, pairing based uses complex operations. Are there any advantages of pairing based cryptography over elliptic curves without using pairing based cryptography?
Are there online resources with an ASCII character frequency table for HTML? There's tons of them for english, but I can't seem to find one for page source. I know that this is something that's likely to vary from site to site, but surely there's rule-of-thumb good-enough-usually tables where `<` is ranked higher th...
Can someone please explain to me how, when using RSA, to determine the exponent to be used in encryption and decryption? I have attempted a worked example on using RSA (shown below) but I can't ever get the decryption algorithm to work. Worked example: p = 29 q = 37 n = 29*37 = 1073 phi = (29-1...
Can someone please explain to me how, when using RSA, to determine the exponent to be used in encryption and decryption? I have attempted a worked example on using RSA (shown below) but I can't ever get the decryption algorithm to work. Worked example: $p = 29$ $q = 37$ $n = 29*37 = 1073$ $\phi ...
There are three main errors here: 1. Exponent $e$ must be chosen to be **coprime** with $\phi$. $e = 3$ is not coprime with $\phi = 1008$; you can choose $e = 5$ instead. 2. You must use integer arithmetic, not floating-point. That is, you cannot have values expressed with decimals. 3. You cannot encrypt a mes...
There are three main errors here: 1. Exponent $e$ must be chosen to be **coprime** with $\phi$. In your question, exponent $e = 3$ is not coprime with $\phi = 1008$. You can choose $e = 5$ instead. 2. You must use integer arithmetic, not floating-point. In other words, you cannot have values expressed with decim...
Daniel J. Bernstein's [ChaCha][1] core is an evolution of the [Salsa20][2] core. Both are functions over the set of 512-bit bitstrings, partitioned as sixteen 32-bit words. Can we exhibit collisions, or second-preimages (with implies the former), for the ChaCha **core**? Note: the question is _not_ about ChaCha (a s...
Here's a simple PHP script that calculates bytes frequencies from 10 random Wikipedia articles: <!-- language:lang-PHP --> <?php $frequencies = array(); $total = 0; for ($i=0; $i<256; $i++) $frequencies[$i] = 0; for ($i=0; $i<10; $i++) { $src = file_get_contents('https://en.wi...
Which symmetric cipher is best for studying?
I actually don't know if this is the right place where ask, but I try. The side channel attacks aren't a negligible problem. There are several ways to protect from these attacks its own IP inside the FPGA. My problem/curiosity it's focused on the AES engine inside the FPGA. The most important FPGA companies have an AES...
As my user profile says, I'm not really a cryptographer — I just play one on the Internet. :) In real life, I'm a graduate student still trying to scrape together a PhD thesis on mathematical biology, while also looking for an IT job to pay the bills and running summer camps for kids on the side. I've long been inte...
You say > I have never studied a cipher before In that case I would recommend the following: 1. [Sign up for the Stanford online class on Cryptography on Coursera][1]. This is a great introduction to Cryptography and this will conver block ciphers. 2. Get a library card with your local public library and as...
I'm playing with Contiki (O.S. for constrained devices such as sensors and micro-controllers) and particularity with the AES encryption on software (the one available in[ \[\[Contiki-Sourcode][1]\]]). I'm trying to complete the code by adding the decryption operation, but I'm confused with the inverse mixcoulumn...
I am facing a challenge at university. Our teacher give us the challenge to try to break an RSA 1024 bit. We have only public modulus **N** and public exponent **e**. Can someone point me out which type of attack i can use and what programming language give more performance to do that? Thanks a lot, any info...
I am facing a challenge at university. Our teacher give us the challenge to try to break an RSA 1024 bit. We have public modulus **N** and public exponent **e**, padding **PKCS1** and we know that the encrypted message is an MD5 (we have the value of unencrypted MD5). Can someone point me out which type of atta...
I am facing a challenge at university. Our teacher give us the challenge to try to break an RSA 1024 bit. We have public modulus **N** and public exponent **e (0x03)**, padding **PKCS1** and we know that the encrypted message is an MD5 (we have the value of unencrypted MD5). Can someone point me out which type ...
I'm playing with Contiki (O.S. for constrained devices such as sensors and micro-controllers) and particularly with the AES encryption in software (the one available in [Contiki source code][1]). I'm trying to complete the code by adding the decryption operation, but I'm confused with the inverse MixColumns oper...
Daniel J. Bernstein's [ChaCha][1] core is an evolution of the [Salsa20][2] core. Both are functions over the set of 512-bit bitstrings, partitioned as sixteen 32-bit words. Can we exhibit collisions, or second-preimages (with implies the former), for the ChaCha **core**? Note: the question is _not_ about ChaCha (a s...
I would like to understand the cryptography behind Wpa2. As far as I know, there are 4 messages on the 4-way handshake and three of them are values concatenated with hashes. First, I am trying to understand how the PTK is generated. I believe that it is: H(an||stn||amac||stmac||PSK) Where "h" function is sha1, ...
Is 256 a reasonable length for a Diffie-Hellman safe prime?
I’m reading [*“The Security of Multiple Encryption in the Ideal Cipher Model”*](https://www.cosic.esat.kuleuven.be/publications/article-2443.pdf) and I’m having a hard time understanding something. How do I calculate the bounds of cascade cipher from the following formula (where $k$ determines keysize and $n$ is the b...
I’m reading [*“The Security of Multiple Encryption in the Ideal Cipher Model”*](https://www.cosic.esat.kuleuven.be/publications/article-2443.pdf) and I’m having a hard time understanding something. How do I calculate the bounds of cascade cipher from the following formula (where $k$ determines keysize and $n$ is the b...
I am facing a challenge at university. Our teacher give us the challenge to try to break an RSA 1024 bit. We have public modulus **N** and public exponent **e (0x03)**, padding **PKCS1** is used at encryption stage. We don't know the original message but we know that the message is hashed (MD5) and then encrypted...
I was reading [this question][1] about generating primes for RSA keys. The answers point out that most implementations of of the algorithm use probabilistic prime-ness checking algorithms. [The answer][2] by [@tylerl][3] made the most sense to me: > That is, if the test uses a randomly-chosen value (the "witness") w...
What is the danger if a non-prime is chosen for RSA?
I am facing a challenge at university. Our teacher give us the challenge to try to break an RSA 1024 bit. We have public modulus **N** and public exponent **e (0x03)**, padding **PKCS1** is used at encryption stage. We don't know the original message but we know that the message is hashed (MD5) and then signed wi...
I am facing a challenge at university. Our teacher give us the challenge to try to break an RSA 1024 bit. We have public modulus **N** and public exponent **e (0x03)**, padding **PKCS1** is used at encryption stage. We don't know the original message but we know that the message is hashed (MD5) and then signed wi...
I am facing a challenge at university. Our teacher give us the challenge to try to break an RSA 1024 bit. We have public modulus **N** and public exponent **e (0x03)**, we don't know the padding. We have a signed message with RSA key (128 bytes) and we know that the unsigned message is an MD5 hash, we have also...
I understand why in general, a strong random generator or source of entropy is used when generating PGP keys. However, I have a use case where I want to generate PGP keys *deterministically*, i.e. based on certain fixed input, so that the same input will always result in the same PGP key. Basically what I want is...
Generating PGP key *without* random generator? (using fixed input only)
I am facing a challenge at university. Our teacher give us the challenge to try to break an RSA 1024 bit. We have public modulus **N** and public exponent **e (0x03)**, we don't know the padding. We have a signed message with RSA key (128 bytes) and we know that the unsigned message is an MD5 hash, we have also...
I am a bit of a newbie to RSA encryption, so please be patient. I understand that for a 4096 bit RSA, the numbers p and q should be prime. And to have the best security, the p and q should both be about 2048 bits long. However, we don't have a way of generating and verifying a 2048 bit prime number with 100% accu...
In the [paper of Hsiao and Reyzin][1], Section $1.4$: > Note that to show that no *general* reduction from $P$ to $Q$ exists requires proving that $Q$ does not exist Since the statement is about trying to *rule out* the implication $Q \rightarrow P$, showing that $Q$ does *not* exist will indeed do the opposite:...
The original poster clarified that: - the application of RSA is signature (not encryption as originally stated); - at least one signature $s$, the value of $N$, and $e=3$ are given; - the signature is by signing an MD5 hash of a message, and a hash of the message matching the signature $s$ is also a given. The ...
say that we have an unknown stream cipher which output bytes and which have more than 10 years of existence. What can be the most probable algorithms if we consider the most 'populars' stream cipher algorithms?
what are the most common stream ciphers algorithms?
The original poster clarified that: - the application of RSA is signature (not encryption as originally stated); - at least one signature $s$, the value of $N$, and $e=3$ are given; - the signature is by signing an MD5 hash of a message, and a hash of the message matching the signature $s$ is also a given. The ...
The original poster clarified that: - the application of RSA is signature (not encryption as originally stated); - at least one signature $s$, the value of $N$, and $e=3$ are given; - the signature is by signing an MD5 hash of a message, and a hash of the message matching the signature $s$ is also a given. The ...
The original poster clarified that: - the application of RSA is signature (not encryption as originally stated); - at least one signature $s$, the value of $N$, and $e=3$ are given; - the signature is by signing an MD5 hash of a message, and a hash of the message matching the signature $s$ is also a given. The ...
The original poster clarified that: - the application of RSA is signature (not encryption as originally stated); - at least one signature $s$, the value of $N$, and $e=3$ are given; - the signature is by signing an MD5 hash of a message, and a hash of the message matching the signature $s$ is also a given. The ...
The original poster clarified that: - the application of RSA is signature (not encryption as originally stated); - at least one signature $s$, the value of $N$, and $e=3$ are given; - the signature is by signing an MD5 hash of a message, and a hash of the message matching the signature $s$ is also a given. The ...
This is the [paper](http://crypto.stanford.edu/~pgolle/papers/univrenc.pdf). On page 6, the paper describes a variant of El Gamal and a way of re-encrypting ciphertexts. I thought an easier way to do encryption is to output $(m(g^x)^y,g^y)$, and universal re-encryption can be done by $(m(g^x)^y(g^x)^z,g^yg^z)$ fo...
Why is the re-encryption algorithm in Universal Re-encryption for Mixnets more complicated than necessary?
Why is the re-encryption algorithm in Universal Re-encryption for Mixnets more complicated than apparently necessary?
say that we have an unknown stream cipher which output bytes and which have more than 10 years of existence. What can be the most probable algorithms if we consider the most 'populars' stream cipher algorithms? In order to find the most 'popular' stream ciphers, where can I find some statistics about the most implem...
Designing such a challenge is **Impossible**. If we assume that having a connection is equal to being able to exchange any piece of knowledge at any given time then the proof of impossibility of such challenge is as follows: **Proof.** First assume that there is such a challenge and Alice is capable of querying...
If we consider a set of numbers say a set s1={a,b,c,d} , where (a,b,c,d)>1 and the numbers a, b, c, d do not share any relation between them , i.e any set of numbers say 'n1','n2' from the set 's1' does not satisfy the following properties: n1+n2=0; n1*n2=1; then it is not possible to break fully homomorphic encrypt...
If we consider a set of numbers say a set $s=\{a,b,c,d\}$ , where $a,b,c,d>1$ and the numbers $a, b, c, d$ do not share any relation between them , i.e. for any two numbers, $n_1,n_2\in s$ the following relations are guaranteed to hold: $n_1+n_2\neq 0$ and $n_1*n_2\neq 1$. Is it possible to break the fully homomorp...
If we consider a set of numbers say a set $s=\{a,b,c,d\}$ , where $a,b,c,d>1$ and the numbers $a, b, c, d$ do not share any relation between them , i.e. for any two numbers, $n_1,n_2\in s$ the following relations are guaranteed to hold: $n_1+n_2\neq 0$ and $n_1*n_2\neq 1$. Is it possible to break the fully homomorp...
The original poster clarified that: - the application of RSA is signature (not encryption as originally stated); - at least one signature $s$, the value of $N$, and $e=3$ are given; - the signature is by signing an MD5 hash of a message, and a hash of the message matching the signature $s$ is also a given. The ...
The original poster clarified that: - the application of RSA is signature (not encryption as originally stated); - at least one signature $s$, the value of $N$, and $e=3$ are given; - the signature is by signing an MD5 hash of a message, and a hash of the message matching the signature $s$ is also a given. The ...
The original poster clarified that: - the application of RSA is signature (not encryption as originally stated); - at least one signature $s$, the value of $N$, and $e=3$ are given; - the signature is by signing an MD5 hash of a message, and a hash of the message matching the signature $s$ is also a given. The ...
Recently, Fujisaki and Okamoto provided a revised version of the Fujisaki-Okamoto transformation [1], a generic transformation for achieving IND-CCA2 security in the Random Oracle model. This new version is slightly different than the original [2] and the security proof does not define a knowledge extractor (the origin...
The original poster clarified that: - the application of RSA is signature (not encryption as originally stated); - at least one signature $s$, the value of $N$, and $e=3$ are given; - the signature is by signing an MD5 hash of a message, and a hash of the message matching the signature $s$ is also a given. The ...
Recently, Fujisaki and Okamoto provided a revised version of the Fujisaki-Okamoto transformation [1], a generic transformation for achieving IND-CCA2 security in the Random Oracle model. This new version is slightly different than the original [2] and the security proof does not define a knowledge extractor (the origin...
Recently, Fujisaki and Okamoto provided a revised version of the Fujisaki-Okamoto transformation [1], a generic transformation for achieving IND-CCA2 security in the Random Oracle model. This new version is slightly different than the original [2] and the security proof does not define a knowledge extractor (the origin...
The original poster clarified that: - the application of RSA is signature (not encryption as originally stated); - at least one signature $s$, the value of $N$, and $e=3$ are given; - the signature is by signing an MD5 hash of a message, and a hash of the message matching the signature $s$ is also a given. The ...
Why does an algorithm need a keyspace? I thought the person encrypting would define his/her own key.
Why does an algorithm need a keyspace?
An encryption algorithm does not *need* a keyspace. By definition, however, it has one. It sound to me like your confusion is mainly terminological. In cryptography, the "keyspace" of an encryption system is defined simply as the *set of all possible (distinct) keys that the algorithm can accept*. For example, ...
A new paper (https://eprint.iacr.org/2015/552.pdf) says: > This makes it possible to asymptotically and heuristically break the NTRU cryptosystem in subexponential time (without contradicting its security assumption). Does this mean NTRU is less secure now? By how much? [1]: https://eprint.iacr.org/2015/552....
NTRU less secure than previously thought?
Designing such a challenge is **Impossible**. If we assume that having a connection is equal to being able to exchange any piece of knowledge at any given time then the proof of impossibility of such challenge is as follows: **Proof.** First assume that there is such a challenge and Alice is capable of querying...
Say you have a file that ISN'T random. And you XOR every bit with a random bit (not pseudo, but really random). Can someone who sees only the result extract any information from it? Obviously, it won't be 100% accurate, but i imagine you can do some sort of stochastics and get a vague idea. If yes, how? If no, is there...
If you have a file and XOR every bit with a random bit, can you extract any information?
I've already replied to the question posted some days before. Montgomery multiplication is another way to perform modular multiplication in the residue system representation. The operation induced is in fact a group morphism. In $GF(p)$, $p$ prime, or in the multiplicative group $\mathbb{Z}/n\mathbb{Z}$, the transform...
Say you have a file that ***is not*** random, and you XOR every bit with a random bit (not pseudo, but really random). Can someone who sees only the result extract any information from it? Obviously, it won't be 100% accurate, but I imagine you can do some sort of stochastics and get a vague idea. If yes, how? If no, i...
I managed to implement the proxy re-encryption scheme from http://eprint.iacr.org/2009/189.pdf in Python 2.7, however I am having performance issues. As it is, I can run the algorithm for key sizes up to 5 bits, which is impractical. I think the problem is the lack of mod operations throughout the algorithm. As the...
Is there any restriction that the members to be accumulated in bilinear map (multiplicative) accumulator need to be relatively prime to P? Where P is the order of group.
I am reading about the security internals of Android. In the book [Android Security Internals][1], in chapter on *Cryptographic Providers*, there is a para stating: > On Android, CSPRNG implementations are seeded by reading seed bytes from the standard Linux /dev/urandom device file, which is an inter- face to the...
Why in Android kernel CSPRNG state is saved?
This Q & A http://security.stackexchange.com/questions/33123/hotp-with-as-hmac-hashing-algoritme-a-hash-from-the-sha-2-family says that the security of HMAC-SHA1 does not depend on resistance to collisions? Are they are saying specifically with respect to HOTP or for HMAC-SHA1 for any use? If HMAC-SHA1 is used...
Why is HMAC-SHA1 stil considered secure?
Why is HMAC-SHA1 still considered secure?
> If we not save the state, is it insecure? Yes, for an answer read on: > Isn't this saving the state making it predictable. Yes. If an attacker manages to get access to the `/data/system/entropy.dat` file shortly after the kernel has loaded, he will have good knowledge of the internal CSPRNG state, could pr...
This Q & A http://security.stackexchange.com/questions/33123/hotp-with-as-hmac-hashing-algoritme-a-hash-from-the-sha-2-family says that the security of HMAC-SHA1 does not depend on resistance to collisions? Are they are saying specifically with respect to HOTP or for HMAC-SHA1 for any use? If HMAC-SHA1 is used...
I am going through Dan Boneh's Cyprography lectures on Coursera. In Lecture 6 https://class.coursera.org/crypto-010/lecture/6 At 7:30 minutes, he discusses the problems with 802.11b design. I understand his critique. However, he then moves on to what would be better design at 12:55 minutes. He says that ...
Is it possible to do the following? Input would be to generate a new AES key, encrypt the private data with that key, encrypt the AES key with the FHE key, and send the FHE-encrypted AES key along with the AES encrypted data to the compute node.
In this whole answer I'll assume that through better hardware or algorithmic improvements, it has become routinely feasible to exhibit a collision for SHA-1 by a method similar to that of [Xiaoyun Wang, Yiqun Lisa Yin, and Hongbo Yu's attack][1], or [Marc Stevens's attack][2]. Neither has ever been achieved publicly, b...
In the first section of this answer I'll assume that through better hardware or algorithmic improvements, it has become routinely feasible to exhibit a collision for SHA-1 by a method similar to that of [Xiaoyun Wang, Yiqun Lisa Yin, and Hongbo Yu's attack][1], or [Marc Stevens's attack][2]. Neither has ever been achie...
In the first section of this answer I'll assume that through better hardware or algorithmic improvements, it has become routinely feasible to exhibit a collision for SHA-1 by a method similar to that of [Xiaoyun Wang, Yiqun Lisa Yin, and Hongbo Yu's attack][1], or [Marc Stevens's attack][2]. Neither has ever been achie...
Reading the libsodium [source](http://mob5.host.cs.st-andrews.ac.uk/html/d8/d84/a00001_source.html) I see that is uses a key length of 32 bytes (256 bit) for private/public key encryption. For RSA private/public key encryption a key length of 2048 (or 4095) bit is suggested. Why is the key length in libsodium so mu...
Looking at http://safecurves.cr.yp.to/ to find a safe curve, I find that most curves described here are of a different form from that generally used. In [Bouncy Castle](https://www.bouncycastle.org/), for example, `FpCurve`s take curves of the form $y^2 = x^3+ax+b$ (Weierstrass), whereas the (safe) curves found on t...
Imagine we have a scheme whose key is chosen from the set $\{0,1\}^\ell$. My question is: What is the size of key space for this scheme?
There is an [article][1] about the provided security of the CryptDB. The simple questions 1. Where is the row integrity? 2. Where is the completeness of the query results? 3. Where is the freshness of the data? 4. Where is the Authentication of the data? 5. What is the cost of the proxy-server, which per...
There is an [article][1] about the provided security of the CryptDB. The simple questions that challenge the security 1. Where is the row integrity? 2. Where is the completeness of the query results? 3. Where is the freshness of the data? 4. Where is the Authentication of the data? 5. What is the cost o...