instruction
stringlengths
15
30k
First let's very precisely look at a tweakless blockcipher to fully understand it: ###A regular blockcipher $E_k(x)$ with blocksize $n$ and key size $k$ is a permutation of the input block. What do I mean with that? Let's first tackle the word _permutation_ here. Often a permutation means re-arranging elements w...
You cannot recover the password from the hash. That's not something that password hashes are designed for — quite the opposite: with a proper password hash, the only way to recover the password given the hash is to make a guess and verify it — and the better the hashing scheme, the more costly verifying guesses is. ...
recently T.Gowers wrote a [blog](http://gowers.wordpress.com/2013/10/03/how-not-to-prove-that-p-is-not-equal-to-np/) on the Razborov/Rudich Natural Proofs paper. he has a construction where he talks about compositions of 3-bit scramblers along with a paper on the subject. Boaz Barak replied in comments: >Some other ...
Recently, T.Gowers wrote a blog entry called ["How not to prove that P is not equal to NP"](http://gowers.wordpress.com/2013/10/03/how-not-to-prove-that-p-is-not-equal-to-np/) about the Razborov/Rudich Natural Proofs paper. He has a construction where he talks about compositions of 3-bit scramblers along with a paper o...
I understand that if we have a secure PRG then the Goldreich-Goldwasser-Micali construction gives us a secure PRF. However, what I've not been able to work out or find much material on is how will the GGM construction fairs when the PRG is less than perfect. Suppose we used AES-128 in CTR mode as the PRG to gener...
I understand that if we have a secure PRG then the Goldreich-Goldwasser-Micali construction gives us a secure PRF. However, what I've not been able to work out or find much material on is how will the GGM construction fairs when the PRG is less than perfect. Suppose we used AES-128 in CTR mode as the PRG to gener...
In the [BLAKE2 paper](https://blake2.net/blake2_20130129.pdf), the authors define > * **Maximal depth** (1 byte): an integer in [1, 255] (set to 255 if unlimited, and to 1 only in sequential mode) > * **Node depth** (1 byte): an integer in [0, 255] (set to 0 for the leaves, or in sequential mode) Node depth is ...
In the [BLAKE2 paper](https://blake2.net/blake2_20130129.pdf), the authors define > * **Maximal depth** (1 byte): an integer in [1, 255] (set to 255 if unlimited, and to 1 only in sequential mode) > * **Node depth** (1 byte): an integer in [0, 255] (set to 0 for the leaves, or in sequential mode) Node depth is ...
I understand that if we have a secure PRG then the Goldreich-Goldwasser-Micali construction gives us a secure PRF. However, what I've not been able to work out or find much material on is how will the GGM construction fairs when the PRG is less than perfect. Suppose we used AES-128 in CTR mode as the PRG to gener...
I understand that if we have a secure PRG then the Goldreich-Goldwasser-Micali construction gives us a secure PRF. However, what I've not been able to find much material on is how will the GGM construction fairs when the PRG is less than perfect. Suppose we used AES-128 in CTR mode as the PRG to generate 256-bits...
There are a couple of related concepts here: Tweakable blockciphers and format-preserving encryption (FPE). It turns out that tweakable blockciphers provide a very natural way of obtaining FPE, but they have other uses as well. As the blog discusses, sometimes we want, say, encrypted credit card numbers to themselve...
There are a couple of related concepts here: Tweakable blockciphers and format-preserving encryption (FPE). It turns out that tweakable blockciphers provide a very natural way of obtaining FPE, but they have other uses as well. As the blog discusses, sometimes we want, say, encrypted credit card numbers to themselve...
Are there any realties tests or criterias that prove the security of the PRNG? What kind of tests or criteria?
How to prove the security of the PRNG?
We currently have no way to prove that a specific PRNG is cryptographically secure. In fact, we currently cannot prove that there exists a cryptographically secure PRNG (!). If you scale back the requirement from "mathematical proof" to "something we generally accept", there's still no way for an automated test to ...
Currently I am having a doubt, while making a DES PCBC encryption on an image I observe a bit of the silouette of the image (Probably because of the XOR between plaintext blocks and Ciphertext ones on the algorithm). That happens if I put IV and Key on zeros, however, if I change only the Key (key in HEX values) the si...
The verification algorithm given in blind signature. Should it work for both i)Original message and the signature on it ii)Blinded message and the signature on it. If yes, then how can we verify if the verification algorithm takes in a parameter which is computed during unblinding stage??
Without taking into account security, which hash function is the fastest one among the following: MD5, SHA-1, SHA-2 (for various internal size), Keccak, and other... ? Thank you
For a blind signature scheme you require the blindness and the unforgeability properties to hold to call it secure. For your question the latter is of interest. Unforgeability here essentially says that if an adversary queries signatures for $n$ messages $m_1,\ldots,m_n$, then the adversary must not be able to effic...
Alice has two EC key pairs. a1, a2 are private keys (integers), A1, A2 are public keys (points). Alice and Bob want to create new public key C. Alice must prove that this key C was created from exactly A1 and A2, i.e. Alice did not use other key pairs for C. New public key C would be used for ECDSA. Private key c is cr...
Imagine a website where people log in with their password. The password is now stored in sql database as: md5(password + random_salt) We are adding possibility to stay logged in and I am trying to find out the best way to do it. What I would like: - Passwords stay stored in the DB as hashes using some has...
If I encrypt a file of a known format that has a lengthy header (e.g. an XML Excel file), does that render the encrypted file susceptible to a "known plain text" attack? In other words, if the first X bytes of the decrypted text are known, does that weaken the encryption for the remaining data?
Alice has two EC key pairs: $a_1$, $a_2$ are private keys (integers), $A_1$, $A_2$ are the corresponding public keys (points). Alice and Bob want to create a new public key $C$. Alice must prove that this key $C$ was created from exactly $A_1$ and $A_2$, i.e. Alice did not use other key pairs for $C$. The new public ke...
Let $g$ be a generator of a multiplicative group $G$ of order $q$, $x$ be a private key, and $h=g^x$ be a public key of an exponential ElGamal cryptosystem. Given a ciphertext $c$ produced as the ElGamal encryption of a given plaintext $m$, that is $Enc(m,h,r)=(g^r, g^m h^r)=(R,S)=c$, it is obvious that this ciphert...
I think there are two issues involved here: 1. How do you tell if a ciphertext has the properties of a truly random stream? 2. How do you tell if a stream actually ***is*** truly random? For the first part, there are many statistical techniques. But the basic question is whether there is any detectable relatio...
Currently I am having a doubt, while making a "DES PCBC" encryption on an image I observe a bit of the silhouette of the image (Probably because of the XOR between plaintext blocks and ciphertext ones on the algorithm). That happens if I set IV and Key to 0. However, if I change just the key (key in HEX values), th...
If $(G,q)$ are public authentic parameters and Alice publishes $(h,R,S)$, then if Alice later publishes $r$, Bob needs to check if $g^r=R$, which fixes $r$. Consequently, when computing $\log_g S/h^r$ also fixes $h$ and the exponent of $S$ is fixed. Changing $m$ to $m'$ would require to solve $m+rx\equiv m'+r'x \pmod{q...
I'm trying to evaluate the correlation between key length and the number of messages that needs to be send to server during Cache timing Attack. I read both D. Bernstein, “Cache-timing attacks on AES,” April 2005. Department of Mathematics, Statistics, and Computer Science University of Illinois at Chicago. Robert...
Assume a website where people log in with their password. The password is now stored in sql database as: md5(password + random_salt) We are adding the possibility for clients to stay logged in and I am trying to find out the best way to do that. - Passwords should stay stored in the DB as hashes using ...
What mathematical fields of knowledge would be required in order to get a good understanding of encryption algorithms? Is it basic algebra, or is there a "higher education" mathematical field dedicated to encryption? I know there is the cryptography field, but what is the subset of knowledge required for cryptograp...
I asked this question [Will our app be FIPS 140-2 compliant if we use our own AES algorithm implementation][1] here before, although there are some different thoughts about this, however general consensus is that our application should be FIPS 140-2 compliant if we use FIPS certified library. We are using the AES a...
I asked this question [Will our app be FIPS 140-2 compliant if we use our own AES algorithm implementation][1] here before, although there are some different thoughts about this, however general consensus is that our application should be FIPS 140-2 compliant if we use FIPS certified library. We are using the AES a...
I asked this question [Will our app be FIPS 140-2 compliant if we use our own AES algorithm implementation][1] here before, although there are some different thoughts about this, however general consensus is that our application should be FIPS 140-2 compliant if we use FIPS certified library. We are using the AES a...
I wrote a basic function to test the speed of the AES-256-CBC mode of the Node.js built-in crypto functions. These functions use OpenSSL, so they should support AES-NI, but when I correctly enable AES-NI and do a command-line test of OpenSSL the encryption speed is ~350MB/s on OpenSSL and only ~100MB/s on Node.js Cryp...
How do I enable AES-NI (hardware acceleration) for Node.js crypto on Linux?
I recently discovered the Curve25519 key exchange lib and the Ed25519 signature lib. Due to the speculations about NIST-designed curves, there is a chance that I ditch them and use the curves above instead. My question is : if I take the curve parameters from these two libs and use them in ECDH/ECIES and ECDSA respe...
Ed25519 parameters to ECDSA. Is it safe?
Is using Ed25519 parameters in ECDSA safe?
Consider the One-Time Pad (OTP). Suppose two parties, A and B, generate a completely random secret key in a real-life meeting, and they keep this secret. Now A wants to send some message to B using the OTP. The point is that in the OTP we can use any key only once. So we have to come up with a system to share a new...
I asked this question [Will our app be FIPS 140-2 compliant if we use our own AES algorithm implementation][1] here before and although there are some different thoughts about this, the general consensus seems to be that our application should be FIPS 140-2 compliant if we use a FIPS certified library. We are using...
Do we have to use an IV for AES encryption to be FIPS 140-2 compliant?
>In cryptography, the Fluhrer, Mantin and Shamir attack is a particular stream cipher attack, a dedicated form of cryptanalysis for attacking the widely-used stream cipher RC4. The attack allows an attacker to recover the key in an RC4 encrypted stream from a large number of messages in that stream. The Fluhrer, Manti...
Which stream cipher can we replace the RC4 in the SSL?
Is there a definied keysize of the `AES_256-CBC` method in PHP? And what is this size? Some background: I want to store encrypted text into a postgresql database. The user who posts the data has a key (stored in db) which gets appended to a generic private key hard coded in the library. $key = $genericKey ...
Is there a definied keysize to be used with the "AES_256-CBC" method in PHP, and what is the size? **Some background:** I want to store encrypted text into a [PostgreSQL](http://www.postgresql.org/) database. The user who posts the data has a key (stored in db) which gets appended to a generic private key hard co...
I found this information which may be useful for you: * [Is encrypting twice good or bad?][1] * http://crypto.stackexchange.com/questions/2314/does-encrypting-twice-using-the-same-block-cipher-produce-a-security-weakness * [Is there any benefit to encrypting twice with pgp?][2] The general rule as far as I know...
Is there a definied keysize to be used with the "AES_256-CBC" method in PHP, and what is the size? **Some background:** I want to store encrypted text into a [PostgreSQL](http://www.postgresql.org/) database. The user who posts the data has a key (stored in db) which gets appended to a generic private key hard co...
Is there a definied keysize to be used with the "AES_256-CBC" method in PHP, and what is the size? **Some background:** I want to store encrypted text into a [PostgreSQL](http://www.postgresql.org/) database. The user who posts the data has a key (stored in db) which gets appended to a generic private key hard co...
The CMVP's twin sister program is the CAVP (Cryptographic Algorithm Validation Program). In order to have your module certified your FIPS Approved algorithms must be tested and validated by a lab and then certified by the CAVP, giving your company a certificate (example: AES #1880). This is the route most companies go ...
You're simply appending the userKey to your "sleutel" (aka key) in this piece of code: $sleutel = $this->sleutel . $this->userKey; Problem is, doing that can result in `$sleutel` lengths beyond the expect 256 bits (32 bytes), or - as you are experiencing - less than the expected 256 bits (32 bytes/characte...
You're simply appending the userKey to your "sleutel" (aka key) in this piece of code: $sleutel = $this->sleutel . $this->userKey; Problem is, doing that can result in `$sleutel` lengths beyond the expect 256 bits (32 bytes), or - as you are experiencing - less than the expected 256 bits (32 bytes/characte...
The CMVP's twin sister program is the CAVP (Cryptographic Algorithm Validation Program). In order to have your module certified your FIPS Approved algorithms must be tested and validated by a lab and then certified by the CAVP, giving your company a certificate (example: AES #1880). This is the route most compan...
I found this information which may be useful for you: * [Is encrypting twice good or bad?][1] * http://crypto.stackexchange.com/questions/2314/does-encrypting-twice-using-the-same-block-cipher-produce-a-security-weakness * [Is there any benefit to encrypting twice with pgp?][2] The general rule as far as I know...
Suppose we consider the space of $\lbrace 0,1 \rbrace^{256}$ as the domain and SHA-256 as our hash function. Does SHA-256 become a one way permutation? Has anyone tried to prove this? Or can it be shown that SHA-256 has more than one cycle under the given constraints?
Is SHA-256 a one way permutation when restricting the domain to {0,1}^256?
I'm study McEliece and Multivariate Public Key cryptographic systems. The main problem here is the huge key size. My question is Is there any restriction to use Lossless compression algorithms for fix this problem?
I'm studing McEliece and Multivariate Public Key cryptographic systems. The main problem here is the huge key size. My question is Is there any restriction to use Lossless compression algorithms for fix this problem?
I'm studing McEliece and Multivariate Public Key cryptographic systems. The main problem here is the huge key size. My question: Is there any restriction to use Lossless compression algorithms for fix this problem?
There's been similar questions before but the answer is probably no with very high probability. You can imagine a hash as being a little box with a dwarf in it. You give him a message and the first thing he does is looks for the message in his book. If he finds it, he gives you the n-bit string he wrote in his book....
Suppose Alice has two primes $p$ and $q$ such that $p\equiv q \equiv 3 \pmod 4$. $n=p\cdot q$ is part of her certificate to identify her. A party say Bob, sends her a random quadratic residue ${}\bmod n$, say $x$. To identify her, Alice computes $y$, a square root of $x$ and send it to Bob. He simply verifies $y^2\equi...
Suppose Alice has two primes $p$ and $q$ such that $p\equiv q \equiv 3 \pmod 4$. $n=p\cdot q$ is part of her certificate to identify her. A party say Bob, sends her a random quadratic residue ${}\bmod n$, say $x$. To identify her, Alice computes $y$, a square root of $x$ and send it to Bob. He simply verifies $y^2\equi...
If you want to store the OTP for MsgB in MsgA then the new length of MsgA = Len(MsgA) + Len(OTP). As Ricky Demer pointed out the pad must be at least as long as the message so the new length is in effect = Len(MsgA) + Len(MsgB). So why not just arrange a OTP of Length = Len(MsgA) + Len(MsgB) and divide it up for the t...
If you've only got an encrypted data channel can you actively sidestep the encryption and communicate with an outside party who can see the data but cannot decrypt it? Yes - if you can find some leaky aspect in the process that's still visible after encryption. Is there a name for this? And is scheme I came acros...
I'm trying to evaluate the correlation between key length and the number of messages that needs to be send to server during Cache timing Attack. I read both D. Bernstein, [“Cache-timing attacks on AES,”](http://cr.yp.to/antiforgery/cachetiming-20050414.pdf) April 2005. Department of Mathematics, Statistics, and Com...
If I follow the [wikipedia][1] or [crypto.stackexchange][2] definition, any simple xor encryption where the key is as long as the plain text should qualify as a secure block cipher. Now I thought what would happen if I just use this together with a block cipher mode of operation? After all, they should build a secure s...
What (precisely) is a block cipher?
I'm reading a paper about MACs, I would like to be sure about the meaning of a security beyond the birthday paradox. Is there a definition ? Thank you.
The NaCl web site says this is a requirement of the API, but its seems more than just an API issue. It means the first 32 bytes of the first salsa20 block are effectively ignored. I didn't see anything in the documentation that explains the reason for this. Does ignoring the first 32 bytes of the first salsa20 block...
Why does NaCl's crypto_secretbox for xsalsa20-poly1305 require the first 32 bytes to be zero?
Foreword -------- [atsec IT security blog][1] recently commented about FIPS and NIST rules with: "As technology moves on, and the pace of change increases, with no real update to the specification for a decade, FIPS 140-2 is creaking badly. To deal with this, the CMVP must issue Implementation Guidance (I.G.), whic...
The [Poly1305-AES](http://cr.yp.to/mac/poly1305-20050329.pdf) paper summarizes the MAC as $$ \mathrm{Poly1305}(m, \mathrm{AES}_k(n)) = {H_r(m) + \mathrm{AES}_k(n)} \mod 2^{128} $$ Can I presume that $+$ here is just meant as a form of 16-byte mixing $H_r(m)$ and $\mathrm{AES}_k(n)$, and that XOR would be equally...
>In cryptography, the Fluhrer, Mantin and Shamir attack is a particular stream cipher attack, a dedicated form of cryptanalysis for attacking the widely-used stream cipher RC4. The attack allows an attacker to recover the key in an RC4 encrypted stream from a large number of messages in that stream. The Fluhrer, Manti...
I am using a KDF to derive a key, `p'` from a password `p`. I would like to know if the password is correct before using the derived key. Bruce Schneier's PasswordSafe [format V3](http://sourceforge.net/p/passwordsafe/git-code/ci/master/tree/docs/formatV3.txt) has > H(P') is SHA-256(P'), and is used to verify th...
Help me understand the following. With WBC the question is mainly being stated as can one try to break WBC to identify the key. My question is why would one ever want to do that anyways? If one can locate the WBC itself it should be enough to enc/dec anything she wants with the embedded key. To me it comes to chicken...
Why to try get key out of white box crypto? How can one protect WBC itself?
Evaluate the speed of the algorithm GCM AES-128 and compare it whith speed of one of the stream chipher in eSTREAM. Can someone give such an assessment?
How much is slower GCM AES-128 than one of the stream chipher eSTREAM?
Help me understand the following. With WBC the question is mainly being stated as can one try to break WBC to identify the key. My question is: *Why would one ever want to do that anyways?* If one can locate the WBC itself it should be enough to enc/dec anything she wants with the embedded key. To me it comes to ch...
I understand that using Grover's algorithm it only requires 2^64 lookups for a 128 bit AES encryption, leading people to say we need to increase to 256 bit keys. But how long would it actually take a quantum computer to do 2^64 lookups? I can't say I fully understand quantum computers, but aren't people making the ...
How long does it take a quantum computer to brute force AES?
If you've only got an encrypted data channel can you actively sidestep the encryption and communicate with an outside party who can see the data but cannot decrypt it? Yes - if you can find some leaky aspect in the process that's still visible after encryption. Is there a name for this? And is scheme I came acros...
Consider the One-Time Pad (OTP). Suppose two parties, *A* and *B*, generate a completely random secret key in a real-life meeting, and they keep this secret. Now *A* wants to send some message to *B* using the OTP. The point is that in the OTP we can use any key only once. So we have to come up with a system to share a...
I'm trying to understand how the AES S-Boxes are constructed. I understand how the multiplicative inverse is calculated over GF(2^8), but I'm confused by the description of the affine transformation. I haven't been able to Google a good explanation of how the S-Box values are calculated. Can someone explain how this wo...
How are the AES S-Boxes constructed?
I'm just reviewing a program someone wrote to provide high quality random data using an entropy collector and a hash based whitening technique. I'll try summarize the process: 1. Collect entropy from sources into separate arrays e.g. - milliseconds between key presses - milliseconds between mouse clicks - mo...
Is this a good entropy collector and whitening technique?
Actually, that wikipedia article you mention in your question already answers your question: > It is moderately common for companies and sometimes even standards bodies as in the case of the CSS encryption on DVDs – to keep the inner workings of a system secret. Some argue this "security by obscurity" makes the pro...
I'm trying to understand how the AES S-Boxes are calculated. I understand how the multiplicative inverse is calculated over GF(2^8), but I'm confused by the description of the affine transformation. I haven't been able to Google a good explanation of how the S-Box values are calculated. Can someone explain how this wor...
How are the AES S-Boxes calculated?
Are any Certification Authorities using 4096 bit keys for their intermediate and root certificates? I know you can, of course, use a 4096 bit key for your server certificate, but I usually see 2048 bit keys from the Certification Authorities, and wonder if any are using 4096 bit keys yet? Thank you.
Are any Certification Authorities using 4096 bit keys for their intermediate and root certificates?
Are any Certificate Authorities using 4096 bit keys for their intermediate and root certificates? I know you can, of course, use a 4096 bit key for your server certificate, but I usually see 2048 bit keys from the Certification Authorities, and wonder if any are using 4096 bit keys yet? Thank you.
Are any Certificate Authorities using 4096 bit keys for their intermediate and root certificates?
I'm reading a paper about MACs and I would like to be sure about the meaning of a security beyond the birthday paradox. Is there a definition?
What is the definition of "security beyond the birthday paradox"?
I understand that using Grover's algorithm it only requires $2^{64}$ lookups for a 128 bit AES encryption, leading people to say we need to increase to 256 bit keys. But how long would it actually take a quantum computer to do $2^{64}$ lookups? I can't say I fully understand quantum computers, but aren't people mak...
I'm taking a cryptography class and I come across these terms dense and sparse key space allt he time. What do they mean? As far as I can I understand, dense key space means that there are more combinations of the keys in that particular space and sparse the opposite. If yes, assuming I use elliptic key cryptography...
Is OTP useful in modern electronic communication?
Reading through the DES Specification it says that the keys are permuted with PC-1 initially and then shifted left both C and D however before it gets permuted again through PC-2 it does not mention how C and D are put together before going through PC-2. Is it assumed that C is the lower half of the input to PC-2 with ...
I was wondering whether it is safe to use the same DH or ECDH key pair in more than one key agreement, particularly if these public keys are in a public registry. These public keys could be used by your counterparts (who also have their public keys in the same registry) to agree on a secret used to send you a message, ...