instruction
stringlengths
15
30k
I'm not sure what this attack model is called - it's not known-plaintext and also not quite cipher-text-only. Say you have one hundred ciphertexts which you know are the result of encrypting exactly the same plaintext with one hundred different public keys. Is there any vulnerability here in terms of figuring out w...
I'm not sure what this attack model is called - it's not known-plaintext and also not quite cipher-text-only. It is similar to [this question](http://crypto.stackexchange.com/questions/1614/rsa-cracking-the-same-message-is-sent-to-two-different-people-problem?rq=1) except the general case (not just two keys) and using ...
I'm not sure what this attack model is called - it's not known-plaintext and also not quite cipher-text-only. It is similar to [this question](http://crypto.stackexchange.com/questions/1614/rsa-cracking-the-same-message-is-sent-to-two-different-people-problem?rq=1) except the general case (not just two keys) and using ...
One thing cryptography articles never seem to explain is how the message actually gets encrypted. You get this long-winded lecture on number theory which ends with, Ta Da! and we have a public and private key. Then, they never explain the process of exactly how some 100,000 byte word document gets encrypted using the p...
How is a public key actually used to encrypt something?
I'm learning modular exponentiation with Chinese remainder theorem. I found a great answer from below [http://crypto.stackexchange.com/questions/5296/how-can-i-use-eulers-totient-and-the-chinese-remainder-theorem-for-modular-expon][1] But I can't understand the last step of construction from Cp and Cq very wel...
I have trouble to understand how I can show that the Decisional Diffie-Hellman problem (DDH) is self-reducible. I found this as a description of a random self-reducible problem. Given an instance I1, it can be solved as follows: (a) transform I1 into a uniformly random instance I2 (b) solve I2 and...
How can I show that the DDH problem is self-reducible?
I have a system that signs plain text messages using a message authentication code (MAC) encrypted with Triple DES. The short message is used on connection to establish a session key, so it would take an attacker a long time to compile a lot of plaintext / MAC examples. I need to establish a key expiration policy t...
I'm learning modular exponentiation with Chinese remainder theorem. I found a great answer from below [http://crypto.stackexchange.com/questions/5296/how-can-i-use-eulers-totient-and-the-chinese-remainder-theorem-for-modular-expon][1] But I can't understand the last step of construction from $C_p$ and $C_q$ ve...
If I want to check the integrity of some piece of data, I can check that a cryptographic hash of the data corresponds to a known hash. Alternatively I can also check a digital signature on the data and see that it corresponds to a known authority for the data. I can use certificates or not for this. Lastly I can...
Terminology: What is the word describing a hash key, a crypto key, and a certificate?
If I want to check the integrity of some piece of data, I can check that a cryptographic hash of the data corresponds to a known hash. Alternatively I can also check a digital signature on the data and see that it corresponds to a known authority for the data. I can use certificates or not for this. I can also v...
I have a system that signs plain text messages using a message authentication code (MAC) encrypted with 3-key Triple DES. The short message is used on connection to establish a session key, so it would take an attacker a long time to compile a lot of plaintext / MAC examples. I need to establish a key expiration po...
> One thing cryptography articles never seem to explain is how the message actually gets encrypted. Either you're reading really bad articles or you're missing a step. Try reading better articles and follow along very carefully. > Then, they never explain the process of exactly how some 100,000 byte word docume...
I would like to perform a variant of Elliptic Curve ElGamal in java using the BouncyCastle libraries. I currently face the difficulty of mapping a message $m$ onto the elliptic curve $E_p$. I have so far multiplied the generator $g$ of $E_p$ by the message $m$. However, this is hardly reversible. Hence I cannot retr...
I am trying to find the article to reference when discussing the Diffie-Hellman key exchange. According to Wikipedia Hellman said that "The system...has since become known as Diffie–Hellman key exchange. While that system was first described in a paper by Diffie and me, it is a public key distribution system, a conc...
Where did Martin Hellman acknowledge Ralph Merkle's contribution to public-key cryptography?
I am trying to find the article to reference when discussing the [Diffie-Hellman key exchange](http://en.wikipedia.org/wiki/Diffie–Hellman_key_exchange). According to Wikipedia Hellman said that >The system...has since become known as Diffie–Hellman key exchange. While that system was first described in a paper b...
I am currently trying to create an ECCCurve for E-521. Unfortunately, it is not currently a named curve in [the library I am using](https://github.com/onovotny/BouncyCastle-PCL), so I will have to define it manually. I am using the definition of the E-521 curve provided [here](http://tools.ietf.org/html/draft-ladd-s...
How do I convert the definition of E-521 into a curve definition a la Bouncy Castle?
One-Time-Pad is information theoretically secure as long as the random number stream is evenly long or longer than the data stream it encrypts, for a "decyphered" message could have been any message with the same length as the given with the same probabillity. Does the same apply to symmetric ciphers, too? For inst...
Would a symmetric cipher with a keylength a big as the data length be information theoretically secure?
The likelyhood of breaking, for instance, an AES-128 cipher is around 50% after 2⁶⁴ tries in brute force, meaning that I've got to try 2⁶⁴ keys to achieve this chance. What if I (hypothetically) had recorded 2⁶⁴ bits of data encrypted with the same AES-128 key? How does this help in cryptoanalysis? And how is the...
How does the key size per data bit influence the security?
The likelihood of breaking, for instance, an AES-128 cipher is around 50% after $2^{64}$ tries in brute force, meaning that I've got to try $2^{64}$ keys to achieve this chance. What if I (hypothetically) had recorded $2^{64}$ bits of data encrypted with the same AES-128 key? How does this help in cryptoanalysis? ...
The likelihood of breaking, for instance, an AES-128 cipher is 100% after $2^{128}$ tries in brute force, meaning that I've got to try $2^{128}$ keys to certainly break it. What if I (hypothetically) had recorded $2^{128}$ bits of data encrypted with the same AES-128 key? How does this help in cryptoanalysis? And...
One-Time-Pad is information theoretically secure as long as the random number stream is evenly long or longer than the data stream it encrypts, for a "decyphered" message could have been any message with the same length as the given with the same probabillity. Does the same apply to symmetric ciphers, too? For inst...
I need to uniquely assign a 32 bit integer to a collection of human readable strings (i.e. they will not be generated with hash collision in mind). I don't expect more than a few thousand strings. I would like to evaluate the possibility of using the first 32 bits of the md5 sum for this. What is the distribution of...
Can a monoalphabetic substitution cipher attain perfect secrecy? definition of perfect secrecy: $Pr[Enc _k(m1) = c] = P r[Enc_k(m2) = c]$
Can a monoalphabetic substitution cipher attain perfect secrecy?
Why SHA-1 algorithm have exactly 80 rounds? Is it to reduce collisions? If yes, then why SHA-2 and SHA-3 have less number of rounds?
Why SHA-1 have 80 rounds?
Most hashes are built from permutations (either keyed permutations/block-cipher, as in MD5, SHA-1 and SHA-2, or unkeyed permutations as in Keccak/SHA-3 and CubeHash). A permutation is a shuffling of the inputs. Once you have a good random permutation, you can easily build a hash from it. See [Construction of One-way co...
Why does SHA-1 algorithm have exactly 80 rounds? Is it to reduce collisions? If yes, then why do SHA-2 and SHA-3 have a lower number of rounds?
Why does SHA-1 have 80 rounds?
In hash functions (and similarly block ciphers) each round applies a non-linear function to its input. This function is somewhat difficult to calculate backwards (and it needs a few other properties, but let's leave it at that). This concept is called [diffusion](http://en.wikipedia.org/wiki/Diffusion_%28cryptography%2...
Can a monoalphabetic substitution cipher attain perfect secrecy? Definition of perfect secrecy: $${\rm Pr}[\,{\rm Enc}_k(m_1) = c\,] = {\rm Pr}[\,{\rm Enc}_k(m_2) = c\,]$$
Since this is homework, let me just give you a hint: consider the two-character messages $m_1 = \text{"aa"}$ and $m_2 = \text{"ab"}$. Can the sets of possible encryptions of $m_1$ and $m_2$ under a monoalphabetic substitution cipher overlap? Why (not)? What does this imply about perfect secrecy as defined in your ...
Since this is homework, let me just give you a hint: consider the two-character messages $m_1 = \text{"aa"}$ and $m_2 = \text{"ab"}$. Given a ciphertext $c$ encrypted with a monoalphabetic substitution cipher, can you tell which of $m_1$ or $m_2$ it corresponds to, even without knowing the key? Why (not)? What doe...
I am very curious on the fact that SHA,MD5 and all related Hash Functions change the output even by changing one bit in input Message.Why is that?
I was trying to figure out how HOTP kept from wrapping over, when I saw this explanation of how it works, by Thomas Pornin [[source](http://crypto.stackexchange.com/a/843/8911)]: >The intended scenario is the following: the client has a handheld device which outputs the >successive passwords, one new password per but...
Please let me know if this is not the right place to ask this question. I will remove it. I am trying to find how much time an AES encryption and decryption takes for a given amount of data and key. In all the cases encryption takes way lesser processing time than decryption. I tried to get this answer somewhere els...
I'm writing some code to digitally sign certain files (JSON, if you must know), and I'm trying to understand the use cases, not being a crypto guy myself. I understand there are use cases where several parties all need to sign the same content, e.g. the two parties who enter a contract sign it to indicate their appr...
Are there use cases where a signature itself needs to be signed?
Most hashes are built from permutations (either keyed permutations/block-ciphers, as in MD5, SHA-1 and SHA-2, or unkeyed permutations as in Keccak/SHA-3 and CubeHash). A permutation is a shuffling of the inputs. Once you have a good random permutation, you can easily build a hash from it. See [Construction of One-way c...
Please let me know if this is not the right place to ask this question. I will remove it. I am trying to find how much time an AES encryption and decryption takes for a given amount of data and key. In all the cases encryption takes way lesser processing time than decryption. I tried to get this answer somewhere els...
Maybe. Why not? Why would you rule this out? A signature is just bits. When you sign a message, you sign a stream of bits. If you are implementing a signature API, your API should allow a signer to sign any byte-sequence they like, and should allow them to get the signature as a byte-sequence. I can't imagine any...
I have a question about Pseudo Random Functions. Let $f:\{0,1\}^m \times \{0,1\}^n → \{0,1\}^n$ be a secure PRF. Define $F(k,x) = f(k,x) - f(k, x-1 \bmod 2^{n}) \bmod 2^{n}$. Is $F$ is a **secure** PRF?
Is this a pseudo random function (PRF)? F(k,x) = f(k,x) - f(k,x-1)
I'm looking for a pseudorandom function (PRF) with "traitor-tracing" properties. More specifically, I'd like there to be multiple equivalent keys, so I can give different parties different keys, but have them yield the same operation. In a standard PRF, there is a single key $k$, and everyone who uses the PRF is gi...
I'm writing some code to digitally sign certain files (JSON, if you must know), and I'm trying to understand the use cases, not being a crypto guy myself. I understand there are use cases where several parties all need to sign the same content, e.g. the two parties who enter a contract sign it to indicate their appr...
Is it possible to accomplish the following scheme? There is a Server (S) and many clients. Each client enrolls with S, exposing its real identity; S assigns to each of them a unique identifier. Then, someone sends to S a claim such that S would be able to tell that this claim comes from one of the enrolled cli...
First I'd like to note that I'm really a beginner at cryptography, and while this interests me and while I have researched it in the past few months, there is still a lot of things that simply aren't clear to me, and I would like to have them clarified so I can move on. Let's say (because this scenario is what I hav...
Is there need for message authentication if a public key is transmitted and then used to encrypt a symmetric key?
Is it possible to accomplish the following scheme? There is a Server (S) and many clients. Each client enrolls with S, exposing its real identity; S saves the real identity information in its database and executes some keys/identifiers exchange with each client (could be something like DHE or RSA). Then, some...
> Is there even need for the hash in the server response so the client knows it hasn't been MITM'd (because the server has proved it decrypted the client's public key)? Sharing the hash of a key [is a bit risky][1] in general so I'd say shy away from doing that. In your case there's another reason why you shouldn't:...
I can't understand how the "cryptographic functions" are to be selected RSA + OAEP which are used in OAEP. How to choose these "cryptographic functions"(G and H)? ![enter image description here][1] [1]: https://i.stack.imgur.com/sqEkK.png
*Notice: This answer assumes the user doesn't encrypt the initial contact because I misread that part. Will update accordingly in due course.* --- > Is there even need for the hash in the server response so the client knows it hasn't been MITM'd (because the server has proved it decrypted the client's public key)...
In hash functions (and similarly block ciphers) each round applies a non-linear function to its input. This function is somewhat difficult to calculate backwards (and it needs a few other properties, but let's leave it at that). This concept is called [diffusion](http://en.wikipedia.org/wiki/Diffusion_%28cryptography%2...
In hash functions (and similarly block ciphers) each round applies a non-linear function to its input. This function is somewhat difficult to calculate backwards (and it needs a few other properties, but let's leave it at that). This concept is called [diffusion](http://en.wikipedia.org/wiki/Diffusion_%28cryptography%2...
How to perform the Multiplicative Inverse Modulo in International Data Encryption Algorithm? I don't understand on how to perform it… For example, let's say I have a value of `cf80` and the value that is appearing to me is this `3080`. This is the thing that I've done based on my understanding: answer = 53120...
I can't really understand MixColumns in Advanced Encryption Standard, can anyone help me how to do this? I found some topic in the internet about MixColumns, but I still have a lot of question to ask. ex. $$ \begin{bmatrix} \mathtt{d4} \\ \mathtt{bf} \\ \mathtt{5d} \\ \mathtt{30} \\ \end{bmatrix} \cdot ...
There are standard schemes for obfuscating a point function; I'm wondering if we know how to obfuscate a slight generalization of a point function. I'll elaborate more precisely. **Definition 1.** A point function is a function $f_{v,w}$ defined by $f_{v,w}(x) = w$ if $v=x$ and $f_{v,w}(x)=0$ otherwise. We know ...
Recently, there has been [a major theoretical breakthrough](http://eprint.iacr.org/2013/451.pdf) in program obfuscation, in the area of indistinguishability obfuscation. Background: Indistinguishability obfuscation is a form of program obfuscation, with the following security property: if $C_1,C_2$ are two different...
What functions allow for practical indistinguishability obfuscation?
<h2> Diffie Hellman </h2> [Diffie Hellman](http://en.wikipedia.org/wiki/Diffie-Hellman_key_exchange) is a key exchange protocol. It is an **interactive** protocol with the aim that two parties can compute a common secret which can then be used to derive a secret key used for some symmetric encryption scheme. I t...
<h2> Diffie Hellman </h2> [Diffie Hellman](http://en.wikipedia.org/wiki/Diffie-Hellman_key_exchange) is a key exchange protocol. It is an **interactive** protocol with the aim that two parties can compute a common secret which can then be used to derive a secret key used for some symmetric encryption scheme. I t...
I’m implementing some file encryption module with random-access capability and AES-CTR seems the right way to go. I understand that reusing Keys and IVs can expose the file to ‘Stream Cipher Attacks’ when portions of the file are being modified (assuming previous versions of the file are still available). I want...
I’m implementing some file encryption module with random-access capability and AES-CTR seems the right way to go. I understand that reusing Keys and IVs can expose the file to ‘Stream Cipher Attacks’ when portions of the file are being modified (assuming previous versions of the file are still available). I want...
Some people define "encryption" in such a way as to exclude analog techniques -- there is no such thing as "analog encryption", they would say, because any analog method of obscuring the contents of a transmission is, by their definition, "scrambling", not encryption. There have been several such scrambling ("analog...
Let f(x) = ax +b be an affine encryption function. a and the cardinal of the field of our keys K (in English, 26) must be coprime so that the encryption function is bijective and the decryption function defined and bijective as well. Could you please clarify how (in terms of congruences) the two having a pgcd>1 make...
Let $f(x) = ax + b$ be an affine encryption function. $a$ and the cardinal of the field of our keys $K$ (in English, `26`) must be coprime so that the encryption function is bijective and the decryption function defined and bijective as well. Could you please clarify how (in terms of congruences) the two having a $p...
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 Caslte](https://www.bouncycastle.org/), for example, `FpCurve`s take curves of the form y^2 = x^3+ax+b, whereas the (safe) curves found on the above linked ...
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 Caslte](https://www.bouncycastle.org/), for example, `FpCurve`s take curves of the form $y^2 = x^3+ax+b$, whereas the (safe) curves found on the above linke...
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 Caslte](https://www.bouncycastle.org/), for example, `FpCurve`s take curves of the form $y^2 = x^3+ax+b$, whereas the (safe) curves found on the above linke...
I know that rsa normally is made to make it with big integers, but i trying to make the algorithm myself (with the help of wikipedia) and I´m making it with small numbers to track the problems easily. The problem is that sometimes the decryption of the crypted message is wrong! Exactly when I choose: p=11 and q=...
rsa problem? why if i choose two specific small prime numbers goes wrong
I know that rsa normally is made to make it with big integers, but i trying to make the algorithm myself (with the help of wikipedia) and I´m making it with small numbers to track the problems easily. The problem is that sometimes the decryption of the crypted message is wrong! Exactly when I choose `p=11` and `q=5...
RSA problem if i choose two specific small prime numbers?
I’m implementing some file encryption module with random-access capability and AES-CTR seems the right way to go. I understand that reusing Keys and IVs can expose the file to ‘Stream Cipher Attacks’ when portions of the file are being modified (assuming previous versions of the file are still available). I want...
I am trying to learn about the Elliptic Curve Digital Signature Algorithm (ECDSA) by verifying the results in some example calculations. I found a PDF of example ECDSA calculations from NIST here: http://csrc.nist.gov/groups/ST/toolkit/documents/Examples/ECDSA_Prime.pdf In the section "Example of ECDSA with P-256"...
You plan to use a public-key cryptosystem based on the RSA trapdoor permutation in three different real-life applications, in which the attacker has, respectively, only one of the following resources: (1) a single computer, (2) a collection of computers distributed across the Internet, and (3) a quantum computer. When ...
It's easy to create an RSA modulus where **almost** no one knows the factors: for example, I can generate two 1024-bit primes $p$ and $q$ and set $n=pq$. If I publish $n$, I will be the only person in the world who knows, or **can know**, $p$ and $q$. The (now defunct) RSA Factoring Challenge numbers were generat...
How can I create an RSA modulus for which no one knows the factors?
You plan to use a public-key cryptosystem based on the RSA trapdoor permutation in three different real-life applications, in which the attacker has, respectively, only one of the following resources: 1. a single computer, 2. a collection of computers distributed across the Internet, and 3. a quantum computer. ...
Creating a 2048bits RSA keypair I figured that doing this using - openssl takes as an input 32bytes of "randomness" from `/dev/urandom` - gpg (openGPG) takes as input 300 bytes of "randomness" from `/dev/random` My questions is. Does the number of randomness influence the cryptographic qualities of the resul...
Difference RSA keypair creation openSSL and openPGP?
My own answer would be: 2048, 2048, and still 2048 bits. Why ? Because: - 2048-bit is the current "standard recommendation"; it has been so for quite some time, and is likely to remain so for quite some time (decades). See [this site][1] for pointers. - There are plans for removing support for keys shorter tha...
I am looking at the different attacks on RSA. I came across known-plaintext attack where the public key can be used to encrypt all possible messages until it finds a match on the sent encrypted message. However, on the book I found in the library it seems this form of attack is also called "Forward search attack". ...
I am a beginner to the homomorphic encryption.One thing makes me very confused is that why we use the circuit concept or approach to homomorphic encryption?Gentry's paper does not discuss it in details. Are there any paper or books could make me have a better understanding of it? i mean the circuit's part?Thank you ver...
why we apply the concept of circuit into homomorphic encryption scheme?
In the recent [iOS Security][1] white paper from Apple (February 2014), the section on iMessage discusses using two different asymmetric key types as part of its standard operation: > When a user turns on iMessage, the device generates two pairs of keys for use with the service: an RSA 1280-bit key for encryption and ...
Should different key pairs be used for signing and encryption?
I am a beginner to the concept of homomorphic encryption. One thing that makes me very confused is why we use the circuit concept or approach to homomorphic encryption. Gentry's paper does not discuss it in detail. Are there any papers or books could make me have a better understanding of it? <br> (I mean the circuit...
Why do we apply the concept of circuit in homomorphic encryption schemes?
I am building an open source hardware system that will be used to control things over the internet. The system consists of a Base Station and Modules which use wireless communication at 2.4GHz to exchange data. Now I have come to the point where I need to protect the transmitted RF data against re-transmission and d...
I am learning SSH protocol. With my current understanding of SSH protocol, I think that message digest algorithms for using in digital signature is derived from Key Exchange. But Openssh implementation uses only SHA1 for signing and verification of digital signatures. SHA1 is hard coded in these two functions, ssh_dss_...
Why does Openssh use only SHA1 for sign and verify of digital signatures?
In [FIPS 140][1]-1 there are 4 statistical random number generator tests (The Monobit Test, The Poker Test, The Runs Test and The Long Runs Test. Then FIPS 140-2 came along and supposedly tightened the criteria for these tests. I'll provide a short summary of the changes here: **The Monobit Test** Count the numbe...