instruction
stringlengths
15
30k
Advantages to knowing $p$ and $q$ in Blum Blum Shub?
Do you gain any advantage by knowing the factorization of $M$ (over just knowing $M$ itself) in the [Blum Blum Shub][1] generator? The only advantage I see is being able to calculate the $i$-th number directly, as opposed to iterating to it. This doesn't seem like a very large gain to me. [1]: http://en.wiki...
I would like to use the NaCl cryptography library (or TweetNaCl), but I would very much like to have perfect forward secrecy for my application. From what I understand, all Bob needs to to decrypt a message from Alice with NaCl's *crypto_box_open* is the public key of Alice and his private key. Thus, if an eavesdrop...
How random is the value $ZZ$ [in the DH protocol](http://www.ietf.org/rfc/rfc2631.txt)? This question was triggered by [this somewhat naïve implementation in I2P shown by Sergei at Stackoverflow](http://stackoverflow.com/q/17841662/589259). Obviously $ZZ$ is distinguishable from a random oracle, as the first byte wi...
how to use common modulus attack?
Imagine Alice wants to encrypt for Bob and post this encryption publicly, so that only Bob can decrypt but no one can other than Alice or Bob tell that the message was encrypted for Bob. The naive approach leaks some information. If Alice posts $y = x^e \bmod{n}$, then an observer can conclude that the recipient ha...
How can one encrypt with RSA (or ElGamal) without revealing whom the ciphertext is intended for?
Think about this: what does it mean that $\gcd(e_B, e_C)=1$. Formally that means there exist some $s_1, s_2$ such that $e_Bs_1 + e_Cs_2=1$. How would you use that fact with the two ciphertexts to get the message?
I'm trying to use the Berlekamp-Massey algorithm on the following bit sequence: 0 1 0 0 1 0 0 1 0 1 I have the correct answer and most of the approach to get there, but I'm unable to fill in what I don't have, in other words I don't understand how it works. I create a table, written horizontally here just for ...
I'm currently working through Katz & Lindell's *Introduction to Modern Cryptography*. In section 3.4.2, they introduce the definition of a variable output-length pseudorandom generator $G$. The definition of $G(s,1^l)$ is such that the output is of length $l$. Using such a psuedo-random generator, they define a vari...
I'm currently working through Katz & Lindell's *Introduction to Modern Cryptography*. In section 3.4.2, they introduce the definition of a variable output-length pseudorandom generator $G$. The definition of $G(s,1^l)$ is such that the output is of length $l$. Using such a psuedo-random generator, they define a vari...
I'm writing a simple encryption/decryption library which has the following requirements: 1. For key derivation functions, support: * $SHA256 \rightarrow bcrypt$ (since $bcrypt$ limits input passphrase length, hash it using SHA-256 first, then feed output of SHA-256 into bcrypt) * $PBKDF2$ 2. For key deriv...
As @DrLecter commented, the property you refer is captured by "key privacy." There are more tricky ways to achieve key privacy (against chosen-ciphertext attacks) based on the RSA encryption scheme. Let us assume $2^{k-1} < N < 2^{k}$. ### Repeating Repeating to generate a ciphertext $y$ until the result is in ...
As @DrLecter commented, the property you refer is captured by "key privacy." There are more tricky ways to achieve key privacy (against chosen-ciphertext attacks) based on the RSA encryption scheme. Let us assume $2^{k-1} < N < 2^{k}$. ### Repeating Repeating to generate a ciphertext $y$ until the result is in ...
# Background When making web applications you sometimes need to pass data along with the form which isn't visible to the user. Database IDs are the most common, but texts and IDs are sometimes necessary too. For this reason there is a `<hidden>` field in HTML, but it has a drawback - any hacker with a basic understa...
Which tamper-protection algorithm provides the shortest output?
Imagine a tagging system whose security requirements imply to learn nothing from the tag about the encoded value. We consider a plaintext space $X \in \mathbb{Z}_p$ and a group $\mathbb{G}$ where the DLP is computationally hard. The sender sends $\sf{tag_1}=g^x_i$ where $g$ is a generator of $\mathbb{G}$. This ...
When transfering data using TLS the browser and server agree the cipher suite to be used - so for example this could be chosen as AES 128 and is (probably) outside of my control. If I separately encrypt a file using AES 256 and then Alice downloads this via her browser (using AES 128) have I still effectively got AES 2...
When transfering data using TLS the browser and server agree the cipher suite to be used - so for example this could be chosen as AES-128 and is (probably) outside of my control. If I separately encrypt a file using AES-256 and then Alice downloads this via her browser (using AES 128) have I still effectively got AES-2...
Is AES-256 over AES-128 weakening the original encryption?
The main motivation for oblivious RAM (ORAM) is that, for instance, in the "cloud" setting a client outsources his data to a server in the form of encrypted blocks. Later on, he wants to perform read and write operation on these encrypted blocks, which apparently may leak information about what data is stored. ORAM now...
The main motivation for Oblivious RAM (O-RAM) is that, for instance, in the "cloud" setting a client outsources his data to a server in the form of encrypted blocks. Later on, he wants to perform read and write operation on these encrypted blocks, which apparently may leak information about what data is stored. O-RAM n...
Which concrete applications benefit from Oblivious RAM constructions?
The main motivation for Oblivious RAM (ORAM) is that, for instance, in the "cloud" setting a client outsources his data to a server in the form of encrypted blocks. Later on, he wants to perform read and write operation on these encrypted blocks, which apparently may leak information about what data is stored. ORAM now...
The main motivation for Oblivious RAM (O-RAM) is that, for instance, in the "cloud" setting a client outsources his data to a server in the form of encrypted blocks. Later on, he wants to perform read and write operation on these encrypted blocks, which apparently may leak information about what data is stored. O-RAM n...
Well, for perfect secrecy, we require that for all message distributions over $\mathcal{M}$, all messages $m\in\mathcal{M}$, and all (possible) ciphertexts $c$ it holds that $$Pr[M=m | C = c] = Pr[M=m]$$ Let's take the uniform distribution over $\mathcal{M}$. For this distribution, we have $Pr[M=c]=1/|\mathcal{M}...
Well, for perfect secrecy, we require that for all message distributions over $\mathcal{M}$, all messages $m\in\mathcal{M}$, and all (possible) ciphertexts $c$ it holds that $$Pr[M=m | C = c] = Pr[M=m]$$ Let's take the uniform distribution over $\mathcal{M}$. For this distribution, we have $Pr[M=m]=1/|\mathcal{M}...
Well, for perfect secrecy, we require that for all message distributions over $\mathcal{M}$, all messages $m\in\mathcal{M}$, and all (possible) ciphertexts $c$ it holds that $$Pr[M=m | C = c] = Pr[M=m]$$ Let's take the uniform distribution over $\mathcal{M}$. For this distribution, we have $Pr[M=c]=1/|\mathcal{M}...
I`m wondering in Shamir secret sharing can generator of the shares, keep the x values ,used in polynomial to obtain y values(shares) secret and whenever is needed he retrieves the t shares and construct the secret. In this setting the share holders should not be able to construct the secret even all of them collude? Is...
Shamir Secret sharing - Can share generator keep x values secret?
I'm wondering, in Shamir secret sharing, can generator of the shares, keep the x values,used in polynomial to obtain y values(shares), secret and whenever is needed he retrieves the t shares and construct the secret. In this setting the share holders should not be able to construct the secret even all of them collude? ...
Well, for perfect secrecy, we require that for all message distributions over $\mathcal{M}$, all messages $m\in\mathcal{M}$, and all (possible) ciphertexts $c$ it holds that $$Pr[M=m\ |\ C = c] = Pr[M=m]$$ In particular, that means, if we can find a single counterexample, i.e. a distribution over $\mathcal{M}$, a...
Sure the dealer can do that. The real question is what kind of security does it provide. I am not aware of any formal analysis on the topic. If the attacker can verify when he has found the right x values, then at **best** the security of the scheme is computational in the size of the underlying finite field. Fear n...
I'm wondering, in Shamir secret sharing, can generator of the shares, keep the x values which are used in evaluating the polynomial to obtain y values (i.e., the shares) secret, and whenever the original secret is needed, he retrieves the t shares and reconstructs the secret? In this setting the share holders should no...
Sure the dealer can do that. The real question is, what kind of security does it provide? I am not aware of any formal analysis on the topic. If the attacker can verify when he has found the right x values, then at **best** the security of the scheme is computational in the size of the underlying finite field. Fear ...
Sure the dealer can do that. The real question is, what kind of security does it provide? I am not aware of any formal analysis on the topic. If the attacker can verify when he has found the right x values, then at **best** the security of the scheme is computational in the size of the underlying finite field. If the a...
I'm wondering, in Shamir secret sharing, can generator of the shares, keep the x values which are used in evaluating the polynomial to obtain y values (i.e., the shares) secret, and whenever the original secret is needed, he retrieves the t shares and reconstructs the secret? In this setting the share holders should no...
Shamir Secret sharing - Can share generator keep x values secret?
I'm wondering, in Shamir secret sharing, can generator of the shares, keep the x values which are used in evaluating the polynomial to obtain y values (i.e., the shares) secret, and whenever the original secret is needed, he retrieves the t shares and reconstructs the secret? In this setting the share holders should no...
Shamir Secret sharing - Can share generator keep x values secret?
I'm wondering, in Shamir secret sharing, can generator of the shares, keep the x values which are used in evaluating the polynomial to obtain y values (i.e., the shares) secret, and whenever the original secret is needed, he retrieves the t shares and reconstructs the secret? In this setting the share holders should no...
Shamir Secret sharing - Can share generator keep x values secret?
Shamir Secret sharing - Can share generator keep x values secret?
The main motivation for Oblivious RAM (ORAM) is that, for instance, in the "cloud" setting a client outsources his data to a server in the form of encrypted blocks. Later on, he wants to perform read and write operation on these encrypted blocks, which apparently may leak information about what data is stored. ORAM now...
I'm wondering, in Shamir secret sharing, can generator of the shares, keep the x values which are used in evaluating the polynomial to obtain y values (i.e., the shares) secret, and whenever the original secret is needed, he retrieves the t shares and reconstructs the secret? In this setting the share holders should no...
Im working on my own AES implementation as a personal educational exercise (not for production use), and a book im using as a resource states: > In the case of CTR, we are merely XORing the output of the cipher > against the plaintext. This means there is no inherit reason why the > plaintext has to be a multiple...
Message lengths with AES CTR mode?
Well, lets try to take a concrete example: Suppose that you have a 142 bit message that you need to encrypt with CTR mode. What do you do? Well, you generate the first 128 bit block with AES; you take the first 128 bits of the message, exclusive-or the two, and that's the first 128 bits of the ciphertext. The...
What is the best way to use standard AES with a 128-bit block size to act as a 256-bit block cipher? I am aware of CMC and EME which seem to serve this purpose, but they seem to be more complicated than necessary for the 256-bit block case. (I would like to avoid relying on the uniqueness of a nonce.) Is the follo...
Im working on my own AES implementation as a personal educational exercise (not for production use), and a book im using as a resource states: > In the case of CTR, we are merely XORing the output of the cipher > against the plaintext. This means there is no inherit reason why the > plaintext has to be a multiple...
I'm supposed to show the complement property of DES ($c=DES(p,k) => \bar c = DES(\bar p, \bar k)$). My idea was to just start the algorithm with $\bar p$ and see what happens (ignoring the initial permutation for now). I looked at it step by step and got the the point where $R1 = \bar L1 \oplus f(\bar k1, \bar R0)$....
Suppose I have devices which broadcast, on an insecure channel, 32-bit addresses. I want to make these devices untraceable - one way to do so is to allocate for each device a distinct subset of address, for example $X=256$ addresses for each device with no repetitions, and make each device change its address from time...
Say I have a string that I want to keep hidden. You can then enter a known string which is added to the end of the hidden string and you are given the sha256 hash of the combined string. If you were to do this many times with whatever strings you wanted and the hidden string remained fixed, would there be a practical w...
Can you determine an unknown value when it is combined with a known value and you are given the resulting hash?
I am very new to concepts of cryptography so bare with me and feel free to fill in any information that may seem obvious but something you think someone may not know. At first i was under impression that people use checksum to determine if files are legit or not. Which didn't make sense for obvious reason..for examp...
I am very new to concepts of cryptography so bare with me and feel free to fill in any information that may seem obvious but something you think someone may not know. At first I was under impression that people use checksums to determine if files are legit or not. Which didn't make sense for obvious reasons… for exa...
How do P2P clients like uTorrent maintain authenticity of files?
I am very new to concepts of cryptography so bear with me and feel free to fill in any information that may seem obvious but something you think someone may not know. At first I was under impression that people use checksums to determine if files are legit or not. Which didn't make sense for obvious reasons… for exa...
I want to create an online roulette game. Is it OK if the PRNG is seeded only once, when the user starts the game, or is it recommended to re-seed sometimes during game? Maybe just seeded once a day on the server and every players would get a next random number without re-seeding? How would you do? How do they do it at...
Like people always say: *“Attacks only get worse…”* — which is why I'm asking early. I have been reading the paper [“RSA Key Extraction via Low-Bandwidth Acoustic Cryptanalysis”](http://www.tau.ac.il/~tromer/papers/acoustic-20131218.pdf) published December 18, 2013 by Daniel Genkin, Adi Shamir, Eran Tromer. In sh...
If you work through the reduction proof, you'll find the reduction doesn't work without that side-condition: the reduction falls apart. Where does it fail? The reduction fails: they build a reduction which shows how to use any black box to break the encryption scheme, to also break $G$. Their reduction works by ta...
If you work through the reduction proof, I suspect you'll find the reduction doesn't work without that side-condition: the reduction falls apart. Where does it fail? The goal of the reduction is to show how to use any black box to break the encryption scheme, to also break $G$. The natural reduction works by takin...
I was reading through the key derivation for RSA. Here are the steps per wiki - 1. Select strong primes p and q such that pq = n 2. phi(n) = (p-1)(q-1) 3. select e such that e and phi(n) are coprime. 4. Select d such that ed mod(phi(n)) = 1 I do not understand why the phi(n) is even needed. Why can't we just ...
Well, if $e$ is not relatively prime to $\phi(N)$, then there won't be any such $d$; in fact, there generally won't be a unique decryption. For example, let us consider the toy example $N = 77$ and $e=3$. Note, that $\phi(N) = 6 \times 10 = 60$ is not relatively prime to $e$. Then, let us assume that we receive ...
I was reading through the key derivation for RSA. Here are the steps per wiki - 1. Select strong primes p and q such that pq = n 2. phi(n) = (p-1)(q-1) 3. select e such that e and phi(n) are coprime. 4. Select d such that ed mod(phi(n)) = 1 I do not understand why the phi(n) is even needed. Why can't we just ...
I was reading through the key derivation for RSA. Here are the steps per wiki - 1. Select strong primes $p$ and $q$ such that $pq = n$ 2. $\phi(n)$ = $(p-1)(q-1)$ 3. select $e$ such that $e$ and $\phi(n)$ are coprime. 4. Select $d$ such that $ed mod(\phi(n)) = 1$ I do not understand why the $\phi(n)$ is even ...
Suppose $p=29$, $\alpha = 2 \in F_p^*$ is a generator of $F_p^*$. Bob picks $d \in \{2,...,27\}$ such that $\beta = \alpha ^d=28 \pmod{29}$. He then sends his $(p,\alpha ,\beta)$ to Alice who herself picks one $i_j \in \{2,...,27\}$ for eleven different plaintext values $m_j$, $0\leq j\leq 10$ and encrypts these by $c_...
Let us suppose Alice sends a message to Bob. As far as I know, the most popular scheme of MAC-then-encrypt is as follows: Alice computes the HMAC of the plaintext using her private key, and then encrypts plaintext+MAC by random one-time symmetric key, which is, in turn, encrypted by Bob's public key. Padding orac...
How is padding oracle attack mitigated by encrypt-then-MAC?
The biggest issue with padding oracle attacks are when the padding is not very carefully implemented (for example if using EtM you must calculate the MAC over everything - including the padding). To pre-empt references to the classic Belare-Namprempre paper, be wary - their results do not apply to modern primitives, si...
Suppose $p=29$, $\alpha = 2 \in F_p^*$ is a generator of $F_p^*$. Bob picks $d \in \{2,...,27\}$ such that $\beta = \alpha ^d=28 \pmod{29}$. He then sends his $(p,\alpha ,\beta)$ to Alice who herself picks one $i_j \in \{2,...,27\}$ for eleven different plaintext values $m_j$, $0\leq j\leq 10$ and encrypts these by $c_...
Suppose I have devices which broadcast, on an insecure channel, 32-bit addresses. I want to make these devices untraceable - one way to do so is to allocate for each device a distinct subset of address, for example $X=256$ addresses for each device with no repetitions, and make each device change its address from time...
Suppose $p=29$, $\alpha = 2 \in F_p^*$ is a generator of $F_p^*$. Bob picks $d \in \{2,...,27\}$ such that $\beta = \alpha ^d=28 \pmod{29}$. He then sends his $(p,\alpha ,\beta)$ to Alice who herself picks one $i_j \in \{2,...,27\}$ for eleven different plaintext values $m_j$, $0\leq j\leq 10$ and encrypts these by $c_...
I just saw a video, and it claims that if server isn't generating random public key then it can be hacked. **Video** http://money.cnn.com/video/technology/2014/05/21/t-hacking-encrypted-passwords.cnnmoney First how https works...so i am on the same page: - server has public key and private key. Client uses ...
I'm deriving keys from a user-supplied passphrase for symmetric encryption using AES-256 in CBC mode with a HMAC for authenticity/integrity. My key derivation function currently looks like this: ![enter image description here][1] Please note that $scrypt$ could just as easily be subbed out for PBKDF2 or bcrypt...
> Does input truncation using SHA-256 expose any potential weaknesses? No, hashing the passphrase with SHA-256 will be no stronger or weaker than feeding it in directly. If you go with Scrypt (which I would recommend you do), there are no restrictions on the size of the passphrase... and Scrypt consumes it internal...
In addition to the performance problems poncho already mentioned when using RSA signatures without hashing I just want to add on the security warning of poncho: **Reordering** If you have a message $m>N$ with $N$ being the RSA modulus, then you have to perform at least 2 RSA signatures as $m$ does not longer fit ...
- `K` is a 224-bit key. - `C` is a 32-bit counter; it is publicly known. the same value is never used twice. - `plaintext` has arbitrary length (up to 64kB). - `H` is a cryptographic hash function that returns `len(plaintext)` bits. - `^` is the bitwise XOR. - `+` is the concatenation. Encryption: `cip...
What are the major flaws and limitations of this hash-based stream cipher design?
> Are there any fundamental flaws? The construction itself is secure for a good H. It's close to what many stream ciphers use internally. E.g. chacha has an H that hashes a 256-bit key, a 64-bit nonce and a 64-bit counter to get 512 bits of output. > Would it make sense to use a longer key? Yes, if you want mo...
How to perform matching on an “encrypted- fingerprint feature matrix” using Fully Homomorphic Encryption?
I am working to understand a system which saves a few bytes of data together with what appears to be a single checksum byte that provides a very naive guarantee that the data has not been tampered with. My current task is to understand how this checksum is being calculated. I cannot currently post any specific data,...
You would have to see about the given pairs of plain text and checksum. Try to find two only marginal different plain texts with the same checksum. (Shouldn't be do difficult with only one byte (256 possibilities) per checksum. Try a few one byte long plain texts and look for correlations of the checksum. What's the ...
In the security proof of Brent Waters's peper [*Efficient Identity-Based Encryption Without Random Oracles*](http://eprint.iacr.org/2004/180.pdf), he uses a novel “artificial abort” step. What is the meaning of this step?
What is "artificial abort" technique?
How does CBC work with read-write volumes?
You would have to see about the given pairs of plain text and checksum. Try to find two only marginal different plain texts with the same checksum. (Shouldn't be do difficult with only one byte (256 possibilities) per checksum. Try a few one byte long plain texts and look for correlations of the checksum. What's the ...
- `K` is a 224-bit key. - `C` is a 32-bit counter; it is publicly known. the same value is never used twice. - `plaintext` has arbitrary length (up to 64kB). - `H` is a cryptographic hash function that returns `len(plaintext)` bits. - `^` is the bitwise XOR. - `+` is the concatenation. Encryption: `cip...
Why order "u" of an elliptic curve "E" defined over a finite field "GF (q)" (u = | E / GF (q) |) must be divisible by a large prime number r to be appropriate for cryptographic purposes?
From *[ISO/IEC 23001-7:2012/Amd 1:2012](http://www.iso.org/iso/home/store/catalogue_tc/catalogue_detail.htm?csnumber=60398) 10.2.2 Creation of Initialization Vector (Informative)* > Decryption efficiency may be improved if subsequent initialization vectors use the value of the last cipher block at the end of the pre...
> …limitations of this hash-based stream cipher design? One of the limitations of this hash-based stream cipher design would be that it does not offer any kind of *“authentication”*, nor any kind of *“integrity-protection”*. Maybe you just forgot to describe how you will be handling authentication and integrity-...
> …limitations of this hash-based stream cipher design? One of the limitations of this hash-based stream cipher design would be that it does not offer any kind of *“authentication”*, nor any kind of *“integrity-protection”*. Maybe you just forgot to describe how you will be handling authentication and integrity-...
> …limitations of this hash-based stream cipher design? One of the limitations of this hash-based stream cipher design would be that it does not offer any kind of *“authentication”*, nor any kind of *“integrity-protection”*. Maybe you just forgot to describe how you will be handling authentication and integrity-...
As a preface, forgive me for some of the links being from Wikipedia. I realize that academia frowns upon this. I came across [this article about "nothing up my sleeve numbers"](http://en.wikipedia.org/wiki/Nothing_up_my_sleeve_number). In it, it says: > In cryptography, nothing up my sleeve numbers are any numb...
Why do "nothing up my sleeve numbers" have low entropy?
I am doing a finger-print authentication process. The Feature extraction using minutiae has been done and I get an N x 6 matrix, where the 6 columns are {xi ,yi, crossing number of the ith minutiae, orientation of ith minutiae, rest 2 columns are not used for matching}. The first two are (x,y) co-ordinates of the it...
How can I perform matching on an “encrypted- fingerprint feature matrix” using Fully Homomorphic Encryption?
I'm looking to incorporate more crib usage in breaking ciphers in unknown enciphering schemes, or at least to gleam what information I may. This seems to be a big hurdle to me, and I'm looking for references on incorporating cribs into decryption schemes. Now allow me to clarify. By "crib" I mean a word or a set of ...
How would one go about generating Encryption Keys from Biometric Fingerprint Templates extracted from a fingerprint using either Griaule SDK or DigitalPersona SDK or any other SDK that will return the fingerprint template in either ISO or ANSI fingerprint templates format? Is there a way one would do that using Fuzzy E...
Does a public key cryptography method that enables the public key to be orders of magnitude smaller than the private key exist?