instruction
stringlengths
15
30k
Here's my interpretation of what is happening here, though it's hard to be sure without more context. A $c \in C$ has been chosen, and we are asking "What is the probability $E_k(m)=c$ is true if $m \in M$ and $k \in K$ are chosen uniformly at random?" To find this probability, you divide the total number of outco...
The right-hand side of your equation is just the average probability that a random message encrypted with a random key gives the ciphertext $c$. (Exercise: Why? Hint: ${\rm avg}(x_1, x_2, \dotsc, x_n) = (x_1 + x_2 + \dotsb + x_n) / n$.) However, if $k$, $m$ and $c$ are all fixed (and you haven't indicated that t...
Assuming you don't use counter-measures against this kind of an attack, a chosen-ciphertext attack works as follows: Variables: $p$ is field prime, $\alpha$ is the chosen generator, $a$ is the private key, $\alpha^a=\beta$ is the public key. $k'$ and $m'$ are chosen at random. Note: all the following equations ar...
Is it possible to make ElGamal IND-CCA2 using [OAEP][1] or [OAEP+][2]? The reason I ask is that I recently answered [this question][3] and it came to my mind that OAEP or OAEP+ might be possible solutions. [1]: https://en.wikipedia.org/wiki/Optimal_asymmetric_encryption_padding [2]: http://shoup.net/papers/o...
Some time has passed since PFS introduction and we now have secure&proven asymmetric ciphers that can generate strong keys very efficiently (elliptic RSA variants and/or QD-Mceliece can generate 128-bit-equivalent-secure keys in milliseconds), so I'd like to implement some of them into some software I'm writing here. ...
Standards/RFCs for non-Diffie-Hellman perfect forward secrecy?
What do these notations mean in the definition of Perfect Secrecy, if we read those in English?
I'm having some trouble understanding the Blowfish encryption algorithm. From the [Wikipedia article][1]... "The secret key is then, byte by byte, cycling the key if necessary, XORed with all the P-entries in order" Can someone explain this in more detail? For example, the first few P entries are 0x243f6a88, 0x...
I'm having some trouble understanding the Blowfish encryption algorithm. From the [Wikipedia article][1]... >The secret key is then, byte by byte, cycling the key if necessary, XORed with all the P-entries in order Can someone explain this in more detail? For example, the first few P entries are 0x243f6a88, 0x85a...
The quoted passage of the Wikipedia article <strike>is wrong</strike> does not at first reading seem to match Blowfish as in Bruce Schneier's _Description of a new variable-length key, 64-bit block cipher (Blowfish)_ ([in proceedings of the first FSE conference, held Dec. 1993][1]) which for this same operation reads: ...
The quoted passage of the Wikipedia article <strike>is wrong</strike> does not at first reading seem to match Blowfish as in Bruce Schneier's _Description of a new variable-length key, 64-bit block cipher (Blowfish)_ ([in proceedings of the first FSE conference, held Dec. 1993][1]) which for this same operation reads: ...
The quoted passage of the Wikipedia article <strike>is wrong</strike> does not at first reading seem to match Blowfish as in Bruce Schneier's _Description of a new variable-length key, 64-bit block cipher (Blowfish)_ ([in proceedings of the first FSE conference, held Dec. 1993][1]) which for this same operation reads: ...
The quoted passage of the Wikipedia article <strike>is wrong</strike> does not at first reading seem to match Blowfish as in Bruce Schneier's _Description of a new variable-length key, 64-bit block cipher (Blowfish)_ ([in proceedings of the first FSE conference, held Dec. 1993][1]) which for this same operation reads: ...
I just tried to review & understand AKE (Authenticated Key Exchange) protocol as defined in OTR secure messaging protocol [version 3 here][1] , and aiming to achieve Perfect Forward Secrecy I am a little bit confused with the described handling of the "r" aes key in the presented DHE (Ephemeral Diffie-Hellman) pr...
Rationale of "r" AES key use in OTR version 3 AKE protocol?
The quoted passage of the Wikipedia article <strike>is wrong</strike> does not at first reading seem to match Blowfish as in Bruce Schneier's _Description of a new variable-length key, 64-bit block cipher (Blowfish)_ ([in proceedings of the first FSE conference, held Dec. 1993][1]) which for this same operation reads: ...
The quoted passage of the Wikipedia article <strike>is wrong</strike> does not at first reading seem to match Blowfish as in Bruce Schneier's _Description of a new variable-length key, 64-bit block cipher (Blowfish)_ ([in proceedings of the first FSE conference, held Dec. 1993][1]) which for this same operation reads: ...
The quoted passage of the Wikipedia article <strike>is wrong</strike> does not at first reading seem to match Blowfish as in Bruce Schneier's _Description of a new variable-length key, 64-bit block cipher (Blowfish)_ ([in proceedings of the first FSE conference, held Dec. 1993][1]) which for this same operation reads: ...
I'd like to understand what is the meaning of this field, especially considering that when calling a crypto library to sign data the digest method is specified by the caller. For example, this simple C# code: RSACryptoServiceProvider rcsp = certs[0].PrivateKey as RSACryptoServiceProvider; rcsp.SignData(dat...
If server is sending its digital signature, in which message / where does the digitally signature is provided to the client. Is it after the **server_hello** message because there the public key of the certificate is exchanged which is needed to decrypt the digital signature or with the initial certificate containi...
I am implementing [Shamir's Secret Sharing][1], and I find that in (t,n)-threshold scheme, the shares are just using `1,2,3...,n` as the key to form the shares `(i,f(i))`. For example, I want share "Hello", and the shares look like this: 01-AAAA1,AAAA2,AAAA3,AAAA4,AAAA5 02-BBBB1,BBBB2,BBBB3,BBBB4,BBBB5 ...
I'm looking through the latest version of NIST SP 800-63, and there is a table (Table A.1) in the Appendix that supposed give the "entropy" of a password for a 94 character alphabet for various password lengths. This is the last column of Table A.1. I'm pretty sure they are just using the formula (given previously i...
I am implementing [Shamir's Secret Sharing][1], and I find that in (t,n)-threshold scheme, the shares are just using `1,2,3...,n` as the key to form the shares `(i,f(i))`. For example, I want share "Hello", and the shares look like this: 01-AAAA1,AAAA2,AAAA3,AAAA4,AAAA5 02-BBBB1,BBBB2,BBBB3,BBBB4,BBBB5 ...
Some time has passed since PFS introduction and we now have secure&proven asymmetric ciphers that can generate strong keys very efficiently (elliptic RSA variants and/or QD-Mceliece can generate 128-bit-equivalent-secure keys in milliseconds), so I'd like to implement some of them into some software I'm writing here. ...
Some time has passed since PFS introduction and we now have secure&proven asymmetric ciphers that can generate strong keys very efficiently (elliptic RSA variants and/or QD-Mceliece can generate 128-bit-equivalent-secure keys in milliseconds), so I'd like to implement some of them into some software I'm writing here. ...
<br/> Assume we have the following scheme for RFID:<br/> TAG & READER both have initially 4 keys, for example { 1001, 1100, 0011, 0100 }.<br/> Every session the TAG computes XOR of the last 4 keys, i.e. <br/> $k_{1}$ = 1001 $\oplus$ 1100 $\oplus$ 0011 $\oplus$ 0100,<br/> generates a random number $r_1$ and sends ...
Is it a secure scheme for RFID?
<br/> Assume we have the following scheme for RFID:<br/> TAG & READER both have initially 4 keys, for example { 1001, 1100, 0011, 0100 }.<br/> Every session the TAG computes XOR of the last 4 keys, i.e. <br/> $k_{1}$ = 1001 $\oplus$ 1100 $\oplus$ 0011 $\oplus$ 0100,<br/> generates a random number $r_1$ and sends ...
For me, the main advantages of Ed25519 are that it avoids patents (by computing in one dimension) and that it is fast. However, the 128bit security of Ed25519 is sometimes too strong to comply with export regulations. So I wonder if there are any weaker curves of the same type (i.e. also patent-free and fast) tha...
Weaker alternative to Ed25519?
It's the same situation as for RSA encryption. If you accidentally pick a bad $s$, i.e. one that's not coprime to $N$ then the protocol fails. How likely is this to happen? If you hit a bad $s$, then you can find the factors of $N$, hence you can break the protocol - put another way, finding a bad $s$, whether delibera...
The Wikipedia article on Shamir's Secret Sharing says to that to have information theoretical security the splitting algorithm should be evaluated using finite field arithmetic on the field $\rm{GF}(p)$ such that $p>n,p>S$ where $n$ is the number of shares and $S$ is the information to be shared. It suggests that on th...
I'm playing around with the CryptoPP library with DES/CBC and I've noticed that for some sets of data, if I decrypt the ciphertext with Key1, IV1, I get a good cleartext result -- but if I decrypt the same ciphertext with Key1, IV2, I get the identical good cleartext result. I find this very surprising. So much s...
Are there equivalent IVs in DES/CBC?
I have a silly question, but I don't know a solution, so I need to question. Assume, with a algorithm $TrapGen(1^\lambda)$, it generates $A\in\mathbb{Z}_q^{n\times m}$ with a basis $B \in\mathbb{Z}_q^{m\times m}$ for $\Lambda^\perp(A)$. With ISIS problem (inhomogoneous small integer solution), if $SIS_{q,m,2r\sqr...
If m: message, M: message space, k: key, K: keyspace, c: cipher, C: cipher space and $E_k$: encryption function, such that $E_k(m) = c,\ m,m^* \in M,\ k\in K,\ c\in C.$ Then, what do the following notations actually mean in plain English? ![enter image description here][1] What does it mean by $C=c$? If it me...
Is it possible to make ElGamal IND-CCA2 using [OAEP][1] or [OAEP+][2]? The reason I ask is that I recently answered [this question][3] and it came to my mind that OAEP or OAEP+ might be possible solutions. Note this isn't a practical question at all. There's no intention in implementation, I'm just asking if it w...
I was reading about HMAC and why it is crucial to avoid security issues with normal prepending / appending the secret k to a message (issues due to merkel damagard construction). I am not familiar with the math and the detailed proof presented in the paper, but i was wondering why both ipad and opad are required. what ...
why are both ipad and opad required for HMAC?
I've read [this paper][1] about the encrypt-mix-encrypt mode for ciphers and was asking myself if this mode provides "full" diffusion. So if an attacker alters one bit of the ciphertext, how many bits (all?) get scrambled on decryption? (if using AES and blocks of size 4096 bits (drive sector size)) Or in other w...
Encrypt-Mix-Encrypt: Full Diffusion?
<br/> Assume we have the following scheme for RFID:<br/> TAG & READER both have initially k keys. Every session the TAG computes $k_i$=F($k_{i-1})$ where F can be any function, for example XOR of the last keys, or XOR previous key with randomly generated number, e.g. $k_i^R$=F($k_{i-1}^L$) $\oplus$ $r_i$ , $k_i^L$=F...
<br/> Assume we have the following scheme for RFID:<br/> TAG & READER both have initially k keys. Every session the TAG computes $k_i$=F($k_{i-1})$ where F is a function which computes XOR of previous key with randomly generated number,<br/> e.g. $k_i^R$=F($k_{i-1}^L$) $\oplus$ $r_i$ , $k_i^L$=F($k_{i-1}^R$) $\oplus...
From [Wikipedia][1]: > In cryptography, a key derivation function (or KDF) derives one or more secret keys from a secret value such as a master key or other known information such as a password or passphrase using a pseudo-random function. Is there a more formal security definition for what they are and what proper...
What is a Key Derivation Function?
I'm curious as to how a backdoor can be built into a hash function. What might it take the form of? What's probability of getting one that can be backdoored in a way that can actually undermine its security? Could this backdoor be asymmetric?
From my understanding BCrypt truncates the password to 72 bytes. If a password is longer than 72 bytes, what is a way to store that password using bcrypt securely without compromising it? I've seen some implementations where they SHA-256 the password first then enter it into BCrypt (e.g. [PassLib bcrypt_sha256][1])....
Is there a way to use bcrypt with passwords longer than 72 bytes securely?
From my understanding BCrypt truncates the password to 72 bytes. If a password is longer than 72 bytes, what is a way to store that password using bcrypt securely without compromising it? I've seen some implementations where they SHA-256 the password first then enter it into BCrypt (e.g. [PassLib bcrypt_sha256][1])....
From my understanding BCrypt truncates the password to 72 bytes. If a password is longer than 72 bytes, what is a way to store that password using bcrypt securely without compromising it? I've seen some implementations where they SHA-256 the password first then enter it into BCrypt (e.g. [PassLib bcrypt_sha256][1])....
From my understanding BCrypt truncates the password to 72 bytes. If a password is longer than 72 bytes, what is a way to store that password using bcrypt securely without compromising it? Or is this incorrect and we should just let bcrypt truncate it? I've seen some implementations where they SHA-256 the password fi...
From my understanding BCrypt truncates the password to 72 bytes. If a password is longer than 72 bytes, what is a way to store that password using bcrypt securely without compromising it? Or is this incorrect and we should just let bcrypt truncate it? The reason why I ask is that I've seen some implementations where...
I know this sounds too broad. But I noticed that there was a chapter on chaotic crypto in the recent Handbook of Information and Communication Security Editors: Stavroulakis, Peter, Stamp, Mark (Eds.) by Springer. Sorry about the paywall, the text has all the usual chapters you'd expect, in addition to chaotic encrypt...
Is chaotic encryption secure?
Recently, I've been reading a couple of papers about building cryptosystems that are secure for up to 30 years. But for some applications, this seems a bit low to me. So I am wondering if considering the current state of the art in cryptography and computing power evolution forecasts, one could instead build a public-k...
I am doing the program of implementing ECDSA for which I am trying to solve the equation scenario. In ECDSA that Signature generation algorithm which states as hash value from the SHA-1 and where "l" denotes the left most bits of the hash. Sir in example of hash value "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3" In tha...
What does L_n is the bit length of the group order n states need for my calculation in ECDSA algorithm ?
Recently, I've been reading a couple of papers about building cryptosystems that are secure for up to 30 years. But for some applications, this seems a bit low to me. So I am wondering if considering the current state of the art in cryptography and computing power evolution forecasts, one could instead build a public-k...
> ... are secure for up to 30 years. Unfortunately, you didn't reference where this number comes from. Breaking asymmetric cryptosystems comes with various flavors: - Scientific advances and new records, e.g. the factorization of RSA-768 in 2009 - What intelligence agencies are capable of (it can be assumed to b...
It is given two RSA moduli $N_1$ and $N_2$, known to be of the form $N_i=p_i\cdot q_i$, with $p_i$ and $q_i$ unknown primes, and such that $p_2=p_1+2$. Can we make use of that relation to factor the moduli much more efficiently than if it did not held? If that helps, add extra assumptions if they are plausible for c...
Factoring two RSA moduli $N_i=p_i\cdot q_i$ knowing that $p_2=p_1+2$?
It is given two RSA moduli $N_1$ and $N_2$, known to be of the form $N_i=p_i\cdot q_i$, with $p_i$ and $q_i$ unknown primes, and such that $p_2=p_1+2$. Can we make use of that relation to factor the moduli much more efficiently than if it did not held? If that helps, add extra assumptions if they are plausible for c...
can you help me what is legend of h(r) in below protocol? ‎‎$A‎\leftarrow‎{B}\quad:{h(r)‎‎}{,B}{,P{_A(r,B)}}‎\\A‎\rightarrow‎{B}\quad:r$
what is legend of h(r) in this protocol?
$h$ is a (secure?) hash function. This is standard notation. Thank you Ricky Demer, who answered this question first (in the comments)
Introduction --- BCrypt is a password-based [KDF][1] (far from state-of-the-art, but better than PBKDF2, because BCrypt requires sizable RAM, which greatly increases the cost of hardware-accelerated password search). Bcrypt is based on the blockcipher Blowfish, with the initial processing of the password _reminisc...
[Section 9.5.6][1] of Cryptography Engineering states that > The concatenation [of source number, length of data, and data itself] is then appended to the pool. Why are we including source number and data length? The source number is fixed for each source, the length of data is constant for many sources, so aren'...
First, some well-known results are as follows. For random variables $X$ and $Y$, we have $$H(X,Y) \leq H(X) + H(Y).$$ The equality is achieved when $X$ and $Y$ are independent. Second, in one-time pad, random variables $M$, $K$ and $C$ are used to denote a plain text, a private key and the codeword generated by $M...
Why perfect secrecy can be ensured when a plain message and a cipher-text based on one-time pad are correlated?
First, some well-known results are as follows. For random variables $X$ and $Y$, we have $$H(X,Y) \leq H(X) + H(Y).$$ The equality is achieved when $X$ and $Y$ are independent. Second, in one-time pad, random variables $M$, $K$ and $C$ are used to denote a plain text, a private key and the codeword generated by $M...
> Are M and C correlated? No. The distribution that the values the M and C may take on are independent of each other. The condition probability distribution that M has is unchanged no matter what the observed C value is. This is true whether you are using the statistical meaning of correlation, or whether you...
> Are M and C correlated? No. The distribution that the values the M and C may take on are independent of each other. The condition probability distribution that M has is unchanged no matter what the observed C value is. This is true whether you are using the statistical meaning of correlation, or whether you...
Introduction --- BCrypt is a password-based [KDF][1] (far from state-of-the-art, but better than PBKDF2, because BCrypt requires sizable RAM, which greatly increases the cost of hardware-accelerated password search). Bcrypt is based on the blockcipher Blowfish, with the initial processing of the password _reminisc...
Introduction --- BCrypt is a password-based [KDF][1] (far from state-of-the-art, but better than PBKDF2, because BCrypt requires sizable RAM, which greatly increases the cost of hardware-accelerated password search). Bcrypt is based on the blockcipher Blowfish, with the initial processing of the password _reminisc...
I would like to know: 1. What is the currently best (efficiency and security wise) known EC based password authenticated key exchange protocol? (i.e. is there any EC based protocol may be similar to DH based SRP protocol) 2. What is the certicom's patent number/title of elliptic curve Point Compression? (I have ...
I have a RSA public key in the form of public exponent and modulus as follows: String exponent = "0000000000000003"; String modulus = "D8016FFDDFBA4B144B0AB13FF01968048B2FC9AA269311D11357DC8CEDCABA232BEC118D3B05AFA2406D27BFB6602B45B80E91D4F446E4A753C251EA6EB8AB8E3F304585DD202D8B04538EB4DD1F87D9A27E1E7B34A30...
Am am auditing some software that includes compiled in DH parameters (2048 bits). - I can't be sure who generated the DH parameters or how they were generated. Question: - Can DH parameters be weak if they were generated improperly or made intentionally weak? - Is it possible to *test* DH parameters, t...
Upon registration an user has to specify an access code of five digits. This access code is also used as a password for the encryption and decryption of certain strings. The user types in "12345" (ACCESS_CODE). Obviously, we don't want to save this access code on the device. Now, when the user wants to decrypt...
How do I control an access code safely?
I am new to cryptography and I am just trying to find key for random text. Can please explain the easy way how we can find the key in small number of steps ? if we have text like **Peit Wokm! Mhfa fepatgb ets bvvrvxmea ebte bae twkd qiqi** and we have key information like `Key = ‘ ? a ? i ’` Then how I can u...
Combining 3 sources A,B and C is not obvious. The right thing to do is not A+B+C. It is A*B+C within a field (E.G. a GF(2^8) field, which maps to bytes). This is based on a 2006 paper by Barack Impagliazzo and Wigdersen (http://dl.acm.org/citation.cfm?id=1328011) that shows that this is a good extractor. You still need...
whether keys are generated by the user or block cipher algorithms their self?
Are keys generated by the user or block cipher algorithms themselves?
I have been trying to figure out the encryption key space, and cardinality of 1024-bit RSA. From my understanding, the key generated from 1024-bit will be primes greater than 2^1023 but less than 2^1024. So there are approximately 8x10^307 types of keys that can be used. Is this the key space or the cardinality, and ho...
What are the differences between Kasiski examination and autocorrelation? In [Cryptool site][1] they mention that autocorrelation analysis is more efficient and clearer than the Friedman or Kasiski test but they fail to mention how they achieve this or how they differ from Kasiski. Thanks for your help. [1]: ...
Is authentication length always a subset of encryption length?
As we are all aware that HASHing is user to verify integrity in cryptography. I have a query about hashing. Suppose a man in the middle attacker manipulates the data and creates new HASH (by running algorithm on manipulated data) using the same hashing algorithm (becausehashing algorithms are universal algorith...
I am doing the program of implementing ECDSA for which I am trying to solve the equation scenario. In ECDSA that Signature generation algorithm which states as hash value from the SHA-1 and where "l" denotes the left most bits of the hash. Sir in example of hash value "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3" In t...
What does L_n is the bit length of the group order n states need for my calculation in ECDSA algorithm?
I am doing the program of implementing ECDSA for which I am trying to solve the equation scenario. In ECDSA that signature generation algorithm which states as hash value from the SHA-1 and where $l$ denotes the leftmost bits of the hash. For example of hash value de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3. In that h...
> However I think that the requirement on $\Pr[F]$ is way too strong: one can prove security with much more frequent faults. Maybe this short paper by Alexander W. Dent could be of interest: [A Note On Game-Hopping Proofs](https://eprint.iacr.org/2006/260)? In this paper he introduces a fourth kind of game hop, name...
When we have regions of the packet that we only authenticate but not encrypt, that happens because we have data that we want to bind to the encrypted region, but we don't need to include within the encrypted region. Examples of this are: - For IPsec, we include the sequence number (as a part of the ESP header). We...
What are the differences between '*Kasiski examination*' and '*auto-correlation*' ? In [Cryptool site][1], they state that autocorrelation analysis is more efficient and clearer than the Friedman or Kasiski test. But, they fail to mention how they achieve this or how they differ from Kasiski. [1]: http://www...
Let there be $p$ and $q$, 2 prime numbers for which the following relationship is true: $|p-q| < 2 . N^{1/4}$. The algorithm first generates the prime number $p$, then it generates $q$ close to $p$. Knowing $q . p = N$. Find $q$ and $p$ for a given $N$. I need to find $q$ and $p$ with $N = 10032208350557943...
Let there be $p$ and $q$, 2 prime numbers for which the following relationship is true: $|p-q| < 2 \cdot N^{1/4}$. The algorithm first generates the prime number $p$, then it generates $q$ close to $p$. Knowing $q . p = N$. Find $q$ and $p$ for a given $N$. I need to find $q$ and $p$ with $N =$<code>1003220...
I have been trying to figure out the encryption key space, and cardinality of 1024-bit RSA. From my understanding, the key generated from 1024-bit will be primes greater than $2^{1023}$ but less than $2^{1024}$. So, there are approximately $8.10^{307}$ types of keys that can be used. Is this the key space or the ca...
I have been trying to figure out the encryption key space, and cardinality of 1024-bit RSA. From my understanding, the key generated from 1024-bit will be primes greater than $2^{1023}$ but less than $2^{1024}$. So, there are approximately $8\times10^{307}$ types of keys that can be used. Is this the key space or t...
I know this sounds too broad. But I noticed that there was a chapter on chaotic crypto in the recent Handbook of Information and Communication Security Editors: Stavroulakis, Peter, Stamp, Mark (Eds.) by Springer. Sorry about the paywall, the text has all the usual chapters you'd expect, in addition to chaotic encrypt...
Is there an encryption algorithm where it's possible to combine multiple encryption keys into one, so that: Encrypt(KeyAB, Data) == Encrypt(KeyA, Encrypt(KeyB(Data))) KeyAB should be computable from KeyA and KeyB, but it must not be possible to compute or guess KeyA or KeyB from KeyAB and/or Data. The algorith...
Is there an encryption algorithm where it's possible to combine multiple encryption keys into one, so that: $E_{AB}(Data) = E_A(E_B(Data))$ KeyAB should be computable from KeyA and KeyB, but it must not be possible to compute or guess KeyA or KeyB from KeyAB and/or Data. The algorithm should be as secure as po...