instruction
stringlengths
15
30k
I was not able to find an explicit statement about the first and second preimage security of SipHash-2-4 or SipHash-4-8 anywhere. I think it should be 64 bits, but I'd feel safer if somebody who has more experience with such hash functions could confirm this? PS: I am aware that 64 bits can be broken, but I only...
Does SipHash have 64 bit (second) preimage security?
Generate a unique 64 bit numeric database key without collisions at $2^{32}$ birthday threshold?
I'm designing a simple one-time-password mechanism for authentication against a possibly-insecure server - i.e. I don't want to use symmetric shared secrets. The first idea that came into mind was using a hash-chain with a cryptographic hash function, where each device has a random $\text{key}$ and broadcasts $H^n...
I'm evaluating different hash algorithms for use in my application. One of the kind of algorithms I am looking at are cryptographically secure ones to protect against DOS attacks. SipHash seems pretty great, but the creators seem very careful to not call it "cryptographically secure". In [the SipHash paper][1] ...
Having plaintext and ciphertext, how can I learn more about key/encryption?
I'm looking for an additive homomorphic encryption that the addition operator (+) in its plaintext space be the same as addition operator in its ciphertext space. (Schemes like Paillier do addition in plaintext space by multiplication in ciphertext space). Does everybody knows such scheme? Thanks
I'm looking for an additive homomorphic encryption that the addition operator (+) in its plaintext space be the same as addition operator in its ciphertext space. (Schemes like Paillier do addition in plaintext space by multiplication in ciphertext space). Does anybody know such a scheme?
I've been required to answer a question: --- As usually, we have Alice and Bob. Suppose Alice wants to send a file F to Bob, ensuring integrity and confidentiality. They share a symmetryc key $K_{ab}$ and use AES. No hash algorithm is available. Alice sends to Bob: $Enc(K_{ab}, F)$ In this simple scheme,...
If I openssl ecparam -list_curves on my OpenSSL version (1.0.1f), it spits out the following supported curves: secp112r1 : SECG/WTLS curve over a 112 bit prime field secp112r2 : SECG curve over a 112 bit prime field secp128r1 : SECG curve over a 128 bit prime field secp128r2 : SE...
I am new to cryptography. I have question regarding the size of the random function. I found text from Introduction to modern cryptography by Katz and Lindell, in other thread which also relates to my question. http://crypto.stackexchange.com/questions/22318/difference-between-pseudorandom-function-vs-randomly-chos...
I am new to cryptography. I have question regarding the size of the set of random functions. I found the text from ["Introduction to modern cryptography" by Katz and Lindell][1], in another thread which also relates to my question: [Difference between Pseudorandom Function vs randomly chosen function][2] The text fr...
Assume we have the following setup: - A client with trusted storage and computing capabilities (e.g. a smartcard) - A server with trusted computing and short-term storage capabilities (e.g. RAM + CPU, possibly with something like [Intel SGX][1]). The server has no trusted long-term storage capabilities. The pr...
Can RSA be securely used for "blind decryption"?
> [...] the only one that is listed (secp256k1) are marked as unsafe. Some of the others are there too. NIST P-224 is the same curve as secp224r1, and similarly for P-256 and P-384. Those are marked unsafe as well. > Assuming we trust djb, are the elliptic curves that are currently supported by this reasonably ne...
I'm working on an embedded device that is connected to a computer over an untrusted channel. According to my threat model I need **authentication and encryption** on the wire **with perfect forward secrecy**. Both endpoints have a pre-shared key and/or each other's authentic public keys, as well as secure random number...
Is there an existing AE protocol with forward secrecy for embedded devices?
It has been explained to me by IT that there is no such thing as totally secure email - but rather a spectrum. If systems are secured via https and SSL what degree of encryption/security are we talking? I read somewhere that SSL is about encryption during transmission - but is thisthe same as having end to end encry...
It has been explained to me by IT that there is no such thing as totally secure email - but rather a spectrum. If systems are secured via https and SSL what degree of encryption/security are we talking? I read somewhere that SSL is about encryption during transmission - but is thisthe same as having end to end encry...
What is matrix branching program?
I'm working on an embedded device that is connected to a computer over an untrusted channel. According to my threat model I need **authentication and encryption** on the wire **with perfect forward secrecy**. Both endpoints have a pre-shared key and/or each other's authentic public keys, as well as secure random number...
Consider we have two fixed values $a,b$ and a uniformly random value $r\leftarrow \mathbb{Z}_p$, for large prime number $p$. I need to know whether $v=a+b\cdot r$ is a uniformly random value in $\mathbb{Z}_p$?
Is $(a+b.r)$ a random value, for fixed $a,b$ and random value $r$?
Consider we have two fixed values $a,b$ and a uniformly random value $r\leftarrow \mathbb{Z}_p$, for large prime number $p$. I need to know whether $v=a+b\cdot r$ is an uniformly random value in $\mathbb{Z}_p$?
Let $p$ be a prime number. Consider two fixed values $a,b$, where $b\neq0$, and a uniformly random value $r\leftarrow \mathbb Z/p\mathbb Z$. Is $v=a+b\cdot r$ a uniformly random value in $\mathbb Z/p\mathbb Z$?
Is $(a+b\cdot r)$ a random value for fixed $a,b$ and random $r$?
If I perform the following command: openssl ecparam -list_curves using my OpenSSL version (1.0.1f), it spits out the following supported curves: secp112r1 : SECG/WTLS curve over a 112 bit prime field secp112r2 : SECG curve over a 112 bit prime field secp128r1 : SECG curve over a 128 bit...
You mention OpenSSH format, so may I assume you can use OpenSSH as part of your solution? If so, how about just using RSA key pairs with an authorized_key file? [Example][1] The server only ever has a public key for each user stored on it (nothing to lose to a server compromise) and the client just does RSA auth...
I have an unchanging set of unique items, and I want my server to show one of those items to a client, then cryptographically prove that the item is part of the set. How I do this currently: 1. Generate a merkle tree containing all of the items 2. Give the client the item, then each branch leading to the merkl...
I've got an academic curiosity regarding some of the old Japanese naval codes used during World War II specifically. I'm wondering if any of the codebooks from this era have been made available, or if they are still protected materials?
Let $p$ be a prime number. Consider two fixed values $a,b\in\mathbb Z/p\mathbb Z$, where $b\neq0$, and a uniformly random value $r\leftarrow \mathbb Z/p\mathbb Z$. Is $v=a+b\cdot r$ a uniformly random value in $\mathbb Z/p\mathbb Z$?
In $\mathbb Z/p\mathbb Z$, is $(a+b\cdot r)$ a random value for fixed $a,b$ and random $r$?
When I send encrypted data to a website, using public key encryption, what is stopping someone who is listening from storing my encrypted data, and decryption it in a few years after they have determined the private key? From my understanding, private keys can be discovered after a few years using a fast computer. ...
What is stopping someone from saving encrypted info, and decoding it later?
Assume we have the following setup: - A client with trusted storage and computing capabilities (e.g. a smartcard) - A server with trusted computing and short-term storage capabilities (e.g. RAM + CPU, possibly with something like [Intel SGX][1]). The server has no trusted long-term storage capabilities. The pr...
Assume we have the following setup: - A client with trusted storage and computing capabilities (e.g. a smartcard) - A server with trusted computing and short-term storage capabilities (e.g. RAM + CPU, possibly with something like [Intel SGX][1]). The server has no trusted long-term storage capabilities. The pr...
I'm working on a client handshake finished message for a TLS client, and I'm reading through the RFC2246 spec. The spec states: > The hash contained in finished messages sent by the server incorporate Sender.server; those sent by the client incorporate Sender.client. The value handshake_messages includes all hands...
For an easy to grasp explanation, you can have a look at the talk *Obfuscation I* at the [Cryptography Bootcamp](http://simons.berkeley.edu/workshops/schedule/1151) by Amit Sahai. Here's a [link to youtube](https://www.youtube.com/watch?v=7LkTUOvfeno). In this context he also explains matrix branching programs, which a...
Can CTR mode be considered as a pseudo-random function ? I'm talking about the keystream generated by CTR.
Can the keystream generated by CTR mode be considered a pseudo-random function?
Does CTR mode yield a PRF?
Much like this question: http://crypto.stackexchange.com/questions/18454/public-key-in-fully-homomorphic-encryption-over-the-integers I am also reading I'm reading [Fully Homomorphic Encryption over the Integers][1], but I'm working on implementing the symmetric key implementation. It says on the first page: ...
Imagine we have $t-1$ shares in $(t,n)$ shamir secret sharing. So at least $t$ shares are needed. Question: Why cannot we use $t-1$ shares to find a root of the polynomial and then recover the secret?
Shamir Secret Sharing: Why cannot we recover polynomial's root if we have $t-1$ shares?
Take a linear polynomial: $y=mx+b$. If I tell you that the point $(1,5)$ is on the line, can you tell me $m$ and $b$? No, because in fact there are infinitely many lines that pass through the point $(1,5)$. It takes 2 points to uniquely identify a line. In general it takes $t$ points to uniquely identify a degree $t-1$...
Take a linear polynomial: $y=mx+b$. If I tell you that the point $(1,5)$ is on the line, can you tell me $m$ and $b$? No, because in fact there are infinitely many lines that pass through the point $(1,5)$. It takes 2 points to uniquely identify a line. In general it takes $t$ points to uniquely identify a degree $t-1$...
I know that, for any CPA-secure public-key encryption scheme, the size of the ciphertext after encrypting a single bit is superlogarithmic in the security parameter. That is, for $(pk,sk) \leftarrow Gen(1^n)$ it must hold that $|Enc_{pk}(b)| = w(\log n)$ for any $b \leftarrow \{0,1\}$. The problem is that I took it as ...
I'm in the need of an inverse public-key encryption method where you encrypt with the private key and decrypt with the public key. In other words an asymetric encryption where you can't generate the encryption key from the decryption key. Does such encryption exist? If yes which, and which would be the fastest? If n...
For an easy to grasp explanation, you can have a look at the talk *Obfuscation I* at the [Cryptography Bootcamp](http://simons.berkeley.edu/workshops/schedule/1151) by Amit Sahai. Here's a [link to youtube](https://www.youtube.com/watch?v=7LkTUOvfeno). In this context he also explains matrix branching programs, which a...
I have a multiplicative group $G$ of prime order $p$ implemented using a twisted Edwards curve (similar to Ed25519). I want to compute a set of $k$ distinct points $P_1,...,P_k$ that generate $G$, such that the mutual discrete logarithms of these points are hard to compute. I.e., for any distinct $P_i,P_j\in \{P_1,...
Safe generation of $k$ points on a curve such that the mutual discrete logs are hard?
Take a linear polynomial: $y=mx+b$. If I tell you that the point $(1,5)$ is on the line, can you tell me $m$ and $b$? No, because in fact there are infinitely many lines that pass through the point $(1,5)$. It takes 2 points to uniquely identify a line. In general it takes $t$ points to uniquely identify a degree $t-1$...
I'm in the need of an inverse public-key encryption method where you encrypt with the private key and decrypt with the public key. In other words an asymetric encryption where you can't generate the encryption key from the decryption key. Does such encryption exist? If yes which, and which would be the fastest? If n...
Assume we have the following setup: - A client with trusted storage and computing capabilities (e.g. a smartcard) - A server with trusted computing and short-term storage capabilities (e.g. RAM + CPU, possibly with something like [Intel SGX][1]). The server has no trusted large-scale long-term storage capabilitie...
This is an error in RFC 2246 corrected at https://www.rfc-editor.org/errata_search.php?rfc=2246 and in the subsequent version TLS RFCs 4346 and 5246. It derives from SSLv3 on which TLSv1.0 was mostly based, now available as RFC 6101 if you want to compare them. You'll see SSLv3 had enum { client(0x434C4E54), ...
I have an unchanging set of unique items, and I want my server to show one of those items to a client, then cryptographically prove that the item is part of the set. How I do this currently: 1. Generate a merkle tree containing all of the items. 2. Give the client the merkle root, (32 bytes) out of band. 3. ...
Let's try to simplify and abstract your protocol a bit. Instead of your server and client, we just have two parties, let's call them Sally and Charlie. * Charlie has a key pair $K = (K_i, K_u)$ for a suitable asymmetric cryptosystem $\mathcal E$. We assume that this cryptosystem is [partially homomorphic](https://...
For an scheme to be at least CPA secure, one has to randomize the scheme. In case of a secret key encryption scheme, the used randomness will typically become part of the cipher text as in the case of an IV and is "public" (This is not a necessary requirement but how most algorithms work). Now, if I switch to public...
> What is stopping someone from saving encrypted info, and decoding it later? Nothing. That's exactly why certain three letter institutions build large data centers... Waiting for the first large quantum computer to be built or for new attack techniques that allow to break e.g. RSA for the key sizes used today. >...
What was the NSA's reasoning for making their bitwise combination functions in Sha-1 the way they did?
I have an unchanging set of unique items, and I want my server to show one of those items to a client, then cryptographically prove that the item is part of the set. How I do this currently: 1. Generate a merkle tree containing all of the items. 2. Give the client the merkle root, (32 bytes) out of band. 3. ...
For a scheme to be at least CPA secure, one has to randomize the scheme. In case of a secret key encryption scheme, the used randomness will typically become part of the cipher text as in the case of an IV and is "public" (This is not a necessary requirement but how most algorithms work). Now, if I switch to public ...
Even non-public randomness may be fatal. For example, RSA public keys are calculated as p*q, where p and q are two random primes. If you have lots of two keys, you can work out if they have any common factors (which would be either p or q) and what it is. Once you have this, you can work out the other, and you can t...
For a scheme to be at least CPA secure, one has to randomize the scheme. In case of a secret key encryption scheme, the used randomness will typically become part of the cipher text as in the case of an IV and is "public" (This is not a necessary requirement but how most algorithms work). Now, if I switch to public ...
What was the NSA's reasoning for making their bitwise combination functions in SHA-1 the way they did?
I'm working on a client handshake finished message for a TLS client, and I'm reading through the [RFC 2246][1] spec. The spec states (in section 7.4.9): > The hash contained in finished messages sent by the server incorporate Sender.server; those sent by the client incorporate Sender.client. The value handshake_me...
How much security does double hashing add **regarding collisions and preimages**? Is it helpful to iterate a hash function even more times than two? For example, can MD5 be fixed (in practice) by applying the hash function twice (`MD5(MD5(x))`)? Also, [Bitcoin uses `SHA256(SHA256(x))`][1]. Does this add security in ...
Can iterated hashing be used to mitigate collision and preimage weaknesses?
How much security does double hashing add **regarding collisions and preimages**? Is it helpful to iterate a hash function even more times than two? For example, can MD5 be fixed (in practice) by applying the hash function twice (`MD5(MD5(x))`)? Also, [Bitcoin uses `SHA256(SHA256(x))`][1]. Does this add security in ...
I need a PRNG which provides 128 bytes numbers. Let's say that given a symmetric key $K$ and an internal state $s$ I use the PRF HMAC-SHA512 this way: PRNG($K, s$) = HMAC-SHA512$_K$($s$ || 0x01) || HMAC-SHA512$_K$($s$ || 0x02) where $||$ represents a concatenation. **I am wondering if my PRNG can be periodic?*...
A periodic PRNG based on hash function?
What choice did they have? F1 is a bitwise function with three inputs and one output. There are $2^8 = 256$ such functions. Only 70 of them are "unbiased" (i.e. have as many 0 and 1 outputs in their image). If you further require that each input, as well as the order of inputs, matters for the output, you are left w...
Is there a way to 'mangle' a public data-source (for example, the current date in YYYYMMDD or the top New York Times headline) to form a one-time pad that will sufficiently hide the pad's source? What other issues would such a scheme be running into? Disclaimer: I am not an expert cryptographer and am just interes...
I'm trying to figure out which is the best way to get privacy and integrity together in public cryptography. Alice needs to send multiple files f (may be big) to Bob. I've thought: Alice computes the **hash** of the file ***h(f)*** Alice **signs** *h(f)* with her private key Alice **encrypt** with Bob's ...
In RSA, some security authorities and/or standards allow the public exponent $e=3$, others require or recommend $e>2^{16}$ (or perhaps some other minimum). I gathered the following: - [PKCS#1][1] allows $e=3$ for both RSA digital signature and encryption (but see 3. below). - [ISO/IEC 9796-2][2] allows $e=3$ (in th...
When I run openssl cms -encrypt -aes256 -in sample.der -out wrapped.der -outform DER -recip ecc.crt -keyopt ecdh_kdf_md:sha512 the part of the CMS output which is supposed to have the 256 bit CEK encrypted under the KEK shows to be 40 bytes. 431 :d=8 hl=2 l= 40 prim: OCTET STRING 00...
I have come across 2 versions of otp while reading it and want to confirm it. 1-they have taken a plain text consisting of alphabets where they are shifted and replaced by alphabets itself. 2- XORing of binary I/P streams with binary key. Are they both valid forms? When i/p is in alphabets, shouldn't we convert it into...
In a recent [mail on the IETF CFRG mailing list][1] it was claimed that: > The (currently missing) security considerations (or somewhere) should describe why Curve25519 is ok when used in contexts where we'd > otherwise ask for 128 bit strength, (basically because it's close > enough), and also why the 224 bit lev...
Does Curve25519 only provide 112 bit security?
In many symmetric key ciphers sender and receiver have to exchange a single key. They may also do it through 3rd party who distributes it to both of them. since 3rd party can read all messages exchanged between them It can have disastrous impact on them in terms of capital, frogery etc. so In this case how is the priva...
I have come across 2 versions of otp while reading it and want to confirm it. 1. they have taken a plain text consisting of alphabets where they are shifted and replaced by alphabets itself. 2. XORing of binary I/P streams with binary key. Are they both valid forms? When I/P is in alphabets, shouldn't w...
From [PKCS#1][1], page 24: After we create the EM byte string and convert it to an integer, we then encrypt that integer with RSAEP (page 10) to get the ciphertext (as an integer). My question arrives from the fact that RSAEP demands the input (m) to be less than the modulus (n). My question is simple - how ar...
In many symmetric key ciphers sender and receiver have to exchange a single key. They may also do it through 3rd party who distributes it to both of them. since 3rd party can read all messages exchanged between them It can have disastrous impact on them in terms of capital, forgery etc. so In this case how is the priva...
> Some claim that Curve25519 has 112 bit security, others that it has 128 bit security; which is it? Well, actually, neither - it's actually somewhere in the middle. For a curve without known weaknesses (and Curve25519 doesn't have known weaknesses), then if the curve order has a large prime factor around $2^{2k}...
The paper [Fully Homomorphic Encryption over the Integers][1] talks about a super simple symmetric key implementation on page 1 and 2. It says that to generate a key, you pick a random odd number between $[2^{N-1} ,2^N)$ where N is the size of your key in bits. To encrypt a bit (a 0 or a 1), you do this:<br> $c ...
The paper [Fully Homomorphic Encryption over the Integers][1] talks about a super simple symmetric key implementation on page 1 and 2. It says that to generate a key, you pick a random odd number between $[2^{N-1} ,2^N)$ where N is the size of your key in bits. To encrypt a bit (a 0 or a 1), you do this:<br> $c ...
The paper [Fully Homomorphic Encryption over the Integers][1] talks about a super simple symmetric key implementation on page 1 and 2. It says that to generate a key, you pick a random odd number between $[2^{N-1} ,2^N)$ where N is the size of your key in bits. To encrypt a bit (a 0 or a 1), you do this:<br> $c ...
When I run openssl cms -encrypt -aes256 -in sample.der -out wrapped.der -outform DER -recip ecc.crt -keyopt ecdh_kdf_md:sha512 the part of the CMS output which is supposed to have the 256 bit CEK encrypted under the KEK shows to be 40 bytes. 316:d=7 hl=2 l= 40 prim: OCTET STRING [HEX DUMP...
From [PKCS#1][1], page 24: After we create the EM byte string and convert it to an integer, we then encrypt that integer with RSAEP (page 10) to get the ciphertext (as an integer). My question arrives from the fact that RSAEP demands the input ($m$) to be less than the modulus ($n$). My question is simple - ho...
The 10.9 exercise from the Katz-Lindell textbook creates a lot of confusion, let me state it here. Consider the following experiment for an algorithm $A$ and a function $l$ with $l(n) \leq 2n-2$ for all $n$: **The padded RSA experiment** $PAD_{A,GenRSA,l}(n)$: 1. $(N,e,d) \leftarrow GenRSA(1^n)$. 2. Give $N$, $e...
I've been required to answer a question: > As usually, we have Alice and Bob. > Suppose Alice wants to send a file F to Bob, ensuring integrity and confidentiality. They share a symmetryc key $K_{ab}$ and use AES. No hash algorithm is available. > Alice sends to Bob: $Enc(K_{ab}, F)$ > In this simple scheme...
I'm a crypto enthusiastic and student of cryptography. I'm developing a project with other students titled "A hardware implementation of a DES cryptography for educational purposes", our idea was to make a simple version of DES encryption in a piece of hardware to help students that are learning cryptography understan...
Are there ANY text strings that will generate the same SHA-512 Hash output? Please provide an example, and how you came to that conclusion. I've tried thousands of variations, including ".." vs. "." and "..." vs "..,". I believe it IS possible, I just don't know HOW I can find those 2 magic text strings.
Are there ANY text strings that will generate the same SHA-512 Hash output?
From [PKCS#1][1], page 24: After we create the EM byte string and convert it to an integer, we then encrypt that integer with RSAEP (page 10) to get the ciphertext (as an integer). My question arrives from the fact that RSAEP demands the input ($m$) to be less than the modulus ($n$). My question is simple - ho...
I need a PRNG which provides 128 bytes numbers. Let's say that given a symmetric key $K$ and an internal state $s$ I use the PRF HMAC-SHA512 this way: The output is PRNG($K, s$) = HMAC-SHA512$_K$($s$ || 0x01) || HMAC-SHA512$_K$($s$ || 0x02) where $||$ represents a concatenation. The next state is $s_{i+1}$ = HMAC...
I'm trying to figure out which is the best way to get privacy and integrity together in public cryptography. Alice needs to send multiple files $f$ (may be big) to Bob. I've thought: Alice computes the **hash** of the file $h(f)$. Alice **signs** $h(f)$ with her private key. Alice **encrypts** with Bob's...
I'm trying to figure out which is the best way to get privacy and integrity together in public cryptography. Alice needs to send multiple files $f$ (may be big) to Bob. I've thought: Alice computes the **hash** of the file $h(f)$. Alice **signs** $h(f)$ with her private key. Alice **encrypts** with Bob's...
["Fully Homomorphic Encryption over the Integer"][1] described a simple FHE scheme based on the GACD assumption. Its encryption function (on page 6) has the form $c \leftarrow (m + 2r + 2*\sum_{i \in S} x_i) \mod x_0$, where $\sum_{i \in S} x_i$ can be viewed as some ciphertexts of plaintext 0 (which can be divided by ...
in DGHV FHE, why noise $r$ can be in $(-2^{\rho'}, 0)$?