instruction
stringlengths
15
30k
Recently I started wondering about multiple encryption and found pages upon pages of posts and debates about the security of cascades. Now not to worry, **I'm not looking for someone to discuss a homebrew cascade encryption scheme**. What I do wonder about is the dangers of multiple layers of encryption. I keep ...
Recently I started wondering about multiple encryption and found pages upon pages of posts and debates about the security of cascades. Now, don’t worry – **I'm not looking for someone to discuss a homebrew cascade encryption scheme**. What I do wonder about is the dangers of multiple layers of encryption. I keep...
> In short: does storing these encrypted files in an encrypted partition/folder create the same potential weaknesses as cascade encryption? If not, what of encrypting a .tar of encrypted documents? An encrypted file inside an encrypted container *is* a cascade of ciphers, almost by definition. Is that a problem? ...
Quoting the handbook of applied cryptography, [**chapter 10.3.3 (i)**](http://cacr.uwaterloo.ca/hac/about/chap10.pdf): > Identification based on PK decryption and witness. Consider the following protocol: > 1. $A \leftarrow B: h(r), B, P_A(r,B)$ > 2. $A \rightarrow B: r$ > (Before “2.”, $A$ verifies that $r...
I was thinking about [AONTs][1], and designed the one below, I call it **CHANT** for *Chained-Hash All-or-Nothing Transform*; it's my very first shot at something of the sort, and was hoping I could get your opinions. Suppose you have a hash function $H$ of block size (ie. the size of the generated hash) $b$, and a ...
Is this an acceptable All-or-Nothing Transform?
If your IV is predictable this is as (in)secure as assuming that you have a zero vector IV. And a zero vector IV allows you to perform a so-called **Adaptive Chosen Plaintext Attack** (ACPA). **Why?** Assume that you have a encryption mechanism that works in CBC mode. This means, that on the first iteration ...
I was thinking about [AONTs][1], and designed the one below, I call it **CHANT** for *Chained-Hash All-or-Nothing Transform*; it's my very first shot at something of the sort, and was hoping I could get your opinions. Suppose you have a hash function $H$ of block size (ie. the size of the generated hash) $b$, and a ...
I've been reading through the PGP Standard and here I'm a little confused. [This section][1] is discussing converting string data to a session key. I'm confused about the paragraph in bold. First off, what does it mean by "hash context"? Secondly, which "data" is it referring to? Is that paragraph still talking about w...
I was thinking about [AONTs][1], and designed the one below, I call it **CHANT** for *Chained-Hash All-or-Nothing Transform*; it's my very first shot at something of the sort, and was hoping I could get your opinions. Suppose you have a hash function $H$ of block size (ie. the size of the generated hash) $b$, and a ...
I was thinking about [AONTs][1], and designed the one below, I call it **CHANT** for *Chained-Hash All-or-Nothing Transform*; it's my very first shot at something of the sort, and was hoping I could get your opinions. Suppose you have a hash function $H$ of block size (ie. the size of the generated hash) $b$, you'd ...
> Have I missed something? is this really an AONT? An iterated hash [doesn't make a secure stream cipher][1]. If the attacker can guess $m_i$, they can calculate $w_i \oplus m_i = H^i(m_0)$, then decrypt the rest of the message by taking hashes of that value. An option would be to use the hash function like a blo...
Given a function $F: A \rightarrow B$ and functions $R_1, R_2, \dots, R_k:B \rightarrow A$, we can create a *chain* of length $k$ from a starting point $a_0$ to an end point $a_k$ using $a_i = R_i(F(a_{i-1}))$. A *rainbow table* for $(F, R_1, \dots, R_k, k)$ is a collection of chains with end points $(a_0, a_k)$ org...
If you store the encrypted digests in one location, the key in another, and send the new digest and encrypted one from the first location to the second --- you probably have much better chance to have your communications intercepted with both plaintext and ciphertext revealed compared to the chance that your encrypted ...
Given the general benefits of [Lattice-based cryptography][1], such as: * **Post quantum Security** * **Security from *worst case* scenario** * **Efficiency** What could the outlook of shifting from **RSA** \ **ECC**-based cryptography to the *Lattice* one be? Would that be feasible? Are there any drawba...
Feasible? Sure, there are lattice algorithms that are competitive in performance with RSA. However, there are drawbacks, like: * They've been studied less than RSA or ECC, especially the individual algorithms. * No generic proof that I know of that there isn't a quantum algorithm to solve them. The first one ...
Given the general benefits of [Lattice-based cryptography][1], such as: * **Post quantum Security** * **Security from *worst case* scenario** * **Efficiency** What could the outlook of shifting from **RSA** \ **ECC**-based cryptography to the *Lattice* one (say [NTRU](http://en.wikipedia.org/wiki/NTRU)) be? ...
If your IV is predictable this is as (in)secure as assuming that you have a zero vector IV. And a zero vector IV allows you to perform a so-called **Adaptive Chosen Plaintext Attack** (ACPA). **Why?** Assume that you have a encryption mechanism that works in CBC mode. This means, that on the first iteration ...
If your IV is predictable this is as (in)secure as assuming that you have a zero vector IV. And a zero vector IV allows you to perform a so-called **Adaptive Chosen Plaintext Attack** (ACPA). **Why?** Assume that you have a encryption mechanism that works in CBC mode. This means, that on the first iteration ...
Consider the function $F$ from $\{0,1\}^{56}$ to $\{0,1\}^{64}$, mapping the operative bits of a DES key to the ciphertext for all-zero plaintext. How could we organize a [rainbow table][1] to invert that function with high probability, low computational cost, and a reasonably-sized table that can be constructed at rea...
> Have I missed something? is this really an AONT? An iterated hash [doesn't make a secure stream cipher][1]. If the attacker can guess $m_i$, they can calculate $w_i \oplus m_i = H^i(m_0)$, then decrypt the rest of the message by taking hashes of that value. An option would be to use the hash function like a blo...
If your IV is predictable this is as (in)secure as assuming that you have a zero vector IV. And a zero vector IV allows you to perform a so-called **Adaptive Chosen Plaintext Attack** (ACPA). **Why?** Assume that you have a encryption mechanism that works in CBC mode. This means, that on the first iteration ...
I'm trying to analyze a login protocol based on symmetric key cryptography. I'm just starting out, so this may very likely be a *very* bad idea, but nonetheless I'd like to hear your thoughts on it. The protocol assumes the existence (and agreement on) the following: - A symmetric-key algorithm $E$ / $D$. - A ...
I'm reading <https://eprint.iacr.org/2009/616.pdf> I am reading the proof of Lemma A.1 which is in page 21. In the page 22, the thesis tells that the noise is at most (4τ + 3)2^ρ < τ2^( ρ+3). But I cannot follow the inequality. Could you guys help me to understand the proof of Lemma A.1?
I'm reading <https://eprint.iacr.org/2009/616.pdf> I am reading the proof of Lemma A.1 which is in page 21. In the page 22, the thesis tells that the noise is at most $(4\tau + 3)2^\rho < \tau2^{ \rho+3}$. But I cannot follow the inequality. Could you guys help me to understand the proof of Lemma A.1?
What is the disadvantage of AES-GCM mode of authenticated encryption? Why CAESAR competition says that its one of the goal is to find a AE scheme that offer a advantage over AES-GCM? What advantage they are talking about ?
If your IV is predictable this is as (in)secure as assuming that you have a zero vector IV. And a zero vector IV allows you to perform a so-called **Adaptive Chosen Plaintext Attack** (ACPA). **Why?** Assume that you have a encryption mechanism that works in CBC mode. This means, that on the first iteration ...
What is the disadvantage of AES-GCM mode for authenticated encryption? Why does the CAESAR competition say that it’s one of the goals to find an AE scheme that offers an advantage over AES-GCM? What advantage they are talking about?
What is the disadvantage of AES-GCM mode for authenticated encryption? Why does [the CAESAR competition](http://competitions.cr.yp.to/caesar-call.html) say that it’s one of the goals to find an AE scheme that offers an advantage over AES-GCM? What advantage they are talking about?
I modified my question since it is not as specific as I wanted. I'm studying FHE over the Integer which is <https://eprint.iacr.org/2009/616.pdf> I got questions about the proof of Lemma A.1. In page 6, the element of public key is in the form of $$x=pq+r$$ and the encryption is $$ c← [m+2r+2\sum x_...
I am new to cryptography and am going through the book Understanding Cryptography by Paar and Pelzl. From what I understand Symmetric key distribution systems like Kerberos do not provide PFS because an attacker will be able to decrypt every session key ever encrypted with a compromised KEK. In the book, on page...
Is perfect-forward secrecy achieved with RSA?
I'm doing a little bit of reading about lattices. I read that if we can find a 'short' basis for our given lattice, we can solve CVP and SVP very efficiently. However, the paper didn't describe an algorithm. Can anyone briefly describe an algorithm for doing this?
Given a 'good' basis for a lattice, how can we solve the CVP?
I think my definition of 'simple' is different from yours. : ) > Are there any evident attacks on it? It's vulnerable to man-in-the-middle attacks, like: Step 9: M replaces $\langle b_{U}, v'_{U}, h'_{U} \rangle$ with $\langle b_{U}, v_{M}, h_{M} \rangle$, where they've calculated their own random bit string a...
Feasible? Sure, there are lattice algorithms that are competitive in performance with RSA. However, there are drawbacks, like: * They've been studied less than RSA or ECC, especially the individual algorithms. * The most well studied system, NTRU, is patented. * No generic proof that I know of that there isn't ...
Using a symmetric encryption algorithm E on a message M, users usually send E(M) to the recipient and then the recipient will compute E^-1(E(M))=M to retrieve the message. For what symmetric encryption algorithms would it be equally secure to instead send E^-1(M) and have the recipient compute E(E^-1(M))=M? Suppose ...
Using a symmetric encryption algorithm $E$ on a message $M$, users usually send $E(M)$ to the recipient and then the recipient will compute $E^{-1}(E(M))=M$ to retrieve the message. For what symmetric encryption algorithms would it be equally secure to instead send $E^{-1}(M)$ and have the recipient compute $E(E^{-1}(M...
If your IV is predictable this is as (in)secure as assuming that you have a zero vector IV. And a zero vector IV allows you to perform a so-called **Adaptive Chosen Plaintext Attack** (ACPA). **Why?** Assume that you have a encryption mechanism that works in CBC mode. This means, that on the first iteration ...
Can anyone show me a simple proof of work algorithm that I can use to stop spammers? I've looked at hashcat, but i think there's a bit too much specialized hardware for bitcoin mining. That is, the time required to calculate one proof of work on a mobile device cpu is way too long compared to a bitcoin mining rig u...
Simple proof of work example?
Just a simple one: is **SRP-6a** post-quantum secure? If not, are there any post-quantum secure *"**SRP-6a**-like"* alternatives?
Is SRP post-quantum secure?
Short answer: Don't do this. The security proof for the One Time Pad requires the use of a **True Random Bit Generator**. The best you can find on a typical multipurpose system without dedicated hardware support for a TRBG is a **Cryptographically Secure Random Bit Generator**. The difference is that CSRBG is typically...
I am learning about cryptography, purely for my own interest. As part of that, I am implementing a simple [tag:one-time-pad] toolset in C. Naturally, I need to generate random numbers to create the pad, and they need to be cryptographically strong. I know about `rand()`, but from what I can tell it is not strong. ...
Correctly generating cryptographically secure pseudorandom numbers (in C)?
First of all, I apologize if this is a stupid question, but I don't have any background in cryptography. I'm looking for a secure hash algorithm $H$ with the property $H(K_1+n)\oplus H(K_2+n)=H(K_1\oplus K_2 + n)$. Would it be feasible to implement a hash algorithm like this, and could a hash algorithm even be secu...
How can I get point addition equation for elliptic curves in projective co ordinate system ? Can I get it by changing $$ x = X/Z $$ and $$ y =Y/Z $$ in the equation for affine co ordinates' group law ? I have done it using the above narrated step and made the denominator as $ Z $ in equation for binary super-singular c...
I have thought of a system for generating passwords which works as follows: Take the following items: 1. A password, such as 'williamwallace'. 2. A secret 1000 digit number which is stored on my computer. 3. The name of a website. Create a password like this: `hex(sha512(site + password + number))` (e....
I am working on AES. Can we expand $s(a \oplus b)$ in terms of $s(a)$ and $s(b)$ where $a$ and $b$ are two eight bit inputs and $s(a)$ is the S-box value of $a$?
I have thought of a system for generating passwords which works as follows: Take the following items: 1. A password, such as `williamwallace`. 2. A secret 1000 digit number which is stored on my computer. 3. The name of a website. Create a password like this: hex(sha512(site + password + number)) e...
I'm studying FHE over the Integer which is <https://eprint.iacr.org/2009/616.pdf> I wonder why $x_0$, which is component of the public key, should be odd number?
I want to use hash function on some data, and part of this data, might be constant for a certain period. The output of the hash function is used as authentication data (MAC). I want to know if there is: 1. Reason to use/not use this data as input to the hash? (In the context of authenticity of data…) 2. Impact o...
If you need a MAC, use a MAC. For example, [HMAC][1] which uses a hash function. Don't try to use a random hash function in your own scheme, because some such schemes [are not secure][2]. > Reason to use/not use this data as input to the hash? (In the context of authenticity of data…) If you do have a secure MAC,...
After reading [these][1] [two][2] resources I am wondering am I getting all the differences between Scrypt and PBKDF2 or am I missing something? As far as I understood, the similarity is: - both are password-based key derivation functions The difference is: - Scrypt is more resource demandful [1]:...
What is the difference between Scrypt and PBKDF2?
After reading [these][1] [two][2] resources I am wondering am I getting all the differences between Scrypt and PBKDF2. As far as I understood, the similarity is: - both are password-based key derivation functions. The difference is: - Scrypt is more resource demanding. Am I missing something? [1]: h...
If the question is "can we define a function that, given $s(a)$ and $s(b)$, gives us the value $s(a \oplus b)$, the answer is, yes, of course we can; the obvious implementation of such a function is: $F(x, y) = s( s^{-1}(x) \oplus s^{-1}(y))$ With this function, if $x=s(a)$ and $y=s(b)$, the $F(x,y) = s(a \oplus ...
I am trying to implement an AES encryption on my messages in my app and I want to have a different keystream for each "message group". Therefore, currently I am holding the keystreams in the database of the message groups. And the messages get decrypted by the app. However, there is one problem. The app is talking to t...
where to keep the AES keystream?
I am new in cryptography. I want to determine the complexity of revealing a random bit permutation which is used as block cipher for plaintexts (bitstrings of length n). An adversary catches different ciphertexts (the permuted bitstrings of length n) and he also knows the set of possible plaintexts. If he tries all pos...
> Is it possible to reveal the used permutation? Not if the keyspace is large enough. There are $2^n!$ different $n$-bit permutations, but a block cipher typically has only a 128-bit or 256-bit keyspace, so not all permutations are possible. Unless the cipher is broken, the only way to narrow it down is a brute forc...
I'm studying FHE over the Integer which is <https://eprint.iacr.org/2009/616.pdf> In the remark 3.4, it says that the fresh ciphertexts have noise at most $2^{\rho'+2}$. I don't know why that statement is true. In my guess, the value $2^{\rho'+2}$ came from $m+2r$. But it cannot be strict proof of the statemen...
I thought you were using a block cipher, i.e. a pseudorandom permutation. Instead as per your comment you are only permuting the order of the plaintext bits. This is not secure. For example, you can imagine the bit permutation is an n-by-n square matrix, where each row and column has a single 1 and the rest 0s. The ...
I need to use “ECDH with a cofactor key” for generating symmetric key. I have a fair idea on how ECDH works, but I don’t understand the cofactor part. What is the difference between ”ECDH with a co-factor key” and ”ECDH without a co-factor key”? Also, it would be great if you could point me to information relat...
Difference between “ECDH with cofactor key” and “ECDH without cofactor key”?
I already found a protocol to find out who is richer (older) between two parties, but Is there any protocol to find the youngest person among 3 parties, without revealing actual ages?
I have thought of a system for generating passwords which works as follows: Take the following items: 1. A password, such as `williamwallace`. 2. A secret 1000 digit number which is stored on my computer. 3. The name of a website. Create a password like this: hex(sha512(site + password + number)) F...
I am wondering if using Skein or the Keccak hash algorithm in this construction (as a stream cipher) is secure: - $H$ = Keccak or Skein hash with a 256 bit output - $K$ = The main 256 bit random key, pre-shared between sender and receiver - $K_M$ = A secondary 256 bit random key for creating the MAC, pre-shared...
From what I understand: 1. TrueCrypt takes the password as message 2. Add salt 3. calculates a digest 4. use digest for encryption From what I understand. A good hash function 1. has Second pre-image resistance .i.e. It is difficult to find $m_2$ such that $m_1\neq m_2$ and $hash(m_1) = hash(m_2)$ .i.e. it ...
> I am wondering if using Skein or the Keccak hash algorithm in this construction (as a stream cipher) is secure: In the case of Skein and Keccak it should be secure. However, both of those have defined their own cipher modes which you should IMO prefer. (For compatibility, if not security.) * The Skein one is de...
I'm reading [“Fully Homomorphic Encryption over the Integers”](https://eprint.iacr.org/2009/616.pdf) by van Dijk et al. I wonder why $x_0$, which is a component of the public key, should be an odd number?
I need to use ECDSA as the signing algorithm and SHA256 for hashing the message. I'm running into troubles verifying the signature calculated on two different platform (one is BouncyCastle, another one a C library for a microprocessor). I figured out that BouncyCastle, in its ECDSASigner class, reduces the input mes...
ECDSA with SHA256 and sepc192r1 curve: Impossoble, or how to calculate e?
After some digging around in [the HMAC spec][1] I found this (paraphrased): > Step 1: If the length of Key equals the block size of the hash > function (512 bits/64 Bytes for SHA-256), set the key equal to the > key. Go straight to step 4. > > Step 2: If the length of key is greater than the block size of hash ...
Is there a difference between PRF and a hash function? For example: Creation of a secret key is using PRF and creating a secret key is using hash function.
I am wondering if using Skein or the Keccak hash algorithm in this construction (as a stream cipher) is secure: - $H$ = Keccak or Skein hash with a 256 bit output - $K$ = The main 256 bit random key, pre-shared between sender and receiver - $K_M$ = A secondary 256 bit random key for creating the MAC, pre-shared...
I need to use ECDSA as the signing algorithm and SHA256 for hashing the message. I'm running into troubles verifying the signature calculated on two different platform (one is BouncyCastle, another one a C library for a microprocessor). I figured out that BouncyCastle, in its ECDSASigner class, reduces the input mes...
ECDSA with SHA256 and sepc192r1 curve: Impossible, or how to calculate $e$?
I was wondering if there is a smart way for a user to only encrypt a subset of a plaintext. I'll try to be more specific. Let's suppose the user U wants to use a special cipher such that given a plaintext P and some additional information, it only encrypts the subset requested by the user, the rest of the plaintext ...
I was wondering if there is a smart way for a user to only encrypt a subset of a plaintext. I'll try to be more specific. Let's suppose the user U wants to use a special cipher such that given a plaintext P and some additional information, it only encrypts the subset requested by the user, the rest of the plaintext ...
Unbalanced Feistel networks can be homogenous (F-function identical in each round), or they can be heterogeneous (F-function not always identical in each round). The advantage of heterogenous UFNs is, that its internal properties change each round, making it more difficult to find specific characteristics which prop...
Now that we know [how the MD2 S-box was constructed][1], I find myself wondering how good a [nothing up my sleeve number][2] it really is. It *is* derived from $\pi$, but not in a very obvious way, even in retrospect. How would you estimate the number of possible $\pi$-derived S-boxes that are no more complex or sus...
How many degrees of freedom up my sleeve?
Wikipedia says that key whitening increases security: > In cryptography, key whitening is a technique intended to increase the security of an iterated block cipher. It consists of steps that combine the data with portions of the key. > The most common form of key whitening is **xor-encrypt-xor** -- using a simple...
How exactly does key whitening manage to increase security?
[Wikipedia states](http://en.wikipedia.org/wiki/Key_whitening) that key whitening increases security: > In cryptography, key whitening is a technique intended to increase the security of an iterated block cipher. It consists of steps that combine the data with portions of the key. > The most common form of key wh...
I'm brainstorming some different ways of making deterministic encryption more secure. I want to use deterministic encryption to preserve searchability over the keywords in a document set. However, I know that frequency analysis is always a concern when preserving searchability in this way. The strategy I came up wi...
Say I have some black box which, given any English word, deterministically outputs a token for that word. Assume our black box is implemented using strong cryptography, i.e. the hardness of reversing a token to its word is reducible to some known assumption. Now, assume I have a document corpus where a document is ...
How feasible is word-level frequency analysis over English (or any language)?
The feasibility depends a lot on the length of the corpus. The more statistics, the better guesses an attacker would be able to make. > He'll try to use statistical attacks to fit the frequency curve of the tokens to the frequency curve of English words. This will allow him to guess the preimages of more frequent wo...
Following scenario: I have to protect the integrity of some files that will be exchanged between entities A, B, C. Entity A creates the file (e.g. configuration) and sends it to B and C. Entities A and B are considered trusted but entity C is semi-trusted (by default it is trusted but we assume it could be compromised ...
A way around digital signatures?
Unbalanced Feistel networks can be homogenous (F-function identical in each round), or they can be heterogeneous (F-function not always identical in each round). The advantage of heterogeneous UFNs is, that its internal properties change each round, making it more difficult to find specific characteristics which pro...
**Scenario:** I have to protect the integrity of some files that will be exchanged between entities $A$, $B$, $C$. Entity $A$ creates the file (e.g. configuration) and sends it to $B$ and $C$. Entities $A$ and $B$ are considered trusted but entity $C$ is semi-trusted (by default it is trusted but we assume it could be ...
**Scenario:** I have to protect the integrity of some files that will be exchanged between entities $A$, $B$, $C$. Entity $A$ creates the file (e.g. configuration) and sends it to $B$ and $C$. Entities $A$ and $B$ are considered trusted but entity $C$ is semi-trusted (by default it is trusted but we assume it could be ...
While confusing, that Wikipedia article is actually correct! # Definition of key whitening Key whitening is an extremely simple technique to make block ciphers like DES much more resistant against brute-force attacks. Like you’ve already discovered yourself, this is the basic scheme: ![block cipher – basic sch...
While confusing, that Wikipedia article is actually correct! # Definition of key whitening Key whitening is an extremely simple technique to make block ciphers like DES much more resistant against brute-force attacks. Like you’ve already discovered yourself, this is the basic scheme: ![block cipher – basic sch...
Perceptual encryption is a term used to describe various applications of encryption methods intended for audio, speech, image and video data. The basic idea is that one performs encryption for multimedia content in a way that only a certain amount of "perceptual information" is touched by the encryption. It may be ...
Let's assume I've encrypted some text with some 24-byte key using 3DES in ECB mode. Is it possible to regain the key if I have both encrypted and decrypted text? (Excluding bruteforce.)