instruction
stringlengths
15
30k
I'm trying to understand the comment in the page 103 of the book [Postquantum Cryptography][1]. about convert the identification Stern procedure for signing. Can you write an example of signature of this conversion? > The standard method to convert the identification procedure into a procedure for signing, is to re...
I've thought about the following (generic) key-agreement protocol.<br> The only weaknesses I could have found are missing freshness guaranteees. As for the notions:<br> $E^1_K(P)$ is the symmetric encryption of plaintext $P$ using key $K$. This is AES-GCM for example.<br> $E^2_A(P)$ can either denote symmetric en...
Is this hypothetical key-exchange secure?
I've thought about the following (generic) key-agreement protocol.<br> The only weaknesses I could have found are missing freshness guaranteees. As for the notions:<br> $E^1_K(P)$ is the symmetric encryption of plaintext $P$ using key $K$. This is AES-GCM for example.<br> $E^2_A(P)$ can either denote symmetric en...
I am wondering about the setup for testing if a function family is pseudorandom. We step into a room, and query the black box with $x$, which yields $f(x)$, etc... We don't know if $f$ is a random function, or if it comes from some preset function family $F$. In the latter case, what assumptions are made about the func...
Pseudorandom functions: how are functions stored?
Is there any security advantage to using a pre-determined IV in CBC mode over a null IV? I'm implementing a license key system similar to [this article on CodeProject](http://www.codeproject.com/Articles/16465/Product-Keys-Based-on-the-Advanced-Encryption-Stan), but I'm confused by the authors use of a pre-determined I...
I'm reading about the lattice recently.In the paper, it gives a method of a vector mod a matrix: ⃗c mod B as ⃗c−⌊⃗c×B^(−1)⌉×B = [⃗c×B^(−1)]×B. I know that a integer A mod the other integer B is A+-kB, to make A in the defined field B. Can anyone tell me what is the meaning of a vector mod a matrix and the m...
What is the meaning for a vector mod a matrix in a lattice?
In presence of malicious adversaries in ideal protocol of Multi Party Computation, how can honest parties get the correct output? i.e., corrupted parties modify their inputs and give to the trusted party. Trusted Party computes the function by taking honest party inputs and modified inputs of corrupted parties which ...
I've seen a few implementations of [Paillier cryptosystem][1] that uses [probable primes][2] to choose $p$ and $q$. Assuming that a keypair is generated with $p$ and $q$ that are coprime and that $pq$ is coprime with $(p - 1)(q - 1)$, but either $p$ or $q$ is composite, I'm wondering what security issues afflict su...
What if the p and q used in keys generation of Pailler criptosystem are composite?
I am currently trying to understand this Ring-LWE article: http://www.cims.nyu.edu/~regev/papers/ideal-lwe.pdf and I have a question. Firstly, it is mentioned in the paper that we can view the elliptical Gaussian distributions $D_{\textbf{r}}$ (which are initially defined on $H$) as distributions on $K_{\mathbb{R}} ...
Frequently I have seen people use the term order in cryptography (the group theoretic one). I have a mathematical background and order (say for prime modulus $p$) is defined as the smallest integer such that $$a^r \equiv 1 \ (mod p)$$ So a generator (something which has the max possible order i.e order is $\phi(...
After studying at length about weaknesses in SHA2, length extension attacks, forged signatures, etc. I have to ask why groups like Gnu provide hashes on their program texts? As long as the public knows how the hashes were generated, a forger could substitute his own malicious code and cook up a totally valid hash fo...
What good is a hash accompanying a program?
I am using EAX AEAD with an 8-byte message header which carries a 32-bit sequence number, a message length, and some other bits that I don't mind exposing. Assuming the sequence number never repeats for the same key, is there any security difference between treating that as a 4-byte nonce with 4 bytes of "associated d...
Frequently I have seen people use the term order in cryptography (the group theoretic one). I have a mathematical background and order (say for prime modulus $p$) is defined as the smallest integer such that $$a^r \equiv 1 \pmod p$$ So a generator (something which has the max possible order i.e order is $\phi(p)...
Well, if you can assume that the website hasn't been hacked, then providing a SHA2 hash of a program would allow you do make sure you downloaded (from anywhere on the internet) a good version of the software. You are right, however, that since the method is publicly known, if someone can replace the binary on the si...
I've recently read the claim that finding collisions on block cipher may be not a difficult task, if an attacker can control the key and the message. **So, given a function $f:\{0,1\}^m \times \{0,1\}^{l_0} \times ... \times \{0,1\}^{l_k}\rightarrow \{0,1\}^n$, what is the expected run-time for finding a collision?*...
What is the run-time on finding collisions with MACs, block ciphers ,...?
I've thought about the following (generic) key-agreement protocol.<br> The only weaknesses I could have found are missing freshness guaranteees. As for the notions:<br> $E^1_K(P)$ is the symmetric encryption of plaintext $P$ using key $K$. This is AES-GCM for example.<br> $E^2_A(P)$ can either denote symmetric en...
> As long as the public knows how the hashes were generated, a forger could substitute his own malicious code and cook up a totally valid hash for it, so that it would look legitimate. So it appears that this [...] has really no way of assuring anything meaningful. You are right that a human attacker able to modify ...
I have a question regarding the derivation of keys in crypto. Is it a good practice to use the plain text (in form of hashes) for derivation of keys ? these keys will be used for encryption of the same plain text later on. What are possible drawbacks of the same if any ? Thank You in advance.
Is it a good practice to use plain text for derivation of Keys ?
I have a question regarding the derivation of keys in crypto. Is it a good practice to use the plain text (in form of hashes) for derivation of keys ? these keys will be used for encryption of the same plain text later on. What are possible drawbacks of the same if any ? Thank You in advance. **Edit 1**: For...
Is it a good practice to use plain text for derivation of Keys?
I have a question regarding the derivation of keys in crypto. Is it a good practice to use the plain text (in form of hashes) for derivation of keys ? these keys will be used for encryption of the same plain text later on. What are possible drawbacks of the same if any ? Thank You in advance. **Edit 1**: For...
I have a locked-down production system that we'd like to process specific requests, picked-up (poll) from a less-secure location. For security and "go slow, this is production" reasons, a request must be authorized by 2 (or N) people on the team. I can imagine how to implement this fairly simply just using openssl ...
I have a question regarding the derivation of keys in crypto. Is it a good practice to use the plain text (in form of hashes) for derivation of keys ? these keys will be used for encryption of the same plain text later on. What are possible drawbacks of the same if any ? Thank You in advance. **Edit 1**: For...
The traditional MPC definition of correctness has no notion of correctness on the inputs. The traditional MPC correctness property deals with the output, i.e., the protocol is correct if $y$ where $y=f(x_1,x_2,\dots,x_n)$ is guaranteed to be output. What the $x_1,\dots,x_n$ values are is completely up to the inputting ...
I have a few questions regarding universal hash functions. 1)Is there a way universal hash functions can be used to provide unconditional authentication in the way the OTP provides unconditional security? 2)Assuming a TRNG is used how could this be combined to form a perfect cryptosystem, assuming PSK's are secured...
I have a few questions regarding [tag:universal-hash] functions: 1. Is there a way universal hash functions can be used to provide unconditional authentication in the way the OTP provides unconditional security? 2. Assuming a TRNG is used how could this be combined to form a perfect cryptosystem, assuming PSK's a...
Assuming that AES CCM is used with respect of the NONCE unicity // the key life cycle, I wonder about the need of using the highest size for CBC-MAC authentication tag if CTR mode encrypts both payload AND authentication tag : If no encryption is performed (e.g AES CBC MAC only), I understand the need of highest ta...
I have a few questions regarding [tag:universal-hash] functions: 1. Is there a way universal hash functions can be used to provide unconditional authentication in the way the OTP provides unconditional security? 2. Assuming a TRNG is used how could this be combined to form a perfect cryptosystem, assuming PSK's a...
I have made some reverse engineering on proprietary software and came up with some DHE algorithm that works like this: First and foremost, the client and the server shares some public parameters (g, p) where p is a prime number : # the client generates some random number X # Then... A = g^X % p ...
I've recently read the claim that finding collisions on block cipher may be not a difficult task, if an attacker can control the key and the message. **So, given a pseudo-random function $f:\{0,1\}^m \times \{0,1\}^{l_0} \times ... \times \{0,1\}^{l_k}\rightarrow \{0,1\}^n$, what is the expected run-time for finding...
What is the run-time on finding collisions with MACs,...?
I am new to Network Security and learning about various security features like Diffie-Helmann and others. I understand that the Public key send by the server to the client needs to certified that it is authentic. So a Certificate Authority (CA) needs to sign the public key. But I would like to know how is this public...
According to the paper "Faster addition and doubling on elliptic curves" by Bernstein and Lange, the Montgomery curve (Curve25519) $$v^{2}=u^{3}+486662\cdot u^{2}+u$$ is birationally equivalent to the Edwards curve (Ed25519) $$x^{2}+y^{2}=1+(121665/121666)\cdot x^{2}y^{2}.$$The paper says that the transformation is ea...
How to derive the curve Ed25519 from Curve25519?
According to the paper "Faster addition and doubling on elliptic curves" by Bernstein and Lange, the Montgomery curve (Curve25519) $$v^{2}=u^{3}+486662\cdot u^{2}+u$$ is birationally equivalent to the Edwards curve (Ed25519) $$x^{2}+y^{2}=1+(121665/121666)\cdot x^{2}y^{2}.$$The paper says that the transformation is ea...
According to the paper "Faster addition and doubling on elliptic curves" by Bernstein and Lange, the Montgomery curve (Curve25519) $$v^{2}=u^{3}+486662\cdot u^{2}+u$$ is birationally equivalent to the Edwards curve (Ed25519) $$x^{2}+y^{2}=1+(121665/121666)\cdot x^{2}y^{2}.$$The paper says that the transformation is ea...
According to the paper "Faster addition and doubling on elliptic curves" by Bernstein and Lange, the Montgomery curve (Curve25519) $$v^{2}=u^{3}+486662\cdot u^{2}+u$$ is birationally equivalent to the Edwards curve (Ed25519) $$x^{2}+y^{2}=1+(121665/121666)\cdot x^{2}y^{2}.$$The paper says that the transformation is ea...
I'm trying to understand the sentence in bold, in the follow paragraph of [A new one-time signature scheme from syndrome decoding][1] > Keygen: Given a security parameter $\lambda$, choose a suitable integers $k, n, r, u, w$ such that the actual difficulty of the SDP$(n,r,u)$ meets the level $2^{\lambda}$, with $u\l...
I recentely used a custom construction as a commitment scheme, which was taken from the standard picture you give people while explaining commitment schemes. Basically commitment schemes can be described in terms of physical objects, as "put the information to commit to in a lockable box, give the other person the b...
Is authenticated encryption basically a lockable box?
According to the paper "Faster addition and doubling on elliptic curves" by Bernstein and Lange, the Montgomery curve (Curve25519) $$v^{2}=u^{3}+486662\cdot u^{2}+u$$ is birationally equivalent to the Edwards curve (Ed25519) $$x^{2}+y^{2}=1+(121665/121666)\cdot x^{2}y^{2}.$$The paper says that the transformation is ea...
What is the value of $p$? What is the value of $g$? If $g = 2$, when he receives $4^X$, he could compute the square root of it so that he has $2^X$ which is your $A$.
First off, your equation is correct and there seems to be no calculation mistake. To understand on how to get from $$(2+d)x^{2}+dy^{2}=d+(d-2)x^{2}y^{2}$$ to $$x^{2}+y^{2}=1+e\cdot x^{2}y^{2}$$ one first needs to observe that $e=(d-2)/(d+2)=121665/121666$ holds. The next step is to consider: "What operat...
Scenario: Alice wants to verify a signature from Bob. Alice knows Bob's RSA public key (e, n). However, Alice is getting the data, the signature of the data and the public key from an attacker Eve. Assume the signature is compliant with PKCS# v1.5. Now I know trivially Eve can generate an RSA key pair and signs the ...
How many bits to flip in an RSA public key to do signature forgery?
I recently used a custom construction as a commitment scheme, which was taken from the standard picture you give people while explaining commitment schemes. Basically commitment schemes can be described in terms of physical objects, as "put the information to commit to in a lockable box, give the other person the bo...
ECDSA signatures depend on parameter *k* that is chosen by the signer. As a result, there are many signatures for the same private key *d* and message *m*. What I want to achieve is a deterministic signature. That is, given private key *d* and message *m*, there should be only one valid signature. I could go with RS...
Deterministic ECDSA signatures?
1. $\;\;\;$ Sure. $\:$ The simplest way is to compose an <br> $\;\;\;$ almost [strongly universal$_{m+1}$ hash family](https://en.wikipedia.org/wiki/K-independent_hashing#Mathematical_Definitions) with an amlost-universal hash family. 2. $\;\;\;$ That could be used for [encrypt-then-MAC](http://crypto.stackexcha...
For example showing that it is easy to produce ciphertext from plaintext but is difficult/impossible to get plain text from ciphertext. I am asking in general but am more interested in asymmetric crypto. Would these things be different from what I need to prove to show it is a good digital signature?
What needs to be proved for a cryptosystem to be secure?
1. $\;\;\;$ Sure. $\:$ The simplest way is to OTP-encrypt the <br> $\;\;\;$ output of an almost [xor-universal hash family](https://en.wikipedia.org/wiki/K-independent_hashing#Mathematical_Definitions). 2. $\;\;\;$ That could be used for [encrypt-then-MAC](http://crypto.stackexchange.com/q/24353/991), where <br...
I've read about the weak key issue with Blowfish, but can't seem to find anything that explains the practical effect of weak keys on Blowfish with the full 16 rounds. Is there any actual attack upon non-reduced-round Blowfish, in the event that a weak key is chosen?
The basic STS protocol contains encryption of the signature as shown in Wikipedia. https://en.wikipedia.org/wiki/Station-to-Station_protocol If we would like to defend against MITM attack, this protocol will work even without the symmetric key encryption. Why is the symmetric key encryption necessary?
Why is encryption necessary in STS protocol?
The basic STS protocol contains encryption of the signature as shown in Wikipedia. https://en.wikipedia.org/wiki/Station-to-Station_protocol If we would like to defend against MITM attack, this protocol will work even without the symmetric key encryption. A related question is asked here http://crypto.stackexchan...
Why does encryption in STS protocol protect against identity attacks?
It always depends on what you mean by *secure*, but note that, as SAI Peregrinus said in the other answer, not every cryptosystem is provably secure. > For example showing that it is easy to produce ciphertext from > plaintext but is difficult/impossible to get plain text from > ciphertext. The property you des...
.i'm new to this Area. Que. how do i implement asymmetric key algorithm into wireless medium using ns 2.35 ? e.g. node A is a sender and B is a receiver now A is sending a pkt using Bs public key(encryption) and B is decrypt that pkt using its private key . now the question is that how to produce key into that w...
If Eve can find an $n'$ that is prime (and $n'-1$ is relatively prime to $e$),then she can easily sign any message with that $n', e$ pair. So, the question is: what is the probability that there exists a prime $n'$ such that there is only one bit difference between $n$ and $n'$, and $n' \not\equiv 1 \pmod {e}$ ? Th...
I am researching on collision probability of MD5 on various attacks against it. Can someone help me with finding what is the least probability in specific attack on MD5 ? For Example, MD has probability of collision 1 / 2^64 under birthday paradox but does this apply to any input given to MD5 ? Also MD5 ou...
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, MD has probability of collision 1 / 2^64 under birthday paradox but does this apply to any input g...
> MD 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 any...
I recently was "directed" to [FlipsCloud][1], a company selling security solutions (as far as I can tell). In particular I've investigated their page and found [a page][2] on their "encryption features". This page claims a few things (some of which deserve their own questions). As for this question, I'm asking...
Why does "2xAES-256" provide "99.99%" security strength whereas "1xAES-128" provides "40%"?
Given an encrypted file, the original unencrypted (cleartext) file, and knowledge of which AES encryption algorithm was used, is it possible to determine the key that was used to encrypt the data in a reasonable period of time? I am not looking for details on how AES works, just a simple answer.
I'm just a bit confused about the nonce/IV in AES-CTR ... it seems the suggested way to go is have a 64bit random nonce, and use the last 64bits as the counter, "starting at 0". I'm just wondering why not PRNG initialize all 128bits? Still using a 'static' 64bit nonce and still with the least significant 64bits as ...
64bit nonce in AES-CTR, why not 128?
I'm just a bit confused about the nonce/IV in AES-CTR ... it seems the suggested way to go is have a 64bit random nonce, and use the last 64bits as the counter, "starting at 0". I'm just wondering why not PRNG initialize all 128bits? Still using a 'static' 64bit nonce and still with the least significant 64bits as ...
I am using ElGamal and Paillier schemes to encrypt a large number of short messages: typical 4-byte integers. I do this for the homomorphic properties of these schemes. However, the way the encryptions work, with, say, a 1024-bit key a 4-byte integer will blow up into two values of overall size of 4096 bits or 512 b...
The `dieharder` tests give a clear `PASSED`, `WEAK`, etc and I'm wondering what those thresholds might be for the `ent` tests. While I'm sure a subjective and holistic reading of results is also helpful (especially for someone who knows a lot about RNGs and their tests), are there values that could be considered passin...
What values constitute passing for ENT tests?
I've been told that prime-number factoring is based on a "roman-doll" sequence of matrixes, where a seed matrix of height Y and width X exists consisting of all zeros except for a single 1 at row Y column X. For exery x columns added, the matrix grows by y, and two closely related formulas sum the column vectors and t...
Has anyone heard of matrix-based "Roman Doll" encryption techniques?
I have made some reverse engineering on proprietary software and came up with some DHE algorithm that works like this: First and foremost, the client and the server shares some public parameters (g, p) where p is a prime number : # the client generates some random number X # Then... A = g^X % p ...
I haven't checked, is $p$ a safe prime and/or is 4 a generator over $p$? Server has random secret $S$, known $p$ and $g$ a generator. I'm substituting in $V$ for your $g$, with $g = 4$. $V = g^S \mod p$ $V$ is a verifier of the server, as in SRP. $V$ is your $g$, so known by the client. Anyone knowing $V$...
We are all aware of [Google's approach to introduce ChaCha/Poly1305 as TLS cipher suite][1]. The rationale seems clear: ChaCha is newer and seems to provide better security (and maybe speed?) gained from the experiences of the design of Salsa20. But in his "recent" paper about [McBits][2] (basically code-based ECIES...
Why should one prefer Salsa20 over ChaCha?
Consider the following scenario: Sender S sends a message to receiver R. He uses a hybrid encryption scheme with RSA as key-encapsulation algorithm and AES-256-CTR (4byte-counter) and SHA256-HMAC. These algorithms are specified and already known by the receiver → the receiver knows the encrypted key length: `32byte...
Why don't use random padding in RSA?
The `dieharder` tests give a clear `PASSED`, `WEAK`, etc and I'm wondering what those thresholds might be for the `ent` tests. While I'm sure a subjective and holistic reading of results is also helpful (especially for someone who knows a lot about RNGs and their tests), are there values that could be considered passin...
What values constitute failing for ENT tests?
Answered (I think pretty well) by this [Reddit thread](https://www.reddit.com/r/crypto/comments/3drlgl/what_values_constitute_passing_for_ent_tests/): All tests of RNGs are based on a "null hypothesis", meaning if they fail, they prove the RNG is flawed. If they pass, it does not mean it is good. Therefore, the ques...
Answered (I think pretty well) by this [Reddit thread](https://www.reddit.com/r/crypto/comments/3drlgl/what_values_constitute_passing_for_ent_tests/): All tests of RNGs are based on a "null hypothesis", meaning if they fail, they prove the RNG is flawed. If they pass, it does not mean it is good. Therefore, the ques...
This is a question I had in my exam today, and I'll be glad if someone can help me to find the answer. A student built an encryption algorithm (something between DES and 3DES), in which the encryption is based on 2 keys, K1 and K2, and calculated this way: Cipher = E_K1 (E_K2 (plaintext) where E_Ki is encryp...
As we know, breaking a Transposition Cipher is quite trivial and can be easily done by either exploiting single letter frequencies (not d-grams frequencies though, given that 2 < d < L), or by employing a simple CPA, thus deriving the snippets lenght L and the transposition matrix (key). If we imagine to encrypt the...
I want to implement a secure chat via mobile. I´ld like to know if the following protocol for key agreement – which can use any asymmetric encryption – exists. Suppose Alice and Bob are two clients of the app. For this they have to register their public keys in a server: 1. Alice generates her public and private ...
Does this chat protocol exist?
> For this they have to register their public keys in a server: > 1. Alice generates her public and private keys (pub_A, priv_A). 2. Alice sends pub_A to a public server. 3. Bob generates his public and private keys (pub_B, priv_B). 4. Bob sends pub_B to a public server. So, you are basicly exchange public k...
> For this they have to register their public keys in a server: > 1. Alice generates her public and private keys (pub_A, priv_A). 2. Alice sends pub_A to a public server. 3. Bob generates his public and private keys (pub_B, priv_B). 4. Bob sends pub_B to a public server. So, you are basicly exchange public k...
Suppose Bob has a DSA key pair, and Alice has Bob's public key. Is there any secure way that Alice can send Bob a message only he can read if Bob can not send any reply? I think the answer is no, since DSA is only for messaging signing, so can only be used for things like authentication and Diffie-Hellman key exchan...
Can Alice send Bob a secure message with only DSA and no key exchange?
This is a question I had in my exam today, and I'll be glad if someone can help me to find the answer. A student built an encryption algorithm (something between DES and 3DES), in which the encryption is based on 2 keys, $K_1$ and $K_2$, and calculated this way: $$Cipher = E_{K_1} (E_{K_2} (plaintext))$$ where...