instruction
stringlengths
15
30k
As we know, breaking a Transposition Cipher is quite trivial and can be easily done by either exploiting single letter frequencies (not d-grams frequencies though, given that $2 < d < L$), or by employing a simple CPA, thus deriving the snippets lenght L and the transposition matrix (key). If we imagine to encrypt t...
Sure you can do. There many lattice attacks, using your second assumption, to ECDSA (which also applied to DSA). For instance see [Smart and Howgrave-Graham][1], [Shparlinski and Nguyen.][2] All the lattice attacks based on finding small solutions (for the ephemeral key $k$ and the private key $a$) to the signing equa...
Sure you can do. There are many lattice attacks, using your second assumption, to ECDSA (which also applied to DSA). For instance see [Smart and Howgrave-Graham][1] and [Shparlinski and Nguyen.][2] All the lattice attacks base on finding small solutions (for the ephemeral key $k$ and the private key $a$) to the signin...
So. Sorry for bothering you with such a simple question, but I can't really get this done. It's just an exam question in which I need to use CRT in order to calculate the RSA signature of a msg m=101(dec), given RSA public modulus n=527=p*q=17*31. So using CRT I need to calculate $p^{-1}\mod q$, which is, for th...
Multiplicative inverse ($17^{-1} \mod 31$)?
Using a quantum computer, [Grover's algorithm](http://en.wikipedia.org/wiki/Grover's_algorithm) can search an unordered list of length $N$ in time $\sqrt{N}$. Applied to cryptography this means that it can recover $n$ bit keys and find preimages for $n$ bit hashes with cost $2^{n/2}$. But the basic version of Grover...
Can Grover's algorithm be parallelized?
> Before round 1 begins, all 64 bits of an incoming message and all 56 bits of the secret key are separately permuted (shuffled) My question is this : Is the shuffling of the bits performed randomly? If it is performed randomly then how does the reciever decrypt the message successfully even though he/she does not k...
Newbie question... may be... Stream cypher, will XOR message bits with one time pad bits Suppose I have a pseudo random number generator, like a Mersenne twister or sort of. I could use the speudo-random string to XOR the message. Use the password as the seed of the generator. Same password = same pseudo random sequ...
I have seen the statement that any tuple of distributions (X,Z) is ε-close to (X′, Z) such that H∞(X′|Z) ≥ H2(X|Z) − log (1/ε), offering a bound on min-entropy which may be better than H∞(X′|Z) ≥ H2(X|Z)/2. Probably being really stupid but cannot see why this is the case, could anyone please shed some light? Does ...
Decryption of message in IBE without random oracle using bilinear pairing registration?
Does the following hold in bilinear pairings? $$e(g^{a_1x_1}g^{a_2x_2},g^{c_1}g^{c_2})=e(g^{x_1+x_2},g^{a_1a_2(c_1+c_2)})$$
Does the following linear equation hold in bilinear pairings?
In [“Randomness Condensers for Efficiently Samplable, Seed-Dependent Sources”](https://cs.nyu.edu/~dodis/ps/condense.pdf) by Dodis, Ristenpart, and Vadhan (PDF), I have seen the statement that: > any tuple of distributions $(X,Z)$ is $ε$-close to $(X′, Z)$ such that $$H∞(X′|Z) ≥ H2(X|Z) − log (1/ε)$$ offering a bo...
If I have a poor PRNG, could a Cryptographyc secure Hash function make a better output? Say the PRNG can produce as much numbers as you wish, reasonably random, but not good enought to be used in crypto applications. If I split the PRNG output into chunks, say 128...512 bits, and feed those to a cryptographyc sec...
If I have a poor PRNG, could a cryptographically secure hash function make a better output? Say the PRNG can produce as much numbers as you wish, reasonably random, but not good enough to be used in crypto applications. If I split the PRNG output into chunks, say $128..512$ bits, and feed those to a cryptographic...
Can hash functions improve a lousy PRNG?
Answered (I think pretty well) by this [Reddit thread](https://www.reddit.com/r/crypto/comments/3drlgl/what_values_constitute_passing_for_ent_tests/): All tests of RNGs are based on a "null hypothesis", meaning if they fail, they show the RNG may be flawed. But if they pass, it does not mean it is good. Therefore, t...
I'm working on an implementation of Krawczyk's [Hashed MQV (HMQV)](https://eprint.iacr.org/2005/176.pdf). I'm using Crypto++, which is a C++ library. C++ has some features where classes that represent the crypto objects can be combined even if they don't have matching security levels. As an extreme example, imagine ...
Favor hash size or field size when systems are disparate?
I'm working on an implementation of Krawczyk's [Hashed MQV (HMQV)](https://eprint.iacr.org/2005/176.pdf). I'm using Crypto++, which is a C++ library. C++ has some features where classes that represent the crypto objects can be combined even if they don't have matching security levels. As an extreme example, imagine ...
I am trying to consider the feasibility of implementing an encrypted file sharing system, which both provides forward secrecy but also allows public key verification. I am stuck on the marriage between these two requirements that hopefully someone can help me out with. In order to provide forward secrecy, I think a ...
I am trying to consider the feasibility of implementing an encrypted file sharing system, which both provides forward secrecy but also allows public key verification. I am stuck on the marriage between these two requirements that hopefully someone can help me out with. In order to provide forward secrecy, I think a ...
I'm going to describe two options that you have. There may be more that I don't know about. The first is to use long-term signing keys to sign public diffie-hellman keys. Upload a bunch of those to the cloud. Then when someone wants to share a file with you, they: 1. download your "next" signed public diffie-hel...
I'm going to describe two options that you have. There may be more that I don't know about. The first is to use long-term signing keys to sign public diffie-hellman keys. Upload a bunch of those to the cloud. Then when someone wants to share a file with you, they: 1. download your "next" signed public diffie-hel...
As we know, breaking a Transposition Cipher is quite trivial and can be easily done by either exploiting single letter frequencies (not $d$-gram frequencies though, given that $2 < d < L$), or by employing a simple CPA, thus deriving the snippets length $L$ and the transposition matrix (key). If we imagine to encrypt...
I took a look at [“Why, or when, to use an Initialization Vector?”][1] but my question is not the same. I have unique keys encrypting each plaintext (in CBC mode, AES-256) and I do not use a key to encrypt more than one plaintext. Is it insecure to use null IVs in this case? If it is insecure, why? [1]: http:...
I've been told that prime-number factoring is based on a "roman-doll" sequence of matrices, where a seed matrix of height Y and width X exists consisting of all zeros except for a single 1 at row Y column X. For every x columns added, the matrix grows by y, and two closely related formulas sum the column vectors and t...
As a font designer, I was thinking that it would be very easy to design a special font that could either jumble characters of a language (or of a code) or simply (with the features offered by the OTF format) overlap into a complex design that only the other user (the reader) would be able to unscramble... Is this some...
Are specially designed fonts sometimes used in cryptography?
As a font designer, I was thinking that it would be very easy to design a special font that could either jumble characters of a language (or of a code) or simply (with the features offered by the OTF format) overlap into a complex design that only the other user (the reader) would be able to unscramble... Is this some...
I'm quite new to this topic and have several questions concerning HMAC and NMAC: - Why does NMAC need two keys? How can it be attacked if we just used some sort of initialization vector instead of the first/second key? - What is the purpose of ipad and opad in HMAC? - What if the key is longer than the block ...
Sorry the question was cryptic (ha! See what I did there?) - but I'm not sure how to word it. Working with an hmac salted hash. I know the entire string being hashed, I do NOT know the salt. I also know the first 8 characters of the resulting hash. I can also, repeatedly, generate new hashes by changing the input...
Possible to find HMAC seed (or increased chance) with knowledge of data?
i cant understand the meaning and the difference between linearity and affine and non linearity equations and what is the meaning of the free term in affine form and how it make the equation non linear and why this form "affine" used?
i cant understand the meaning and the difference between linearity equation and affine and non linearity?
> Is this something that exists and could be plausible? Yes, it has even used by serial killers! <sup>*(So much for creating a dramatic intro – lol)*</sup> What you are referring to might be categorized as a classical [“pigpen cipher”](https://en.wikipedia.org/wiki/Pigpen_cipher); a monoalphabetic substitut...
> Is this something that exists and could be plausible? Yes, it has even used by serial killers! <sup>*(So much for creating a dramatic intro – lol)*</sup> What you are referring to, could be categorized as a classical [“pigpen cipher”](https://en.wikipedia.org/wiki/Pigpen_cipher); a monoalphabetic substitu...
> Is this something that exists and could be plausible? Yes, it has even used by serial killers! <sup>*(So much for creating a dramatic intro – lol)*</sup> What you are referring to, could be categorized as a classical [***“pigpen cipher”***](https://en.wikipedia.org/wiki/Pigpen_cipher); a monoalphabetic su...
> Is this something that exists and could be plausible? Yes, it has even used by serial killers! <sup>*(So much for creating a dramatic intro – lol)*</sup> What you are referring to, could be categorized as a classical [***“pigpen cipher”***](https://en.wikipedia.org/wiki/Pigpen_cipher); a monoalphabetic su...
> Is this something that exists and could be plausible? Yes, things like that already exist and have even been used by well-known serial killers! <sup>*(So much for creating a dramatic intro – lol)*</sup> # Monoalphabetic Substitution Cipher What you are referring to, could be categorized as a classical [**...
I need a simple PRNG function of type: Integer = PRNG(n, maxval) as I would like to count from 0 to maxval, not in a linear manner, but in a pseudorandom manner where I still use every value, but only once. For example, "0 to maxval=9" might result in "3,8,5,1,9,4,0,2,6,7". (For my actual need maxval is always 64...
Shuffleless PRNG function with non-repeating values?
I need a simple PRNG function of type: Integer = PRNG(n, maxval) as I would like to count from 0 to maxval, not in a linear manner, but in a pseudorandom manner where I still use every value, but only once. For example, "0 to maxval=9" might result in "3,8,4,5,1,9,0,2,6,7", and if I asked the function for "Integer...
I need a simple PRNG function of type: Integer = PRNG(n, maxval) as I would like to count from 0 to maxval, not in a linear manner, but in a pseudorandom manner where I still use every value, but only once. For example, "0 to maxval=9" might result in "3,8,4,5,1,9,0,2,6,7", and if I asked the function for "Integer...
I'm not sure how to word this... I'm working with a HMAC (I think of it being a "salted hash"). I know the entire string being hashed, I do NOT know the salt. I also know the first 8 characters of the resulting hash. I can also, repeatedly, generate new hashes by changing the input string, and retrieve new first-8 char...
Chance to find HMAC key/salt when having knowledge of the hashed data?
i want to develop the RC4 algorithm to be more secure and i am not an expert in encryption so i need your help to answer the below question? 1. does the value of the key array(T) have to be in this range [0-255] if yes could you please specify why? 2. why did they use s[t] to generate the key and not the key arra...
Why should a,b < N for Montgomary Reduction?
I looking for some standard conversion from any hash function $f$, which has the pre-image resistance, to other hash function with second preimage resistance. Is there that standard conversion?
Can be CFB mode of block cipher used as a commutative encryption? Is it possible to use CFB mode of AES block cipher to create commutative encryption? With CTR it is possible but not secure.
Can be CFB mode of block cipher used as a commutative encryption?
I want to develop the RC4 algorithm to be more secure and I am not an expert in encryption so I need your help to answer the below questions. 1. Does the value of the key array(T) have to be in this range [0-255] if yes could you please specify why? 2. Why did they use s[t] to generate the key and not the key arr...
>Does the value of the key array(T) have to be in this range [0-255] if yes could you please specify why? Yes. RC4 operates on bytes. There are 256 possible values for an 8 bit (1 byte) number, that range from 0 to 255. RC4 treats the key as an array of bytes, so every entry in the key array is by definition in the ...
I am planning to develop a more secure version of the RC4 algorithm. Since I´m not an encryption expert, I´ld like you to help me find answers to the following questions: 1. Does the value of the key array(T) have to be in this range `[0-255]`? If the answer is “yes”, could you please explain why? 2. Why did they...
In Montgomary reduction, when calculating $a \times b \mod N$, it is required that $a \lt N$ and $b \lt N$. I think $0 \le T \lt N \times R$ is enough for the Mongomary Reduction. Rationale: Let $a' = a \times R \mod N$, let $b' = b \times R \mod N$, and let $T = a' \times b'$. Then $T \times R^{-1} =...
Why should $a,b < N$ for Montgomary Reduction?
I'm trying to figure out whether pseudorandom secret sharing (as described in [this paper][1]) requires a central dealer, i.e. one party who doles out keys to the other players and thus who would be able to generate all the pseudorandom numbers on their own. I'm new to this, so the paper is almost completely opaque...
Does pseudorandom secret sharing require a central dealer?
I have been working on a project involving visual cryptography and I am stuck with the following problem. My question is related to this paper, [AN IMPROVED VISUAL CRYPTOGRAPHY SCHEME FOR SECRET HIDING][1], by R.Youmaran, A. Adler, A. Miri. Can someone explain how one obtains the values for the matrix `O_11^{1'}...
This question is about the approximate GCD problem which is defined as follows:<br> Given any number of the approximate multiples $a_i = p \cdot q_i + r_i$ of $p$, where $p$, $q_i$ and $r_i$ are integers, the problem is to find the hidden common divisor $p$. Note that $q_i$ and $r_i$ change in each $a_i$. A little ...
Fast attack on approximate GCD problem?
How can i design a good sbox? what is the steps and tests needs for that? then i want to understand the key dependent sbox in details? and the difference in design with the random sbox and algebraic based sbox "affine based" and how to be reversed?
How to design a good s box?
Page 7 of Definition 1 in [this paper][1] uses the term "simulator" in defining the security of a cryptographic credential system, which I'm finding a little confusing. In particular, the sentence says: "CSS is secure if there exists a simulator S (ideal-world adversary [defined above as a probabilistic polynomia...
What does "simulator" and "interactive" mean in a cryptographic credential system's definition of security?
While studying the design and the desirable properties of an AES S-box , I came to know that Algebraic Complexity is also an important property of an S-box which is usually considered while evaluating the properties of an S-box. After reading several papers (such as <a href="http://citeseerx.ist.psu.edu/viewdoc/dow...
Definition 1 on Page 7 of [“Efficient Revocation of Anonymous Group Membership”][1] by Camenisch and Lysyanskaya, uses the term *“simulator”* in defining the security of a cryptographic credential system, which I'm finding a little confusing. In particular, the sentence says: > CSS is secure if there exists a sim...
What does “simulator” and “interactive” mean in a cryptographic credential system's definition of security?
We're all aware of the [Logjam attack][1], which is known as "FREAK on discrete logarithms". The attack works by doing a large pre-computation step, which needs only to be done once per field and then quickly computes discrete logarithms. As this seems to be a special property of the GNFS version for discrete logarithm...
How can i design a key dependent sbox in details? and the difference in design with the random sbox؟
How can I design a cryptographically secure, key-dependent s-box (in detail)? And what is the difference in design compared to a random s-box?
How can I design a cryptographically secure, key-dependent s-box?
I would like to design a cryptographically secure, key-dependent s-box, but I am not sure how. Mainly, because I am unsure about the difference in design compared to a random s-box. What is the difference between the methods of S-box construction of “key-dependent s-boxes” and “random s-boxes”?
I am new to Network Security and learning about various security features like Diffie-Helmann and others. I understand that the Public key send by the server to the client needs to certified that it is authentic. So, a Certificate Authority (CA) needs to sign the public key. But I would like to know how is this pub...
I have been working on a project involving visual cryptography and I am stuck with the following problem. My question is related to this paper, [AN IMPROVED VISUAL CRYPTOGRAPHY SCHEME FOR SECRET HIDING][1], by R.Youmaran, A. Adler, A. Miri. Can someone explain how one obtains the values for the matrix $O_{11}^{1...
Daniel J. Bernstein's [ChaCha][1] core is an evolution of the [Salsa20][2] core. Both are functions over the set of 512-bit bitstrings, partitioned as sixteen 32-bit words. Can we exhibit collisions, or second-preimages (with implies the former), for the ChaCha **core**? Note: the question is _not_ about ChaCha (a s...
Daniel J. Bernstein's [ChaCha][1] core is an evolution of the [Salsa20][2] core. Both are functions over the set of 512-bit bitstrings, partitioned as sixteen 32-bit words. Can we exhibit collisions, or second-preimages (with implies the former), for the ChaCha **core**? Note: the question is _not_ about ChaCha (a s...
This question is rather simple. I've recently read the paper ["Automated Analysis and Synthesis of Authenticated Encryption Schemes"][1]. On page 17 of this paper the authors provide three figures of encryption modes for *tweakable* block ciphers. However all I can see is that the box representing the block ciph...
How to read the AE figures?
This question is rather simple. I've recently read the paper <br> ["Automated Analysis and Synthesis of Authenticated Encryption Schemes"][1]. On page 17 of this paper the authors provide three figures of encryption modes for <br> *tweakable* block ciphers. However all I can see is that the box representing ...
How can I read the AE figures?
Definition 1 on Page 7 of [“An Efficient System for Non-transferable Anonymous Credentials with Optional Anonymity Revocation”][1] by Camenisch and Lysyanskaya, uses the term *“simulator”* in defining the security of a cryptographic credential system, which I'm finding a little confusing. In particular, the sentence...
I have read about the speed performance of AES_128_GCM on specific processors Intel and AMD that support AES New Instruction set. As compared with CMAC and HMAC is it relatively slow for other processors such as ARM9 board or cryptographic hardware?
After collecting approximately 2^n/2 message-tag pairs a collision can be observed. So two different messages (**m1** and **m2**) will have the same tag. [This paper][1] states: > Then, for any string **x**, (**m1**,**x**) and (**m2**,**x**) have the same tags (with high probability in the case of HMAC, and with...
What are the implications of a birthday attack on a HMAC?
After collecting approximately $2^{n/2}$ message-tag pairs a collision can be observed. So two different messages (**m1** and **m2**) will have the same tag. [This paper][1] states: > Then, for any string **x**, (**m1**,**x**) and (**m2**,**x**) have the same tags (with high probability in the case of HMAC, and ...
>Does this mean that it is possible to attach any string x on m1 and the tag of it will be the same as the tag for x attached to m2? Yes. If using HMAC, then with high probability, the tag on (m1, x) will be the same as the tag on (m2, x). With CMAC, the attack works with probability 1. >If my assumption is true ...
This is like stating that $H(C_1|m_1|x|C_2) = H(C_1|m_2|x|C_2)$ if $H(C_1|m_1|C_2) = H(C_1|m_2|C_2)$ for HMAC. That is probably correct **if** $H$ is a hash function based on [Merkle–Damgård construction](https://en.wikipedia.org/wiki/Merkle%E2%80%93Damg%C3%A5rd_construction) **and if** $m_1$ and $m_2$ end on block ...
This is like stating that $H(C_1|m_1|x|C_2) = H(C_1|m_2|x|C_2)$ if $H(C_1|m_1|C_2) = H(C_1|m_2|C_2)$ for HMAC. That is probably correct **if** $H$ is a hash function based on [Merkle–Damgård construction](https://en.wikipedia.org/wiki/Merkle%E2%80%93Damg%C3%A5rd_construction) (such as SHA-1 and SHA-2) **and if** $m_...
I was wondering how decryption would work for FPE in the case of cycled Feistel ciphers. I understand that simply reiterating through the networks with reversed key order will generate the ciphertext inputted at the beginning of the network. The ciphertext is a bit representation of some number, so I'm just expandin...
In Montgomery reduction, when calculating $a \times b \mod N$, it is required that $a \lt N$ and $b \lt N$. I think $0 \le T \lt N \times R$ is enough for the Montgomery Reduction. Rationale: Let $a' = a \times R \mod N$, let $b' = b \times R \mod N$, and let $T = a' \times b'$. Then $T \times R^{-1} ...
Why should $a,b < N$ for Montgomery Reduction?
This is like stating that $H(C_1|m_1|x|C_2) = H(C_1|m_2|x|C_2)$ if $H(C_1|m_1|C_2) = H(C_1|m_2|C_2)$ for HMAC. That is probably correct **if** $H$ is a hash function based on [Merkle–Damgård construction](https://en.wikipedia.org/wiki/Merkle%E2%80%93Damg%C3%A5rd_construction) (such as SHA-1 and SHA-2) **and if** $m_...
>Does this mean that it is possible to attach any string x on m1 and the tag of it will be the same as the tag for x attached to m2? Yes. If using HMAC, then with high probability, the tag on (m1, x) will be the same as the tag on (m2, x). With CMAC, the attack works with probability 1. >If my assumption is true ...
This is like stating that $H(C_1|m_1|x|C_2) = H(C_1|m_2|x|C_2)$ if $H(C_1|m_1|C_2) = H(C_1|m_2|C_2)$ for HMAC. That is probably correct **if** $H$ is a hash function based on [Merkle–Damgård construction](https://en.wikipedia.org/wiki/Merkle%E2%80%93Damg%C3%A5rd_construction) (such as SHA-1 and SHA-2) **and if** $m_...
I am currently learning about RSA since I didn't understand the public-key-system but now I am... kind of. So I am writing the numbers as follows: p and q = prime numbers N = Public Key (p*q) Z = Phi(N) E = Public exponent D = Private key Now, to calculate D, the private key, you need the following fo...
What is k in RSA?
I have to generate a password (In Python and following current good practices) from a hash in SHA512. How can I do ? And what about security aspects concerning the password generation and the generated password ?
How to generate a good password from a SHA512 hash?