instruction
stringlengths
15
30k
SHA-256: (Probabilistic?) partial pre-image possible?
Crashplan uses 448-bit Blowfish to encrypt the data you send them. The mode used is CBC, keys are multiple use, and IVs are generated with SecureRandom from JCE. Keys are not derived from the password, but are generated randomly. MACs used are MD5 or SHA1. The more I do research on Blowfish the more it sounds like t...
Given a check digit calculated using [mod 11](http://www.pgrocer.net/Cis51/mod11.html), of an encrypted numeric sequence of 8 digits, how much information can be known about the plaintext? More specifically, a single 3DES encrypted CBC block for which the check digit of the plaintext is known, would reduce by what f...
While learning about RSA, I found [this example problem][1]. The answer is supposed to be "a 4-digit number that is a pattern of digits." I have computed it to be 16657 twice. > OK, now to see if you understand the RSA decryption algorithm, suppose you are person A, and you have chosen as your two primes $p = 97$ an...
Such a block cipher would be completely unusable in any of the standard modes of operation, presuming you want at least IND-CPA security. Say, for instance, that you are using it in CTR mode. A chosen plain text adversary looking at a cipher text consisting of only two blocks (i.e. 2 times 32 bits), would have a non-ne...
I'm playing around with an application for secure email-like communication and I want to pad the messages so they always have a consistent size before encrypting with AES CBC. I would like to do [PKCS7][1] style padding, because it's easy to figure out how much to strip from the decrypted output, but how would you d...
I'm playing around with an application for secure email-like communication and I want to perform length hiding padding on the plaintext messages so they always have a consistent size before encrypting with AES. I would like to do [PKCS7][1] style padding (if possible), because it's easy to figure out how much to str...
Consider a block cipher with a key of size 128 bits but a small block size, say 32 bits. Is this kind of block cipher secure?
In the last couple weeks I've become pretty well-acquainted with the recent work in this area. I also built a prototype order-preserving encryption scheme following the algorithms presented in 'Order-preserving Symmetric Encryption' by Boldyreva et al. I'll take a stab at explaining the method I just implemented, which...
Consider a block cipher with a key of size 128 bits but a small block size, say 32 bits. Is this kind of block cipher secure? I would like to know to what extent I can use a small block cipher, like a 32 bit block cipher. What are the constraints so that the use is acceptable in a real life application. For inst...
Such a block cipher would be completely unusable in any of the standard modes of operation, presuming you want at least IND-CPA security. Say, for instance, that you are using it in CTR mode. A chosen plain text adversary looking at a cipher text consisting of only two blocks (i.e. 2 times 32 bits), would have a non-ne...
Such a block cipher would be completely unusable in any of the standard modes of operation, presuming you want at least IND-CPA security. Say, for instance, that you are using it in CTR mode. A chosen plain text adversary looking at a cipher text consisting of only two blocks (i.e. 2 times 32 bits), would have a non-ne...
From [PKCS#5][1] v2.1, 4.1 Salt (page 6, emphasis by me), also in [v2.0, RFC 2898][2]: > In password-based encryption, the party encrypting a message can > gain assurance that these benefits are realized simply by selecting > a large and sufficiently random salt when deriving an encryption > key from ...
How does the possible attack on passwords and salts mentioned in PKCS#5 v2.1 work?
While learning about RSA, I found [this example problem][1]. The answer is supposed to be "a 4-digit number that is a pattern of digits." I have computed it to be 16657 twice. > OK, now to see if you understand the RSA decryption algorithm, suppose you are person A, and you have chosen as your two primes $p = 97$ an...
How is key rotation defined?
currently I audit some code I've written in the past to use KeePass 1.x databases. I stumbled over the following question: The database itself is decrypted with AES-CBC and inside the file header the IV is stored in plain text. Is this a security hole? Following [this](https://en.wikipedia.org/wiki/Block_cipher_mode...
Using AES-CBC and providing the IV in file header -> security hole?
As hunter said in his comment, IVs are not required to be secret. Recall that the purpose of an IV is to make an otherwise deterministic construction instead be non-deterministic; if this were not the case, then these constructions would no longer have indistinguishable encryptions under chosen-plaintext attacks, and t...
In [proxy re-encryption][1] schemes, a proxy is given special information that allows it to translate a ciphertext under one key into a ciphertext of the same message under a different key. How practical is PRE?. Is it possible for achieving PRE for AES ? [1]: http://en.wikipedia.org/wiki/Proxy_re-encrypt...
It is always underlined that a great care must be considered when building a composed AE mode from input independent encryption & MAC/Authentication modes instead of using existing "ready-to-use" dedicated AEAD modes (GCM, OCB, CCM, EAX, etc ..). As example I read with great attention very interesting answer from ...
How to build a secure AE scheme with generic composition?
"Largest Known Prime Number Discovered; Has 17,425,170 Digits" http://www.sciencedaily.com/releases/2013/02/130213225424.htm If we can find prime numbers larger than 17 milion digits, why can't we find all 1024bit (just 309 decimal digits) primes?
If we can find prime numbers larger than 17 milion digits, why can't we find all 1024bit primes?
Refering the NIST document about PBKDF2: NIST Special Publication 800-132 Recommendation for Password-Based Key Derivation Part 1: Storage Applications Page 8 and 9 5.4 Using the Derived Master Key to Protect Data https://i.stack.imgur.com/6MXJL.png I am using the Option 1b: Generate Master Key (MK) first, a...
Too many Data Protection Key derived from Master Key that is derived from PBKDF2, will it cause the Master Key to be easily cracked?
Refering the NIST document about PBKDF2: NIST Special Publication 800-132 Recommendation for Password-Based Key Derivation Part 1: Storage Applications Page 8 and 9 5.4 Using the Derived Master Key to Protect Data https://i.stack.imgur.com/6MXJL.png I am using the Option 1b: Generate Master Key (MK) first, a...
I am actually looking for using a secure Encrypt-Then-MAC AE scheme , and consider using either an existing "ready-to-use" dedicated AEAD mode (GCM, OCB, CCM, EAX, etc ..) or an alternate composed CTR-Then-CMAC scheme (mainly in order to avoid apparent fragility of GHASH as to limit impacts of accidental IV reuse) M...
I am actually looking for using a secure Encrypt-Then-MAC AE scheme , and consider using either an existing "ready-to-use" dedicated AEAD mode (GCM, OCB, CCM, EAX, etc ..) or an alternate composed CTR-Then-CMAC scheme (mainly in order to avoid apparent fragility of GHASH as to limit impacts of accidental IV reuse with ...
The scheme you've described is essentially [EAX][1] mode, which combines a block cipher in CTR mode with a CMAC using a single master key - except that EAX is explicit about the derivation of the cipher and MAC keys from the master key, and comes with a formal proof of security for that derivation (and the entire mode)...
I don't understand the 'Wiedemann algorithm' works. Can someone explain the factoring of the RSA-704 in an easy way? http://maths-people.anu.edu.au/~bai/paper/rsa704.pdf
How do they primefactor RSA?
I see sometimes signatures schemes with appendix. This is about signatures schemes in which the message is needed in the verification algorithm, that is, the ouput of the signature algorithm is of the form $(M,s)$ The appendix is referred to the message or the signature ? Thank you.
I'm doing some self-teaching / research for my own benefit in homomorphic cryptography. I've studied both additive and multiplicative schemes (Pallier and RSA respectively), but all I can seem to find are benefits for the schemes. Are there any disadvantages to these schemes being used for homomorphic operations ...
What are some disadvantages of homomorphic encryption schemes?
Such a block cipher would be completely unusable in any of the standard modes of operation, presuming you want at least IND-CPA security. Say, for instance, that you are using it in CTR mode. A chosen plain text adversary looking at a cipher text consisting of only two blocks (i.e. 2 times 32 bits), would have a non-ne...
My question is How I will be able to count digital signature Scheme that can sign many documents with one private key. There are signature scheme as long as exists private keys in the keys spaces? or There are signature scheme as long as exists methods than RSA, DSA, ECDSA, Hash-Based signature schemes, etc? I am doing...
I don't understand the 'Wiedemann algorithm' works. Can someone explain the [factoring of RSA-704][1] in an easy way? [1]: http://maths-people.anu.edu.au/~bai/paper/rsa704.pdf
How did they primefactor RSA-704?
I'm referring the NIST document about PBKDF2, [NIST Special Publication 800-132, Recommendation for Password-Based Key Derivation][1], Part 1: Storage Applications, Page 8 and 9, section 5.4 *Using the Derived Master Key to Protect Data*. Here is Figure 3 from this document: ![enter image description here][2] ...
Is a PBKDF2-derived master key easier cracked if very many Data Protection Keys are derived from it?
Using [node.js crypto library](http://nodejs.org/api/crypto.html#crypto_crypto_randombytes_size_callback) I can generate cryptographically strong bytes. How can I use this to generate a random number between 0 and 9999 (both inclusive)?
The multiplicatively homomorphic variant of RSA is not [semantically secure][1]. This is a major disadvantage. ElGamal is a semantically secure, multiplicativey homomorphic cipher. Paillier is a semantically secure, additively homomorphic cipher. As described by tylo, all homomorphic ciphers are malleable by definit...
I'm doing some self-teaching / research for my own benefit in homomorphic cryptography. I've studied both additive and multiplicative schemes (Pallier and RSA respectively), but all I can seem to find are benefits for the schemes. Are there any disadvantages to these schemes being used for homomorphic operations ...
The set of points of an elliptic curve over a finite field is isomorphic to the direct product of two cyclic groups (i.e. $E(F_{q}) \cong Z_{s} \times Z_{t})$. What is the advantage of representing or conceiving the group as an Elliptic Curve instead of as a product of cyclic groups?
Why are elliptic curves better than cyclic groups?
Answering your three questions in order: > "If I have a lot (more than $2^{32}$) of files to be encrypted, each file is encrypted using newly generated DPK. Will it somehow cause the MK to be easily found? or easier to find?" It's not going to make it _harder_. But no, as long as the KDF you're using lives up to...
The entire reason for using Elliptic Curves for cryptography is that they make some operations easy (e.g. "given an integer $n$ and a point $G$, compute the point $nG$), while other operations are difficult (e.g. given two points $G$ and $nG$, give me the integer $n$); the security of Elliptic Curve Cryptography depend...
I'm trying to explain the concept of 1-out-of-2 oblivious transfer to folks who haven't seen this idea before. I can explain what properties it provides, but it's also helpful if I can show a simple protocol for 1-out-of-2 OT, to give people a feeling that this is achievable. What's a simple protocol for 1-out-of-2...
I'm looking to do file encryption of a bunch of individual files, some small, some quite large. The files will be write-once/read-many, so I could use CBC, however, since the read-access needs to have seekability, XTS seems a better fit. One issue, as I understand it, is that XTS (or CBC for that matter) is malleable...
Non-malleable file encryption using AES XTS 256?
Let's say I have an unknown string with the known sha256-hash of it. I was wondering if it was possible to now calculate the sha256 of the concatenation of the unknown string and "abc". (In PHP: `hash('sha256', $unknownString .'abc');`) I thought in order to do so "all I need" is to go from the hash that I know b...
Is it possible to derive the midstate of a sha256 hash?
In an old cryptography FAQ [see 1], I found the following step described for determining a the length of the key a cipher was repeatedly XORed against: >1. Discover the length of the key by counting coincidences. (See Gaines [GAI44], Sinkov [SIN66].) **Trying each displacement of the ciphertext against itself,...
Best Asymmetric Encryption Standard for Communications?
As far as I can tell most one-way hashes apply some iterated encryption algorithm to the input data. What would be the issues with a one-way hash based on some fixed large prime p and a generator g with h(x) = g^x mod p? Is it just that the methods used for modern hashes are even harder than the discrete logarithm?
In the last couple weeks I've become pretty well-acquainted with the recent work in this area. I also built a prototype order-preserving encryption scheme following the algorithms presented in 'Order-preserving Symmetric Encryption' by Boldyreva et al. I'll take a stab at explaining the method I just implemented, which...
In an [old cryptography FAQ][1], I found the following step described for determining a the length of the key a cipher was repeatedly XORed against: >1. Discover the length of the key by counting coincidences. (See Gaines [GAI44], Sinkov [SIN66].) **Trying each displacement of the ciphertext against itself,** ...
There's one thing that I've never quite understood about SSL (which perhaps means I don't understand SSL at all): how is SSL secure from rogue Certificate Authorities? This is probably best elaborated as an example: Suppose company B buys a certificate C from certificate authority A. Now, normally I would go t...
How is SSL secure from rogue Certificate Authorities?
The multiplicatively homomorphic variant of RSA is not [semantically secure][1]. This is a major disadvantage. ElGamal is a semantically secure, multiplicativey homomorphic cipher. Paillier is a semantically secure, additively homomorphic cipher. As described by tylo, all homomorphic ciphers are malleable by definit...
For a stream of packets, where each packet is individually encrypted with a block cipher, it's desirable to have each encrypted packet only valid for that position in the stream. A message number would work, but there are many different ways of implementing it. Given a construct using HMAC for integrity check (i....
Your first assumption is not entirely correct. They are not isomorphic to the direct product of two cyclic groups but rather a subset of all points in $\mathbb{Z}_q^2$, which fulfill a certain equation. Elliptic curves over $\mathbb{C}$ are closely related to the torus (genus 1 curve). Since the addition and multiplica...
I'm looking to do file encryption of a bunch of individual files, some small, some quite large. The files will be write-once/read-many, so I could use CBC, however, since the read-access needs to have seekability, XTS seems a better fit. One issue, as I understand it, is that XTS (or CBC for that matter) is malleable...
I'm looking to do file encryption of a bunch of individual files, some small, some quite large. The files will be write-once/read-many, so I could use CBC, however, since the read-access needs to have seekability, XTS seems a better fit. One issue, as I understand it, is that XTS (or CBC for that matter) is malleable...
What is the probability of two RSA public keys to be the same? Take 2048 bit key as an example, the number seems to be huge, but the choice for p and q is much more restrictive - they both should be 1024 bit in size, not to close to sqrt(p*q) but still the MSB should remain set. Even if 2^1023 seems like a lot of numbe...
The question as worded is: assume that we generate $k=2$ RSA public keys of $n=2048$ bits, with prime factors random in range $[2^{(n-1)/2}\dots2^{n/2}]$, and public exponent $e=2^{16}+1$; what are the odds that any two of the $k$ public keys are the same? Applying the [Prime Number Theorem][1], there are about $$v=...
I am actually checking use of EAX as evantual alternate (two-pass & patent-free) mode to GCM . After EAX spec review (scheme definition for my part), I noted following questions - main question : what about A/E keys derivation ?- In described scheme the same input key K appears used on all OMAC (authentication) &...
What about key derivation with EAX?
The question worded is equivalent to: assume that we generate $k=2$ RSA public keys of $n=2048$ bits, with prime factors random in range $[2^{(n-1)/2}\dots2^{n/2}]$, and public exponent $e=2^{16}+1$; what are the odds that any two of the $k$ public keys are the same? Applying the [Prime Number Theorem][1], and consi...
I am actually checking use of EAX as eventual alternative to GCM . After EAX spec review (scheme definition for my part), I noted following questions - main question : what about A/E keys derivation ?- In described scheme the same input key K appears used on all OMAC (authentication) & CTR functions. I probably m...
1. What is the probability that two separate RSA public moduli are the same? For example, consider a 2048-bit modulus. The number seems to be huge, but the choice for prime factors p and q is much more restrictive: They both should be 1024-bit in size, not too close to $\sqrt{p*q}$ and the [most significant bit][1] sho...
On point 1: the question worded, reduced to common practice, is equivalent to: assume that we generate $k=2$ RSA public keys of $n=2048$ bits, with prime factors random in range $[2^{(n-1)/2}\dots2^{n/2}]$, and public exponent $e=2^{16}+1$; what are the odds that any two of the $k$ public keys are the same? Note: we ca...
On point 1: the question worded, reduced to common practice, is equivalent to: assume that we generate $k=2$ RSA public keys of $n=2048$ bits, with prime factors random in range $[2^{(n-1)/2}\dots2^{n/2}]$, and public exponent $e=2^{16}+1$; what are the odds that any two of the $k$ public keys are the same? Note: we ca...
On point 1: the question worded, reduced to common practice, is equivalent to: assume that we generate $k=2$ RSA public keys of $n=2048$ bits, with prime factors random in range $[2^{(n-1)/2}\dots2^{n/2}]$, and public exponent $e=2^{16}+1$; what are the odds that any two of the $k$ public keys are the same? Note: we ca...
I am trying to learn cryptanalysis on [Keccak](http://keccak.noekeon.org/) hash function. One of the papers on [zero sum distinguishers](https://131002.net/data/papers/AM09.pdf) talks about Keccak having inverse degree of 3. I am unable to figure out, how do you get an inverse degree of 3? For example one of the per...
How do you find inverse degree of hash function?
How long should TLS crypto exponents be during the symmetric key exchange process?
How long are TLS crypto exponents?
The set of points of an elliptic curve over a finite field is isomorphic to the direct product of two cyclic groups (i.e. $E(F_{p^n}) \cong Z_{s} \times Z_{t})$. What is the advantage of representing or conceiving the group as an Elliptic Curve instead of as a product of cyclic groups?
On point 1: the question worded, reduced to common practice, is equivalent to: assume that we generate $k=2$ RSA public keys with public modulii $N$ of $n=2048$ bits, with prime factors $p$, $q$ random in range $[2^{(n-1)/2}\dots2^{n/2}]$, and public exponent $e=2^{16}+1$; what are the odds that any two of the $k$ publ...
I am actually checking use of EAX AEAD mode , and following EAX spec review (scheme definition for my part), I noted following questions - main question : what about A/E keys derivation ?- In the described scheme the same input key K appears used on all OMAC (authentication) & CTR functions. I probably missed some...
I am actually checking use of EAX AEAD mode , and following EAX spec review (scheme definition for my part), and my main question is : what about A/E keys derivation ? - In the described scheme the same input key K appears used on all OMAC (authentication) & CTR functions. Did I miss something important as it would...
http://i.imgur.com/drD4Tj0.png What is meant by the notation a (subscript a), p (subscript a), and what is meant by a 'primitive element', does it mean a small number or something else entirely? Thanks, Cameron.
What is meant by this notation in the ElGamal key generation process?
The scheme you've described is essentially [EAX][1] mode, which combines a block cipher in CTR mode with a CMAC using a single master key - except that EAX is explicit about the use of the master key for the cipher and MAC, and comes with a formal proof of security for that usage (and the entire mode). Given that EA...
I am actually checking use of EAX AEAD mode, and following EAX spec review (scheme definition for my part),my main question is : what about A/E keys derivation ? - in the described scheme the same input key K appears used on all OMAC (authentication) & CTR functions. Did I miss something important as it wo...
I am actually checking use of EAX AEAD mode, and following EAX spec review (scheme definition for my part), my question is: what about the derivation of the authentication and encryption keys? In the described scheme the same input key $K$ appears used on all OMAC (authentication) & CTR functions. Did I miss somet...
Does EAX use the same keys for encryption and authentication?
> Alice chooses > i) A large prime $p_A$ (say 200 to 300 digits) > ii) A primitive element $\alpha_A$ modulo $p_A$, > iii) A (possibly random) integer $d_A$ with $2 \le d_A \le p_A-2$. > Alice computes > iv) $\beta_A \equiv \alpha_A^{d_A} \pmod {p_A}$. > Alice's *public key* is **$(p_A,\alpha_A,\beta_...
I am trying to learn cryptanalysis on the [Keccak](http://keccak.noekeon.org/) hash function. One of the papers on [zero sum distinguishers](https://131002.net/data/papers/AM09.pdf) talks about Keccak having inverse degree of 3. I am unable to figure this out: how do you get an inverse degree of 3? For example one o...
How do you find the inverse degree of a hash function?
In an [old cryptography FAQ][1], I found the following step described for determining a the length of the key a cipher was repeatedly XORed against: >1. Discover the length of the key by counting coincidences. (See Gaines [GAI44], Sinkov [SIN66].) **Trying each displacement of the ciphertext against itself,** ...
My correspondents and I would like to communicate privately by email. We used to employ PGP but that might have been shooting ourselves in the foot. PGP doesn't have forward secrecy. If any of our private keys are ever compromised (by law, hacking, or rubber hose), then all our past conversations can be immediately dec...
How to communicate by email with forward secrecy and deniability?
I'm using TLS with a Diffie-Hellman key exchange to negotiate the symmetric keys. How long should the exponents be?
What should the size of the private exponents in Diffie-Hellman key exchange for TLS be?
I am curious of the details of how one would go about generating elliptic curve parameters. (I know standardized parameters exist, but I'm trying to understand both how they were generated and the general case.) Let's also assume we want to work in a prime-order subgroup of size $O(2^n)$. For simplicity, let's work...
I've recently heard some people claiming that if the fact that P = NP is proven, most (all?) the current cryptographic algorithm considered secure like RSA will be unusable in secure systems. My question is : **1.** If P = NP is proven TODAY, will a RSA key (let say 3072 bits) be still enough to ensure a certain ...
[It is being speculated][1] that one of the ways that NSA leaker Edward Snowden may have created his "insurance policy"--distributing sensitive documents to various individuals with instructions to disseminate them should anything happen to him--is through the use of a partial key escrow. The concept is described v...