instruction
stringlengths
15
30k
This answer addresses Cases 1 and 2 from the question to provide a baseline, leaving Case 3 (which is the one I'm most interested in), unresolved. ## Case 1, Zero Increment In this case we'll consider a simple Lehmer-style LCG (a.k.a. an MCG), with a seed $s_1$, multiplier $a$ and $b$ bits of state and $r$ bits r...
I asked the following question on a final exam: > Symmetric Ciphers (e.g. AES, DES, Blowfish) use up to 256 bit on the > best case, which are considered strong against brute-force attacks. On > the other hand, asymmetric cryptography (e.g. RSA, DSA, Elgamal) use a > higher amount of bits (~2048). Explain the ...
I'm using the Boneh-Boyen-Shacham signature scheme and want to estimate complexity in my scheme. As reported in "Scott M., Efficient Implementation of Cryptographic pairings", if we set parameters as: MNT curve, k=6 and p~160, then P(point mul)=0.6 ms and P(pairing)=4.5 ms. These two measured times are used in ...
I saw the paper 'Rotational Cryptanalysis of ARX', it is effective against design primitives using XOR, addition, and rotation. http://www.iacr.org/archive/fse2010/61470339/61470339.pdf However about those that use modulo multiplication (e.g. Multiplication modulo $2^{16}+1$, where the all-zero word (0x0000) is ...
rotational cryptanalysis on modulo multiplication?
RSA or Paillier is good?
I would like to use a PRG in order to achieve the commitment properties (i.e. Hiding and Binding), however, if we look at a general PRG we cannot state that it has the Binding property. First I show that it could be shown that it has the Hiding property: given the PRG result on a random seed $s$, i.e. given $g=PRG(s...
I would like to use a PRG in order to achieve the commitment properties (i.e. Hiding and Binding), however, if we look at a general PRG we cannot state that it has the Binding property. First I show that it could be shown that it has the Hiding property: given the PRG result on a random seed $s$, i.e. given $g=PRG(s...
The initial idea of Fiat and Shamir was to eliminate the interaction in public coin protocols (note that public coin means that the random choices of the verifier are made public) and was used to convert three move public coin identification scheme into conceptually simple signature schemes (it has later been proven by...
I got a puzzle - I was given an image with a short line in it that represent a secrete key. the decimal gray level line is: 86 71 104 108 73 71 53 108 101 72 81 103 100 88 74 115 73 71 108 122 79 105 66 122 100 71 86 110 89 87 53 118 10 what kind of cipher...
I have a short cipher of (33) characters , which is only ascii characters. From this information. Is it possible to guess what kind of encryption was that?
Suppose we have a public key encryption scheme, in which public parameter contains (p, G, G_t, e, g), where p is prime number, G is a (cyclic) group of prime order, e:G x G --> G_t. Now my question is, what is the meaning of G which occur in the public parameter? Does it represent the group order (here p) and the ope...
Suppose we have a public key encryption scheme, in which public parameter contains $(p, G, G_t, e, g)$, where $p$ is prime number, $G$ is a (cyclic) group of prime order, $e:G \times G \mapsto G_t$. Now my question is, what is the meaning of $G$ which occur in the public parameter? Does it represent the group order (...
DrLecter's comment should really be an answer, but one point which bears emphasis is that it is not sufficient for crypto purposes to say "a (cyclic) group of prime order $p$", because even though mathematically all groups of order $p$ are essentially the same group (*i.e.*, they are isomorphic), we can't really say th...
DrLecter's comment should really be an answer, but one point which bears emphasis is that it is not sufficient for crypto purposes to say "a (cyclic) group of prime order $p$", because even though mathematically all groups of order $p$ are essentially the same group (*i.e.*, they are isomorphic), we can't really say th...
I want to calculate d from e when generating keys with RSA. What is faster? Calculating xgcd(e, p) and xgcd(e, q) and CRT. Or calculating e^(p-2) % p and e^(q-2) % q and CRT. I'm having a hard time understanding how to calculate the Complexity here.
xgcd faster than fermat for calculating d in RSA?
It's been a few years since i read anything involving crypto, i've come across this scheme and i wonder how secure it is. -Alice generates an RSA keypair (we assume Alice is using proper random numbers) -Alice sends the public key as plain text to Bob. -Bob generates a 3DES session key: BA -Bob sends BA enc...
What are the potential (major) flaws in this security scheme?
I want to calculate $d$ from $e$ when generating RSA keys. What is faster? * Calculating $\operatorname{xgcd}(e,p)$ and $\operatorname{xgcd}(e,q)$ and CRT. * **Or** calculating $e^{p-2}\bmod p$ and $e^{q-2}\bmod q$ and CRT. I'm having a hard time understanding how to calculate the complexity here.
Is xgcd faster than Fermat for calculating $d$ in RSA?
In [the original NTRU proposal from 1998](http://math.boisestate.edu/~liljanab/MATH508/ntru.pdf), it says on page 16: > It may be worth mentioning, though, that there is a simple. masking technique that can be used to significantly reduce message expansion. With this approach, Alice sends a pair of polynomials (e1, ...
> *Do the post-quantum ciphers also automag/tically address the 1st problem?* Not really, however to explore that in any detail, we need to explore what the 1st problem is. If $P=NP$ is proven true, what does that practically mean? Well, it might have absolutely no practical ramifications, or it might mean that ...
So if $M \approx 10^{20}$, and you have $4 * 10^{20}$ operations, why not just bruteforce it? For more efficient solution, consider meet-in-the-middle technique. For all $1 \le a \le 4\sqrt{M} \approx 10^{20}$, make a hash table with values $a^e \mod{N}$. Then for all $1 \le b \le 4\sqrt{M} \approx 10^{20}$ check if...
I was given a cryptography question during an interview the other day and I couldn't come up with a valid answer. Imagine you are given an efficient algorithm which for a given RSA public key (n,e) is able to decrypt 1% of the messages encrypted with that key. 1% means that the algorithm will deterministically decrypt ...
I have STRING and MD5(STRING+SALT) for any infinitely many STRING's. Is their any way that I can recover the SALT itself? (SALT is constant) I actually know SALT, but this is an intellectual exercise. Also, I know that the hash is of length 21 and consist of lowercase letters and digits. So there are 36^21 possibili...
I was given a cryptography question during an interview the other day. Imagine you are given an efficient algorithm which for a given RSA public key (n,e) is able to decrypt 1% of the messages encrypted with that key. 1% means that the algorithm will deterministically decrypt 1% of all possible ciphertexts on t...
I'm trying to get a grip on how Schnorr signature works. Suppose Alice sends Trent a tuple $(P, M)$, which contains a payload and a message to be signed by him. She then passes the certificate to Bob who verifies it. Using Wikipedia's description (http://en.wikipedia.org/wiki/Schnorr_signature), is Alice supposed to...
How does Schnorr signature actually work?
In [the original NTRU proposal from 1998](http://math.boisestate.edu/~liljanab/MATH508/ntru.pdf), it says on page 16: > It may be worth mentioning, though, that there is a simple. masking technique that can be used to significantly reduce message expansion. With this approach, Alice sends a pair of polynomials $(e_1...
I work for Security Innovation, which owns the NTRU algorithms. Glad to see this interest! You can look on this approach as two separate encryptions: one public-key encryption to transport $r_2$, and one symmetric encryption using $r_2$ as the key to encrypt $m$. This makes it look much more like standard practice i...
I see that the RSA blind signature scheme tends to be implemented more often than others, e.g., DSA blind signatures. Isn't the RSA blind signature scheme a 'lesser' scheme, if you may, compared to DSA? DSA appears to be about 6x more performant and is not prone to attacks like timing attacks. The security of RSA schem...
It’s been a few years since I read anything involving crypto. I’ve come across this scheme and I wonder how secure it is: 1. Alice generates an RSA keypair (we assume Alice is using proper random numbers). 2. Alice sends the public key as plain text to Bob. 3. Bob generates a 3DES session key: BA. 4. Bob se...
I have STRING and MD5(STRING+SALT) for any infinitely many STRING's. Is their any way that I can recover the SALT itself? (SALT is constant) I actually know SALT, but this is an intellectual exercise. Also, I know that the salt is of length 21 and consist of lowercase letters and digits. So there are 36^21 possibili...
There is a very similar question (http://crypto.stackexchange.com/questions/3143/using-a-derived-key-for-cmac) but it doesn't quite answer this one (at least for me it does not). I have a situation where I need to transfer some data. My data has variable length (but padded to 16-byte blocks, of course) and I encrypt...
Is it safe to AES-CBC and AES-CMAC both using the same key?
There is a very similar question (http://crypto.stackexchange.com/questions/3143/using-a-derived-key-for-cmac) but it doesn't quite answer this one (at least for me it does not). I have a situation where I need to transfer some data. My data has variable length (but padded to 16-byte blocks, of course) and I encrypt...
There is a very similar question (http://crypto.stackexchange.com/questions/3143/using-a-derived-key-for-cmac) but it doesn't quite answer this one (at least for me it does not). I have a situation where I need to transfer some data. My data has variable length (but padded to 16-byte blocks, of course) and I encrypt...
I'm trying to implement a (sort of) simple PRNG in hardware for fun. My idea would be to allow a user to enter a key using a keypad (or some dip switch settings that can be set and hidden) and to obtain a seed using photo, gyro and audio sensors feedback. I understand I'll probably have to implement some form of mod...
I have a base64 'cipher' text, I know that in clear text is a hidden xml document (I do not know nothing about its structure), but the base64 aplhabet was somehow shuffled. Is there any smart way, how to detect the modified alphabet better than checking all 64! permutations? I can reduce slightly the number of permutat...
First, you should not write your own CSPRNG - there are plenty of well vetted ones from which you may pick. Second, your text and your pseudo code do not match (rotate key or rotate the seed). Third, as I understand this algorithm it doesn't even give good randomness properties. For example: Main> let see...
I'm trying to implement a (sort of) simple PRNG in hardware for fun. My idea would be to allow a user to enter a key using a keypad (or some dip switch settings that can be set and hidden) and to obtain a seed using photo, gyro and audio sensors feedback. I understand I'll probably have to implement some form of mod...
A [well-formed](http://www.w3.org/TR/2008/REC-xml-20081126/#sec-documents) XML document is subject to all sorts of constraints. You can incorporate these constraints into a function that checks a base64 substitution key by looking for invalid syntax, such as improperly nested tags, or a tag name containing control c...
There is a very similar question (http://crypto.stackexchange.com/questions/3143/using-a-derived-key-for-cmac) but it doesn't quite answer this one (at least for me it does not). I have a situation where I need to transfer some data. My data has variable length (but padded to 16-byte blocks, of course) and I encrypt...
There is a very similar question (http://crypto.stackexchange.com/questions/3143/using-a-derived-key-for-cmac) but it doesn't quite answer this one (at least for me it does not). I have a situation where I need to transfer some data. My data has variable length (but padded to 16-byte blocks, of course) and I encrypt...
So I'm reading over the Yaksha Security System and see it is based on the RSA cryptosystem and a centralized server, easy enough. What I'm slightly confused on is the math behind the related keys. It states nAlice - Alice(some user) modulus dAliceA - First private key only known to Alice dAliceY...
(Being new to cryptography, I hope the following makes sense). I will try to follow the Wikipedia article. What I write is pretty much just taken from there. If some of the steps are unclear you might want to look up for example the Chinese Reminder theorem or simply check out a book on basic modular arithmetic. ...
So I'm reading over the Yaksha Security System and see it is based on the RSA cryptosystem and a centralized server, easy enough. What I'm slightly confused on is the math behind the related keys. It states > nAlice - Alice(some user) modulus dAliceA - First private key only known to Alice dAlic...
Assume out of a set of ElGamal signatures, I've discovered that two have the same y i.e. $signature_{1}$ on $m_{1}$ = $(y,s_{1})$ and $signature_{2}$ on $m_{2}$ = $(y,s_{2})$. The public keys for $signature_{1}$ and $signature_{2}$ and messages $m_{1}$ and $m_{2}$ are available. How can I recover the secret keys...
**What would be the best Cryptography method without the use of a computer?** > This could be a list of the current options available, that could be used without > the use of a computer system. - E.g. types of cipher's - Different types of algorithm. - The range in security, low to high etc.
What would be the best Cryptography method without the use of a computer?
> Can Alice obtain the session key due to the multiplicative properties of the modulus function and the basis of which RSA is built on? Essentially, yes. One way of looking why RSA works (that is, why the encryption and decryption are inverses of each other) is because of two mathematical identities: $$(M^a \bmo...
For confidentiality purposes? - one time pad (when possible) - rc4 (because you can by hand)
El Gamal is a malleable homomorphic encryption system, so is Rabin. Are all homomorphic encryption systems malleable? Or are there any that are not malleable? Thanks!
Let's say that I have an ordinary hard drive encrypted with VeraCrypt 1.0e full disk encryption and implementing: -AES -RIPEMD-160 Hash Algorithm Now let's say that for an arbitrary machine, the amount time that it takes to make 1 guess at the master encryption key itself is equal to 1 unit of time. (I underst...
At what point does passphrase strength match the strength of the cipher?
I want to modify and customize AES encryption algorithm and develop a variant of it. What factors should I consider so that it does not become weaker? What skill sets would be required to undertake this task? How complicated can it get?
How to customize a standard encryption algorithm?
The comments on the question are very good. That said, I'll try to address the question(s). >What factors should I consider so that it does not become weaker? This is a very important concern that I am glad you have. One of the big strengths that standard ciphers have is that lots of really smart people have look...
Very often in the description and analysis of a cryptographic protocol there is a need for a an element $k$ that is sampled > uniformly AND at random. Is there a redundancy in the definition with uniformity and randomness? If no what is the rigorous difference of uniform and random? Does it mean that the num...
What is the difference between uniformly and at random in crypto definitions?
The kernel attack on MinRank is described [here (page 5)](http://www-polsys.lip6.fr/~jcf/Papers/crypto08.pdf). My question refers to this line: > Note that if $m = \left\lceil \frac k n \right\rceil$, the system essentially has only one solution $\lambda = (\lambda_1, \ldots, \lambda_k)$. Why is this so? I unders...
"Kernel attack" on MinRank -- why do we guess $\left\lceil \frac k n \right\rceil$ vectors?
I understand the differential cryptanalysis up to the "finding the last subkey" part. If XORing with the key doesn't change the differentials, how can testing different key affect the equations we found?
How do we find the subkey out of a differential cryptanalysis?
I understand the differential cryptanalysis up to the "finding the last subkey" part. If XORing with the key doesn't change the differentials, how can testing different key affect the equations we found? EDIT: I think I kinda get the answer now. Although I'd like a confirmation: After getting all those probabilit...
Is it possible to have a pseudorandom generator that extends its output by 1 bit by simply appending the exclusive-or of all the previous bits? I know the output of a pseudorandom generator is indistinguishable from random, so would the appended bit still retain its pseudorandom property? Or is this not pseudorandom...
If you define pseudorandom as (computationally) indistinguishable from random, then your proposal breaks the pseudorandom property. Here is why, given all the previous bits, can you predict (with significantly better than 0.5 probability) what the next bit will be? The answer is yes, you can predict it 100% of the time...
I read that the following adaptation of the CFB block cipher mode into an authenticated mode is prone to chosen plaintext attacks, yet Im still unsure how to prove it: Let $P_1,P_2,\ldots P_n$ be the plaintext blocks, $C_1,C_2,\ldots C_n$ the CFB encrypted ciphertext blocks and consider the authentication tag is co...
Why is authenticated CFB mode insecure?
If I had two ciphertexts $c_1 = m_1 ⊕ y_1$ and $c_2 = m_2 ⊕ y_2$ will it be possible to obtain $z_1= (m_1+m_2) ⊕ y_1 ⊕y_2$ and $z2= (m_1.m_2)⊕y_1⊕y_2$ from $c_1$ and $c_2$ without revealing $m_1$, $m_2$, $y_1$ and $y_3$? (`+` stands for OR, `.` for AND and `⊕` for XOR)
I know of [Salsa20][1] which won the ESTREAM competition. This is dated of 25 Dec 2007. There is also the ChaCha20 stream cipher (cr.yp.to/chacha.html). This claims to increase the amount of diffusion per round. This is dated 28 Jan 2008. Then there is another variant called [XSalsa20][2] which has a 192 bit non...
XSalsa20 uses the same cryptographic core as Salsa20 and comes with a security proof that it's secure if Salsa20 is secure. It doesn't use the core of ChaCha and thus has worse diffusion. The way XSalsa20 works is that it hashes its 256 bit key and the first 128 bits of the nonce using HSalsa down to a 256 bit key a...
**What would be the best Cryptography method without the use of a computer?** > This could be a list of the current options available, that could be used without > the use of a computer system/electronic device. Moreover, would like to identify what types of Cryptography techniques could be used to encrypt a small ...
**What would be the best Cryptography method without the use of a computer?** > This could be a list of the current options available, that could be used without > the use of a computer system/electronic device. Moreover, would like to identify what types of Cryptography techniques could be used to encrypt a small ...
What would be the best plain text Cryptography method without the use of a computer?
Is it correct to say that RSA operates over a Finite Field (Galois Field)? In this case GF(p)? I do understant that the modulo in RSA is not itself a prime number, but all the operations (multiplication, inversion) occur as if it is a GF(p).
Does RSA operate over a Finite Field (Galois Field)?
Suppose Alice and Bob each have bits `a` and `b`, respectively. How can Alice and Bob compute the function `a and b`, without revealing their bits to each other?
I don't think it were a good hash, although I think it is reparable. 1. The first thing which we can find on the spot, as @BobBrown said: hash functions create a fixed-length result from a variable-length input. Your function does exactly the opposite. A possible fix: you segment the output and simply XOR the ...
Plaintext(binary) : 10101100 //very short for easy understanding Suppose we have 4 predefined schemes/functions, 1. rotate (101 -> 011) 2. flip (1101 -> 1011) 3. exchange (11011 -> 10111) 4. stretch (1100 -> 11001100) We create a function that checks for '0' or '1' in each position of plaintext(binary) ...
Why are primes so important? Why can't we just use a random number? My guess is that it's because finding a random prime require more computing power, than finding a random number. Can anybody confirm this?
If I had two ciphertexts $$c_1 = m_1 \oplus y_1 \text{ and } c_2 = m_2 \oplus y_2$$ will it be possible to obtain $$z_1= (m_1 \lor m_2) \oplus y_1 \oplus y_2 \text{ and } z_2= (m_1 \land m_2) \oplus y_1 \oplus y_2$$ from $c_1$ and $c_2$ without revealing $m_1$, $m_2$, $y_1$ and $y_3$?
Is there any literature about the design of the **[P_BOX][1]** of DES ? I found a [paper][2] On this topic , but it dates back to 89 . Which means the effect of p-box values of the cipher immunity against Differential Cryptanalysis and linear cryptanalyisis is not mentioned since they were Publicly discovered duri...
I'm curious about the design of the **[P_BOX][1]** of DES. I found a [paper][2] on this topic, but it dates back to 1989. This means the effect of p-box values of the cipher immunity against Differential Cryptanalysis and linear cryptanalyisis is not mentioned since they were Publicly discovered during the 90's (Acco...
XORing with a key indeed does not change the difference. But usually before the XORing there is nonlinear layer (Sboxes?) which changes the difference. For example $(N rounds...)(Sbox)(AddKey)$. You can use a differential up to the beginning of this layer. Then, for different subkeys you will get same sbox *output* dif...
In Davies–Meyer hash construction scheme each block is xor'ed with the previous block cipher text. Why? The only obvious flaw I see in a scheme without this xor is the possibility to reconstruct a hash for a head of a message if the tail is known. Is it the only flaw or it also prevents other attacks?
I've heard in some lecture that the weak [keys in DES][1] implies the existence of $2^{32}$ fixed points in the algorithm, i.e. that $DES_k(x)=x$ for $2^{32}$ such $x$'s. I couldn't find anything about that issue, can you give some reference or explain it here? [1]: https://en.wikipedia.org/wiki/Weak_key#Wea...
https://tools.ietf.org/html/rfc6229 has stuff like this: Key length: 40 bits. key: 0x0102030405 DEC 0 HEX 0: b2 39 63 05 f0 3d c0 27 cc c3 52 4a 0a 11 18 a8 DEC 16 HEX 10: 69 82 94 4f 18 fc 82 d5 89 c4 03 a4 7a 0d 09 19 DEC 240 HEX f0: 28 cb 11 32 c9 6c e2 8...
what are the plaintext's for the RC4 stream cipher test vectors in RFC6229?
And also don't require commitments or zkp? Dsa or shorr signature need a nonce which can leak valuable information. There are derandomization schemes but the verifier can't check that the signer used them without extra steps. I was wondering if there was a signature that avoids these problems. Thanks
I want to add the homomorphic property to Elgamal in [libgcrypt](http://www.gnu.org/software/libgcrypt/). This is the core code I added to the library. static void do_homo_mul (gcry_mpi_t a, gcry_mpi_t b, gcry_mpi_t data1_a, gcry_mpi_t data1_b, gcry_mpi_t data2_a, gcry_mpi_t data2_b, ELG_public_key *pke...
How to implement homomorphic multiplication for Elgamal?
According to [this answer](http://stackoverflow.com/a/5884209/380772), RSA with the "usual" "padding scheme, described in [PKCS#1](http://www.rsa.com/rsalabs/node.asp?id=2125) as the <br> 'old-style, v1.5' padding," can be made to satisfy that; one would just need to specify NULL or omission.
According to [this answer](http://stackoverflow.com/a/5884209/380772), RSA with the "usual" "padding scheme, described in [PKCS#1](http://www.rsa.com/rsalabs/node.asp?id=2125) as the <br> 'old-style, v1.5' padding," can be made to satisfy that; one would need to specify NULL or omission <br> and require that the pu...
Are there signatures that don't have subliminal channels and also don't require commitments or zero-knowledge proofs? DSA or Shorr signatures need a nonce which can leak valuable information. There are derandomization schemes but the verifier can't check that the signer used them without extra steps. I was wonder...
Are there signatures that don't have subliminal channels?
<?php $key = pack('H*', '0123456789ABCDEF' . '23456789ABCDEF01' . '456789ABCDEF0123'); $result = openssl_encrypt('The quick brown fox jump', 'des-ede3', $key, OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING); echo chunk_split(bin2hex($result), 16, ' '); That gives `1ccf23869d09333e cce21c81122...
ElGamal encryption algorithm is as follows: To encrypt a value $m$, it chooses a random value $r$, and calculates $c_1=g^r$ $mod$ $q$ $c_2=m*h^r$ $mod$ $q$ where $g$ is the group generator, $x$ is the private key and $h=g^x$ is the public key. But if $m$ is 0, then $c_2$ will always be 0. How to deal wit...
How to use ElGamal to encrypt zero?