instruction
stringlengths
15
30k
Given: F is a pseudorandom function, G is a pseudorandom generator with $l(n) = n+1$. The following schemes should be classified as being insecure, IND-COA secure, IND-CPA secure. 1. To encrypt $m \in \{0, 1\}^{n+1}$ choose a random $r \leftarrow \{0, 1\}^n$ and output $[r, G(r) \oplus m]$ 2. To encrypt $m \in \{...
Given a pseudorandom function F, is $(F_k(r) \; | \; F_k(r + 1))$ also a PRF?
Of the two, identity based is more secure. In fact, unless you have left details out of the question, a SHA-1 hash (or any hash for that matter) of the sender's identity and the message content provides no source authentication (or data integrity check). According to your comment, the way you would use SHA-1 to auth...
I know it's hard to find e'th root of mod $n=p_1*p_2$, and if it would be possible we would brake the RSA. But how hard it is to take e'th root of mod p (p is a prime and $gcd(e,p-1)=1$)?
How "hard" it is to take an e'th root mod p?
When thinking about a pairing-based cryptographic scheme, I encountered the following problem. Let $e \colon G_1, G_2 \to G_T$ be a Type 3 pairing. Then: > Given $P, zP \in G_1$ and $Q, zQ \in G_2$, compute $z$. I haven't found this problem in the literature anywhere, so I am not aware of any name of it. I'm wond...
I know it's hard to find the $e$th root of a number mod $n=p_1*p_2$, and if it would be possible we could break RSA. But how hard it is to take an $e$th root mod $p$ where $p$ is a prime and $\gcd(e,p-1)=1$?
I am supposed to implement ECC over binary field *(in C++)* for equations of the type - $y^2 + xy = x^3 + ax + b$, as my project. I wish to include the following features : 1. The user will enter a prime number $m$, which will serve as the order of the binary field as $2^m$. 2. For the given $m$, the irreducible ...
1:1 ciphers ------------------ Many modern ciphers create ciphertexts that include the plaintext encrypted with a 1:1 [stream cipher][1], plus a few more characters that help defend against certain known [stream cipher attacks][2]. As poncho and Rup have suggested, Alice and Bob somehow generate the same long st...
As I understand, for RSA n = p x q. For the key to be safe enough from getting factored, p and q have to be far from each other. How far do they have to be? For example, if I have 2 1024 primes that both start with a 1 and the difference between them (p-q) is ~1022-1023 bits, is that good enough?
Given: F is a pseudorandom function, G is a pseudorandom generator with $l(n) = n+1$. The following schemes should be classified as being insecure, IND-COA secure, IND-CPA secure. 1. To encrypt $m \in \{0, 1\}^{n+1}$ choose a random $r \leftarrow \{0, 1\}^n$ and output $[r, G(r) \oplus m]$ 2. To encrypt $m \in \{...
I am working on the following excercise question: Consider the following construction of a “keyed” hash function from Katz & Lindell (ex. 7.22 (1st ed.)/ 8.21(2nd ed.)). Gen : On input 1n , generate a cyclic group G of order q, where q is an n-bit prime, and a generator h1. Then select h2, . . . , ht ← G. Output s...
As I understand, for RSA $n = p \cdot q$. For the key to be safe enough from getting factored, $p$ and $q$ have to be far from each other. How far do they have to be? For example, if I have two $1024$-bit primes that both start with a 1 and the difference between them $(p-q)$ is ~$1022$-$1023$ bits, is that good enough...
I am working on the following exercise question: >Consider the following construction of a “keyed” hash function from Katz & Lindell (ex. 7.22 (1st ed.)/ 8.21(2nd ed.)). > Gen : On input 1n , generate a cyclic group G of order q, where q is an n-bit prime, and a generator h1. Then select h2, . . . , ht ← G. Outpu...
Can anyone explain to me (or send a link to somewhere) how round keys are added in AES-256? I understand that the round keys is added to the state matrix for each round and how XOR works. But since the state matrix is always 128 bits, how do you add an 256 bit round key? I might be confused on a higher level right n...
> how do you add an 256 bit round key? Actually, each round key is 128 bits, and so XORing them into the state matrix is easy. What the AES key expansion process does is take the 256 bit AES key, and generate 15 round keys (one more than the number of AES rounds). Now, for AES256, the first two round keys are, i...
When thinking about a pairing-based cryptographic scheme, I encountered the following problem. Let $e \colon G_1, G_2 \to G_T$ be a Type 3 pairing. Then: > Given $P, zP \in G_1$ and $Q, zQ \in G_2$, compute $z$. I haven't found this problem in the literature anywhere, so I am not aware of any name of it. It clear...
Suppose a client (Alice) goes to an HTTPS website (Bob) over TLS 1.2. - Alice sends Client Hello with some random number $r_a$. - Bob sends Server Hello with another random number $r_b$. - Suppose they settle on some cipher suite (e.g. RSA, DHE, AES, and SHA1) - Bob sends server certificate - Bob signs and ...
Username and Password: How does it work?
Suppose a client (Alice) goes to an HTTPS website (Bob) over TLS 1.2. - Alice sends Client Hello with some random number $r_a$. - Bob sends Server Hello with another random number $r_b$. - Suppose they settle on some cipher suite (e.g. RSA, DHE, AES, and SHA1) - Bob sends server certificate - Bob signs and ...
I am supposed to implement ECC over binary field *(in C++)* for equations of the type - $y^2 + xy = x^3 + ax + b$, as my project. I wish to include the following features : 1. The user will enter a prime number $m$, which will serve as the order of the binary field as $2^m$. 2. For the given $m$, the irreducible ...
Suppose a client (Alice) goes to an HTTPS website (Bob) over TLS 1.2. - Alice sends Client Hello with some random number $r_a$. - Bob sends Server Hello with another random number $r_b$. - Suppose they settle on some cipher suite (e.g. RSA, DHE, AES, and SHA1) - Bob sends server certificate - Bob signs and ...
Given: F is a pseudorandom function, G is a pseudorandom generator with $l(n) = n+1$. The following schemes should be classified as being insecure, IND-COA secure, IND-CPA secure. 1. To encrypt $m \in \{0, 1\}^{n+1}$ choose a random $r \leftarrow \{0, 1\}^n$ and output $[r, G(r) \oplus m]$ 2. To encrypt $m \in \{...
"Will they just scrap all the previously negotiated keys and switch to TLS-PSK with <br> Password-Authenticated Key Agreement or Password-Based Key Derivation?" No. <br><br><br> "What will happen next?" <br> "Could you please describe how client and server use username and password?" <br> "What are the steps...
Yes, it is good enough. In the case of random primes the distance as large as the numbers with high probability. With the recommended key-size ($2048$-bit) one only needs to generate two random primes of the right size ($1024$-bits each). This is generally done throwing a random number of $1024$ bits, forcing the fi...
Yes, it is good enough. In the case of random primes the distance as large as the numbers with high probability. With the recommended key-size ($2048$-bit) one only needs to generate two random primes of the right size ($1024$-bits each). This is generally done throwing a random number of $1024$ bits, forcing the fi...
> 1. Insecure, since an attacker A is not only given the ciphertext $c$, but also the key $r$ with which the message was encrypted. Thus, it can easily decrypt the ciphertext. Correct, there is no encryption here. > 2. I would say that it's **not** IND-CPA secure, since it's deterministic. Is that true? And how c...
Given: F is a pseudorandom function, G is a pseudorandom generator with $l(n) = n+1$. The following schemes should be classified as being insecure, IND-COA secure, IND-CPA secure. 1. To encrypt $m \in \{0, 1\}^{n+1}$ choose a random $r \leftarrow \{0, 1\}^n$ and output $[r, G(r) \oplus m]$ 2. To encrypt $m \in \{...
Given: F is a pseudorandom function, G is a pseudorandom generator with $l(n) = n+1$. The following schemes should be classified as being insecure, IND-COA secure, IND-CPA secure. 1. To encrypt $m \in \{0, 1\}^{n+1}$ choose a random $r \leftarrow \{0, 1\}^n$ and output $[r, G(r) \oplus m]$ 2. To encrypt $m \in \{...
I am working on a UDP based file transfer protocol. Congestion Control, Resending of packages and other UDP challenges are dealt with - speedtests shows that the protocol is up to 10 times faster than e.g. HTTP for transferring large files when there are latencys/rtt > 100 ms (e.g. between Europe and the US). The pr...
I am working on a UDP based file transfer protocol. Congestion Control, Resending of packages and other UDP challenges are dealt with - speedtests shows that the protocol is up to 10 times faster than e.g. HTTP for transferring large files when there are latencys/rtt > 100 ms (e.g. between Europe and the US). The pr...
The [other answer][1] correctly explains how we could make a modern stream cipher, with a public random IV at the beginning of ciphertext used (together with the key) in the setup of a keystream generator, restricted to the range $[0..35]$, and using addition modulo 36 (Beaufort cipher) to encipher each character. H...
I am working on a UDP based file transfer protocol. Congestion Control, Resending of packages and other UDP challenges are dealt with - speedtests shows that the protocol is up to 10 times faster than e.g. HTTP for transferring large files when there are latencys/rtt > 100 ms (e.g. between Europe and the US). The pr...
The [other answer][1] correctly explains how we could make a modern stream cipher, with a public random IV at the beginning of ciphertext used (together with the key) in the setup of a keystream generator, restricted to the range $[0..35]$, and using addition modulo $36$ (Beaufort cipher) to encipher each character. ...
The [other answer][1] correctly explains how we could make a modern stream cipher, with a public random IV at the beginning of ciphertext used (together with the key) in the setup of a keystream generator, restricted to the range $[0..35]$, and using addition modulo $36$ (Beaufort cipher) to encipher each character. ...
I am working on a UDP based file transfer protocol. Congestion Control, Resending of packages and other UDP challenges are dealt with - speedtests shows that the protocol is up to 10 times faster than e.g. HTTP for transferring large files when the latency/rtt is > 100 ms (e.g. between Europe and the US). The protoc...
The [other answer][1] correctly explains how we could make a modern stream cipher, with a public random IV at the beginning of ciphertext used (together with the key) in the setup of a keystream generator, restricted to the range $[0..35]$, and using addition modulo $36$ (Beaufort cipher) to encipher each character. ...
The [other answer][1] correctly explains how we could make a modern stream cipher, with a public random IV at the beginning of ciphertext used (together with the key) in the setup of a keystream generator, restricted to the range $[0..35]$, and using addition modulo $36$ (Beaufort cipher) to encipher each character. ...
Here's the link: [http://www.buzzfeed.com/sheerafrenkel/nearly-40-million-people-might-not-be-able-to-safely-browse#.rnOonjOD][1] There are several articles floating around on this topic. The gist of it is that in (mostly) developing countries, people still using mobile/computing devices that are 5 years old (or ...
Article: Up to 40 Million Effectively cut off Internet due to SHA1 deprecation?
Here's the link: [http://www.buzzfeed.com/sheerafrenkel/nearly-40-million-people-might-not-be-able-to-safely-browse#.rnOonjOD][1] There are several articles floating around on this topic. The gist of it is that in (mostly) developing countries, people still using mobile/computing devices that are 5 years old (or ...
I am a junior in high school and I am currently studying algebra 2. Where can I go to learn about the mathematics behind cryptography? I have a very basic knowledge of cryptography, but I am really interested in things like, why is a 2^256 bit cipher so secure? I would really like to learn about things like that so I c...
How can I study the math behind cryptography?
I am a junior in high school and I am currently studying algebra 2. Where can I go to learn about the mathematics behind cryptography? I have a very basic knowledge of cryptography, but I am really interested in things like, why is a 2^256 bit cipher so secure? I would really like to learn about things like that so I c...
Here's the link: [http://www.buzzfeed.com/sheerafrenkel/nearly-40-million-people-might-not-be-able-to-safely-browse#.rnOonjOD][1] There are several articles floating around on this topic. The gist of it is that in (mostly) developing countries, people still using mobile/computing devices that are 5 years old (or ...
There are [articles][1] floating around the topic of SHA-1 deprecation. The gist of it is that in (mostly) developing countries, people are still using mobile/computing devices that are 5 years old (or older) and do not support SHA-2. As a consequence, the deprecation of SHA-1 would result in their being "cut off from ...
Would SHA-1 be safe for certificates with short validity?
Despite the fact that Marsaglia's MWC PRNG (multiply-with-carry random number generator) is considered to be *"the mother of all RNGs"*, it does not seem to be considered to be a CSPRNG (cryptographically secure pseudo-random number generator) even though it passes several statistical randomness tests, including *ENT* ...
Quoting the article [Gone in 60 Months or Less](http://www.infosecisland.com/blogview/23407-Gone-in-60-Months-or-Less.html): >The National Institute of Standards and Technology (NIST) has disallowed the use of 1024-bit keys after 31 December 2013 because they are insecure. Rapid advances in computational power and c...
I'm currently in a course in Cryptography, and was wondering why pseudorandom function families exist at all. If there existed one pseudorandom function f(x), based on its definition, could that not be used in all cases where a pseudorandom function is needed? Why would pseudorandom functions ever need to be sampled fr...
What is the purpose of Pseudorandom Function Families (PRFs)?
Despite the fact that Marsaglia's MWC PRNG (multiply-with-carry random number generator) is considered to be *"the mother of all RNGs"*, it does not seem to be considered to be a CSPRNG (cryptographically secure pseudo-random number generator) even though it passes several statistical randomness tests, including *ENT* ...
One of the drawbacks of OTP is that it can require an inconveniently long key. Besides that, it doesn’t provide data authentication. Therefore, I have been working on an algorithm idea, which I hope to be more powerful and efficient than OTP: 1. Encrypt plaintext with a block cipher (something with strong avalanche ...
There's quite a few things wrong with this. For starters, a block cipher does not imply authentication. Common block cipher modes such as CTR, CBC, and (god forbid) ECB provide nothing but pure encryption. If you want authentication, look into the GCM block cipher. AES-GCM is possibly the better way to go here. You ...
I just started to study lattice cryptography. I'm now studying worst-case to average-case reduction for SIS. In [previous question][1], "worst means any and average means random". And I wonder why Shortest Independent Vectors Problem(SIVP) is worst case problem. And, does SIVP means that "For *...
Why SIVP Is Worst Case Problem?
Why are some x-coordinates unsuitable for an ECDSA generator point?
Is it okay to use an HMAC of the plaintext and the key as the IV for symmetric cryptography?
Is it okay to use an HMAC of the plaintext and a (possibly distinct) key as the IV for symmetric cryptography?
I am working on a multiplayer game and am looking for a way to efficiently confirm who sent the request to the server. I originally planned to use RSA, but it's too computationally expensive, and I also don't need data encrypted. What should I do/use for this purpose?
Is there any MPC scheme that allows a function with several secret inputs to be computed, while the output can only become known to one specific party? If not, is this even possible?
What is the difference between RCCA and CCA-2?
If the base is same and exponents are different, for e.g. R1=b^x mod p; R2=b^y mod p; R3=b^z mod p; To calculate R1, R2 and R3 at the same time then my question is, is it takes around one exponentiation time or three exponentiations time? (I feel it is one exponentiation time) Pls clarify.
If the base is same and exponents are different, for e.g. R1=b^x mod p; R2=b^y mod p; R3=b^z mod p; (p is large prime (2048 bit); x, y and z - 160 bit integers)) To calculate R1, R2 and R3 at the same time then my question is, is it takes around one exponentiation time or three exponentiations time? (I feel it...
What do the numbers stand for in the names of cryptographic functions, for example `AES-256`, `RSA-1024` or `SHA-256`? Do they always refer to key sizes, or is it a different measure for every algorithm? Is there some convention about this?
What do numbers in a crypto algorithm stand for? Is there a convention?
In AES-256 and RSA-1024, the numbers refer to the key size. For SHA-256, it refers to the output size. Though there is no hard, fast rule. For example, in the [SHA-3](https://en.wikipedia.org/wiki/SHA-3#Instances) family, there are hash functions with variable length output, SHAKE128 and SHAKE256. The numbers there ref...
I'm encrypting a file and I'm using an initialisation vector. Given that the IV doesn't need to be a secret, is it secure if I add it to the encrypted file's name?
Can I store the initialisation vector (IV) in the filename?
I am studying the Lamport signature scheme, and I found that in many sources (eg : https://www.cdc.informatik.tu-darmstadt.de/~dahmen/papers/hashbasedcrypto.pdf ) the input and output bitstring of the OWF and the message digest have the same size, generally 256. As the minimal requirement for the OWF is to be pre-i...
In AES-256 and RSA-1024, the numbers refer to the key size. For SHA-256, it refers to the output size. Though there is no hard, fast rule. For example, in the [SHA-3](https://en.wikipedia.org/wiki/SHA-3#Instances) family, there are hash functions with variable length output, SHAKE128 and SHAKE256. The numbers there ref...
I am studying the Lamport signature scheme, and I found that in many sources (eg : https://www.cdc.informatik.tu-darmstadt.de/~dahmen/papers/hashbasedcrypto.pdf ) the input and output bitstring of the OWF and the message digest have the same size, generally 256. As the minimal requirement for the OWF is to be pre-i...
Bitcoin's HD (Hierarchical Deterministic) Keys as described in BIP32 https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki allow for a master key to be created (a private key and a chain code) such that a tree of both public and private keys can be derived from a master key, each which can have additional keys...
HD (Hierarchical Deterministic) Keys using Safe Curves?
I am working on a multiplayer game and am looking for a way to efficiently confirm who sent the request to the server. I originally planned to use RSA, but it's too computationally expensive, and I also don't need data encrypted. [Ricky Demer](https://crypto.stackexchange.com/users/991/ricky-demer) proposed using a ...
I am assuming none of these padding algorithms are "the best"... But what are the advantages and disadvantages of using them? PKCS7 is certainly the most commonly used one, but I am interested in seeing what the others offer.
What are the relative merits of padding algorithms pkcs7, iso7816, and x923?
I am working on a multiplayer game and am looking for a way to efficiently confirm who sent the request to the server. I originally planned to use RSA, but it's too computationally expensive, and I also don't need data encrypted. What should I do/use for this purpose?
This is really a follow up question to a comment made regarding [How to roll a HWRNG][1] In the situation of whitening a hardware generated random bit stream, "XORing the two bitstreams should be fine for mixing, by the piling-up lemma" was said. The other bit stream was suggested to be one from a PRNG. In s...
Is (1 bit HW signal) XOR (8 bits PRNG output) sufficient for a HWRNG?
This is really a follow up question to a comment made regarding [How to roll a HWRNG][1] In the situation of whitening a hardware generated random bit stream, "XORing the two bitstreams should be fine for mixing, by the piling-up lemma" was said. The other bit stream was suggested to be one from a PRNG. In s...
In the case of [Ed25519](https://en.wikipedia.org/wiki/EdDSA), the number seems to be completely arbitrary. It's an implementation of the Edwards-curve Digital Signature Algorithm (EdDSA) using the [elliptic curve 25519](https://en.wikipedia.org/wiki/Curve25519). The curve is defined by some "magic" numbers: $$-x^...
From https://en.wikipedia.org/wiki/Decisional_Diffie%E2%80%93Hellman_assumption: > Importantly, the DDH assumption does not hold in the multiplicative group $\mathbb {Z} _{p}^{*}$, where $p$ is prime. This is because given $g^{a}$ and $g^{b}$, one can efficiently compute the Legendre symbol of $g^{ab}$, giving a succe...
Decisional Diffie-Hellman: compute Legendre symbol of $g^{ab}$ from $g^a$ and $g^b$?
ANSI x.923 padding and PKCS7 are functionally equivalent. The last byte of the padding stream is the length of the padding stream. The difference being the other bytes, which are all 0x00 in ANSI, and all the same as the last in PKCS7. f4 93 d6.00 00 00 00 00 00 00 00 00 00 00 00 0d ANSI X.923 f4 93 d6.0...
I am working on a multiplayer game. I have a central server which handles all data transmission and coordinates all games. Clients which involved in a single session send requests to do actions to the server, those actions are checked and the consequences are pushed to all clients. I am looking for a way for the ...
Bitcoin's HD (Hierarchical Deterministic) Keys as described in [BIP32][1] allow for a master key to be created (a private key and a chain code) such that a tree of both public and private keys can be derived from a master key, each which can have additional keys derived from it. In addition, some of hierarchy can be 'h...
Well, I know it's easy to tell CCA1 from CCA2, but I failed to find the difference between RCCA and CCA2. What is the difference?
What is the difference between RCCA and CCA2?
My clients have to exchange public keys. To ensure security they are exchanging fingerprints and typing them into the computer by hands. I want the fingerprints to be as short as possible. I am using libsodium for encryption, which uses Curve25519. What is the shortest fingerprint I can generate which would still...
For achieving stateless authentication tokens (like JWT), is there a compromise between the performance of HMAC, and public key distribution of Digital Signature? Scenario: - Sender is a centralized authentication server. - Receiver is an distributed/elastic pool of stateless web services. - The issue ...
Compromise between HMAC and Digital Signature, by encrypting and sending secret key?
**Scenario:** Assume I encrypt message $m$ using Paillier encryption, so I would get $c=E(m)$. I give the identical $c$ to two different parties, parties $D$ and $E$. * Party $D$ computes: $c_{D}= E(m)^{h_1}=E(m \cdot h_1)$ * Party $E$ computes: $c_{E}= E(m)^{h_2}=E(m \cdot h_2)$ Values $c, c_{D}$ and $c...
Why multiple homomorphic operations on a ciphertext leaks no information about the plaintext?
If the base is same and exponents are different, for example: $R_1=b^x\bmod{p}$; $R_2=b^y\bmod{p}$; $R_3=b^z\bmod{p}$; ($p$ is large prime (2048 bit); $x$, $y$ and $z$ - 160 bit integers)) To calculate $R_1$, $R_2$ and $R_3$ at the same time, then my question is: Does the calculation finish in around one ...
I have two secret values L1, L2, and two commitments C1 = C(L1), C2=C(L2). Given a challenge c, I want to output d = c*L1+L2 and prove in zero-knowledge that d is formed correctly. What should the zero-knowledge proof look like?
I have two secret values L1, L2, and two commitments C1 = C(L1), C2=C(L2). The commitments C1, C2 are public. Given a challenge c, I want to output d = c*L1+L2 and prove in zero-knowledge that d is formed correctly. What should the zero-knowledge proof look like?
Is there an encryption scheme that provides efficient homomorphic OR operations at the ciphertext space?Of course a fully homomorphic encryption can be used but i would no extra homomorphic operation
I've read in several places: - http://crypto.stackexchange.com/questions/10494/some-of-my-confusions-about-ddh-assumption - comment by Thomas Pornin on his own post - http://security.stackexchange.com/questions/42558/is-there-a-key-length-definition-for-dh-or-dhe - post by Tom Leek that somehow the largest p...
I want to manage authorization, as 3rd-party permissions, through asymmetric cryptography. I'm concerned about how it is possible to share access of encrypted data with N entities, be able to revoke any of them at anytime, and do this securely. I've thought about a cryptography function that I'm asking here some ...