instruction
stringlengths
15
30k
In a paper they write once, $(\mathbb{Z}_n^*)^2$. Is this the group of quadratic residues or is it something else? Here the theorem: Under the strong RSA assumption, given a modulus $n$, along with random elements $g, h \in (\mathbb{Z}_n^βˆ—)^2$, it is hard to compute $w in \mathbb{Z}_n^*$ and integers $a, b, c$ su...
In a paper they write once, $(\mathbb{Z}_n^*)^2$. Is this the group of quadratic residues or is it something else? Here the theorem: Under the strong RSA assumption, given a modulus $n$, along with random elements $g, h \in (\mathbb{Z}_n^βˆ—)^2$, it is hard to compute $w \in \mathbb{Z}_n^*$ and integers $a, b, c$ s...
The Scenario ============ I have a message string I need to transport over a wireless network that may be unreliable. This message string is about 100 bits long, and is packaged with an 8-bit CRC. When the message is received, it's validated with the CRC and unpacked. I would like to add a few "message version" bits ...
Does it matter what length the padding is? If so - what length should it be? (Another point: Should it be random?)
What length should the padding be when encrypting or signing with RSA?
There have been several questions regarding [password hashing here][1] and [on Security.SE][2]. A "pepper" is sometimes mentioned – an application-specific secret key. The [canonical answer on password hashing][3] implies that a adding pepper brings the composition close to a MAC, and that cryptographic MAC functi...
Recommended way of adding a pepper/secret key to password before hashing?
There have been several questions regarding [password hashing here][1] and [on Security.SE][2]. A "pepper" is sometimes mentioned – an application-specific secret key. The [canonical answer on password hashing][3] implies that a adding pepper brings the composition close to a MAC, and that cryptographic MAC functi...
Is there a way to derive [the formulas for point addition and multiplication on elliptic curves in Jacobian format](http://www.hyperelliptic.org/EFD/g1p/auto-shortw-jacobian.html) by yourself? How could I have derived these formulas by myself?
If I use the AES256 option in Winzip to encrypt a file, is it any less safe or less secure than using pgp encryption?
There have been several questions regarding [password hashing here][1] and [on Security.SE][2]. A "pepper" is sometimes mentioned – an application-specific secret key. The [canonical answer on password hashing][3] implies that a adding pepper brings the composition close to a MAC, and that cryptographic MAC functi...
There have been several questions regarding [password hashing here][1] and [on Security.SE][2]. A "pepper" is sometimes mentioned – an application-specific secret key. The [canonical answer on password hashing][3] implies that a adding pepper brings the composition close to a MAC, and that cryptographic MAC functi...
There have been several questions regarding [password hashing here][1] and [on Security.SE][2]. A "pepper" is sometimes mentioned – an application-specific secret key. The [canonical answer on password hashing][3] implies that a adding pepper brings the composition close to a MAC, and that cryptographic MAC functi...
The Scenario ============ I have a message string I need to transport over a wireless network that may be unreliable. This message string is about 100 bits long, and is packaged with an 8-bit CRC. When the message is received, it's validated with the CRC and unpacked. I would like to add a few "message version" bits ...
How much will the security of one-time pad decrease if I use one digest from 0-9 instead of 0-26 ... ex. pt = blue , key = 5 9 4 6 >02 12 21 05 >5 9 4 6 >07 21 25 11 >g u y k so blue+5946=guyk Is that as secure as if I use numbers from 1-26 And will blue + 5946 = the unbreakable one time-...
How much will the security of one-time pad decrease if I use one digit from 0-9 instead of 1-26? for example `plaintext = "blue"` and `key = "5 9 4 6"`: b l u e - plaintext 02 12 21 05 - plaintext in numeric form 5 9 4 6 - key 07 21 25 11 - ciphertext in numeric form g u ...
I will be making (in the near future) an app that will contain some pretty heavy crypto. As it is possible that my app will be ported to different devices (initially it will be iOs only, but Mac, Android & maybe even Windows ports will eventually exist). The question is how to make the crypto library as portable as pos...
Winzip allows enumeration of the file names contained within. Try WinRAR or 7zip instead. [Winzip AES256](http://www.winzip.com/aes_info.htm) also uses [CTR mode](http://en.wikipedia.org/wiki/Block_cipher_mode_of_operation#Counter_.28CTR.29). Both [PGP](http://en.wikipedia.org/wiki/Pretty_Good_Privacy#Security_qua...
I just started some work on computation over encrypted data in the cloud. We're still in the early planning stages, and to really understand the kind of security we can offer I need to determine what kind of attacks to expect from an untrusted cloud server. My basic question is whether the cloud represents a semi-hones...
What kind of adversary is the cloud?
I'm encrypting files using an AES-256 CBC cipher and an SHA-256 HMAC every 64KB in the file. Since AES CBC needs an amount of input bytes to be divisible by 16, I use PKCS#7 padding to bring the amount of bytes up to a count divisible by 16 at the end of the file. For this and for most cases of cryptography, does k...
Does knowledge of original file size provide a cryptographic weakness?
This seems like it may be an unnecessary complication. Why not encrypt the whole file at once, and HMAC the entire result? Or alternatively, use an encryption mode that has this built in, like AES-GCM? But to answer your original question, no, it does not introduce any weaknesses. If it did, knowing the value to wit...
So I'm going to give you guys my understanding and then if you would be so kind as to tell me where I'm off the mark (hopefully I'm not completely wrong). So basically the index calculus for the discrete log problem over $\mathbb{Z}_p$ takes advantage of the fact that even though we don't know the structure of $\mat...
So I'm going to give you guys my understanding and then if you would be so kind as to tell me where I'm off the mark (hopefully I'm not completely wrong). So basically the index calculus for the discrete log problem over $\mathbb{Z}_p$ takes advantage of the fact that even though we don't know the structure of $\mat...
Basic question- if I'm encoding a bunch of known filetypes with salsa20, will it still be secure if the plaintext header is known? I.e. the attacker will precisely know the first 64 bytes or so of the plaintext file, not the remaining mega/gigabytes
Security of Salsa20 with some known plaintext?
So I'm going to give you guys my understanding and then if you would be so kind as to tell me where I'm off the mark (hopefully I'm not completely wrong). So basically the index calculus for the discrete log problem over $\mathbb{Z}_p$ takes advantage of the fact that even though we don't know the structure of $\mat...
So I'm going to give you guys my understanding and then if you would be so kind as to tell me where I'm off the mark (hopefully I'm not completely wrong). So basically the index calculus for the discrete log problem over $\mathbb{Z}_p$ takes advantage of the fact that even though we don't know the structure of $\mat...
So I'm going to give you guys my understanding and then if you would be so kind as to tell me where I'm off the mark (hopefully I'm not completely wrong). So basically the index calculus for the discrete log problem over $\mathbb{Z}_p$ takes advantage of the fact that even though we don't know the structure of $\mat...
So I'm going to give you guys my understanding and then if you would be so kind as to tell me where I'm off the mark (hopefully I'm not completely wrong). So basically the index calculus for the discrete log problem over $\mathbb{Z}_p$ takes advantage of the fact that even though we don't know the structure of $\mat...
So I'm going to give you guys my understanding and then if you would be so kind as to tell me where I'm off the mark (hopefully I'm not completely wrong). So basically the index calculus for the discrete log problem over $\mathbb{Z}_p$ takes advantage of the fact that even though we don't know the structure of $\mat...
Basic question- if I'm encoding a bunch of known filetypes with salsa20, will it still be secure if the plaintext header is known? Assume that a different IV and Key are generated before each file is encrypted (or at least, it's statistically impossible for an attacker to know whether or not different files were enc...
A few months ago, XKCD posted [a challenge][1] to find a plaintext which hashed (using Skein 1024 1024) to a specified value. Inputs were scored based on the hamming distance between the hash of the specified input and the desired hash. [The top scorer][2], from Carnegie Mellon, found a plaintext whose hash matched ...
Look at the hex dumps of encrypted1.bin and encrypted2.bin . They both have same password A which was used to encrypt sampletext [achilles:~/Arena/crypto] $ openssl enc -e -des -in plaintext -out encrypted1.bin enter des-cbc encryption password: Verifying - enter des-cbc encryption password: [ac...
Is the DES algorithm in OPENSSL random?
Since the output of the configuration of Skein is 1024 bits, we would expect to get 512 bits correct just by random hashing. So the question is, **what is the probability of getting 640 bits correct**?* There are ${1024 \choose 640}\approx 4.16\cdot 10^{292}\approx 2^{972}$ ways this can happen out of $2^{1024}$ dif...
If there was a better known way than brute force, I suppose someone would already have made a paper about this (or lets this be secret to use it for attacks – but then this person wouldn't enter in such a competition). So it looks like just brute force. Why are these people better than you? Some guesses (and most li...
Since the output of the configuration of Skein is 1024 bits, we would expect to get 512 bits correct just by random hashing. So the question is, **what is the probability of getting 640 bits correct**?* From that we can figure out how long it would take for that to occur. There are ${1024 \choose 640}\approx 4.16\cd...
Since the output of the configuration of Skein is 1024 bits, we would expect to get 512 bits correct just by random hashing. So the question is, **what is the probability of getting 640 bits correct**?* From that we can figure out how long it would take for that to occur. There are ${1024 \choose 640}\approx 4.16\cd...
It's got a wikipedia page so it must be "serious" :) From my very quick look it seems like a field that isn't too new (90's). The paper [Analysis of Neural Cryptography][1] has Adi Shamir's name on it (the "S" in RSA and the Shamir from Shamir secret sharing), so there has at least been a very reputable cryptographe...
Does SRP reduce to DH key echange when shared password is not secret?
Since the output of the configuration of Skein is 1024 bits, we would expect to get 512 bits correct just by random hashing. So the question is, **what is the probability of getting 640 bits correct**?* From that we can figure out how long it would take for that to occur. There are ${1024 \choose 640}\approx 4.16\cd...
I would like learn about use neural networks in cryptography. Is there any research literature on this subject? What should I do to learn about the subject? I am taking short course in neural networks and for the course project I would like to do something in neural cryptography.
A few months ago, XKCD posted [a challenge][1] to find a plaintext which hashed (using Skein 1024 1024) to a specified value. Inputs were scored based on the hamming distance between the hash of the specified input and the desired hash. [The top scorer][2], from Carnegie Mellon, found a plaintext whose hash matched ...
How do I do a literature search of the research literature on cryptography? Assume there's some topic in cryptography I'd like to learn more about; how do I search the cryptographic research literature to find research papers that might be relevant? What's the best process to use for finding relevant research?
Linear Feedback Shift Registers ([LFSRs][1]) can be excellent (efficient, fast, and with good statistial properties) pseudo-random generators. Many [stream ciphers][2] are [based on LFSRs][3] and [one of the possible designs][4] of such stream ciphers is combining outputs of $m$ LFSRs as input of a boolean function $f:...
Combining LFSRs for Stream Ciphers: Why do we need high non-linearity?
The [Berlekamp-Massey algorithm](http://en.wikipedia.org/wiki/Berlekamp%E2%80%93Massey_algorithm) is an iterative method for finding the shortest LFSR that can generate a given sequence of bits. Simplistically, after the algorithm has found the shortest LFSR that generates the first $k$ bits of the sequence, it examin...
Linear Feedback Shift Registers ([LFSRs][1]) can be excellent (efficient, fast, and with good statistial properties) pseudo-random generators. Many [stream ciphers][2] are [based on LFSRs][3] and [one of the possible designs][4] of such stream ciphers is combining outputs of $m$ LFSRs as input of a boolean function $f:...
Since the output of the configuration of Skein is 1024 bits, we would expect to get 512 bits correct just by random hashing. So the question is, **what is the probability of getting 640 bits correct**? From that we can figure out how long it would take for that to occur. There are ${1024 \choose 640}\approx 4.16\cdo...
The [Berlekamp-Massey algorithm](http://en.wikipedia.org/wiki/Berlekamp%E2%80%93Massey_algorithm) is an iterative method for finding the shortest LFSR that can generate a given sequence of bits. The given sequence might or might not be generated by an LFSR: the Berlekamp-Massey algorithm does not care. It just finds ...
Linear Feedback Shift Registers ([LFSRs][1]) can be excellent (efficient, fast, and with good statistial properties) pseudo-random generators. Many [stream ciphers][2] are [based on LFSRs][3] and [one of the possible designs][4] of such stream ciphers is combining outputs of $m$ LFSRs as input of a boolean function $f:...
The [Berlekamp-Massey algorithm](http://en.wikipedia.org/wiki/Berlekamp%E2%80%93Massey_algorithm) is an iterative method for finding the shortest LFSR that can generate a given sequence of bits. The given sequence might or might not be generated by an LFSR: the Berlekamp-Massey algorithm does not care. It just finds ...
For the reasons I cannot go into details, I need to design my own protocol and overall security system which will be used to establish secure data exchange between various devices (most notably desktops of all three major OSes, Android and iOS devices and Raspberry Pi, with the possibility to extend it to other embedde...
Let's suppose we have an Alice who knows a secret key A, and Bob who knows key B. Using their own keys, they encrypt a message, and send it to one another. Now is there some cryptographic scheme thinkable that lets Alice only decrypt her message (using key B) when Bob is able to decrypt his (via key A)? To guarantee...
Is there a way to swap keys between two parties?
One requirement states that the generator has to withstand the next-bit test. Calculate next number: x_i = x_i-1^ e mod n I can see that it withstands the "state compromise extensions" (can't guess previous states) but given x_i, e, n an adversary can compute easily all future numbers. Why is this generator...
Why is the RSA PRNG cryptographically secure?
One requirement states that the generator has to withstand the next-bit test. Calculate next number: $x_i = x_{i-1}^ e\mod n$ I can see that it withstands the "state compromise extensions" (can't guess previous states) but given $x_i, e, n$ an adversary can easily compute all future numbers. Why is this gen...
One requirement states that the generator has to withstand the next-bit test. Consider the following PRNG, where we calculate next output $x_i$ via the formula $x_i = x_{i-1}^ e\mod n$. I can see that this PRNG withstands the "state compromise extensions" (can't guess previous states). However, given $x_i, e, n...
Why is the following RSA PRNG cryptographically secure?
Perhaps you are thinking of the Micali-Schnorr PRNG, as described in Algorithm 5.37 of the Handbook of Applied Cryptography? [Algorithm 5.37 in HAC][1] never states that $e$ is known to the adversary, or even that $n$ is known. Also, Algorithm 5.37 outputs only the least significant bits of the number, on each iterati...
If you're trying to describe the Micali-Schnorr PRNG (Algorithm 5.37 in HAC), you have not accurately described the Micali-Schnorr PRNG. The Micali-Schnorr PRNG is cryptographically secure, but yours is not. Where did you get the PRNG you described, and why do you think your PRNG is secure? The PRNG you described ...
Let's suppose we have an Alice who knows a secret key A, and Bob who knows key B. Using their own keys, they each encrypt a message (Alice encrypts $m_A$, Bob encrypts $m_B$) with their own key, and send the encrypted messages to one another. Now is there some cryptographic scheme thinkable that lets Alice only decr...
Is there a way to swap keys between two parties who don't trust each other?
One problem not mentioned here is that CRC collisions are a certainty. If you were using a cryptographically secure hash, you would never encounter a false positive where both solutions were possible. In this scheme, every 256 messages would yield identical CRC values, and your different versions would be indistinguish...
Here's the deal. The discrete log problem is feasible in the special case where the exponent is known to come from a small range of possibilities (e.g., the exponent is not too large). Suppose we are given $y=g^m$, and we want to find $m$. Suppose moreover we know that $m$ is small: $0 \le m < 2^{30}$, say. Then ...
Here's the deal. The discrete log problem is feasible in the special case where the exponent is known to come from a small range of possibilities (e.g., the exponent is not too large). Suppose we are given $y=g^m$, and we want to find $m$. Suppose moreover we know that $m$ is small: $0 \le m < 2^{30}$, say. Then ...
I ported GnuPG to Javascript using [Emscripten][1] (not released yet). Now I need a good replacement for `/dev/random`/`/dev/urandom`. New browsers support `window.crypto.getRandomValues()` but for older browsers I need something else. I was thinking about recording some audio using HTML5 and calculating the sha 512...
I read in http://epubs.surrey.ac.uk/7219/2/esorics06.pdf that in exponential El Gamal the discrete log problem for recovering $m$ from $g^m$ can be made tractable when $m$ is drawn from a binomial distribution. Why is this?
Why is the discrete log problem easy when the exponent comes from a binomial distribution?
Is there a way to do fair exchange between two parties who don't trust each other?
`window.crypto.getRandomValues()` is the best you can do. Unfortunately, at the time of writing, too many browsers don't support `window.crypto.getRandomValues()`: see [Compatibility of window.crypto.getRandomValues()](http://stackoverflow.com/q/16084766/781723). The alternative is to use fallback methods. However...
Suppose Alice is using a password prompt that only accepts **up to 16 characters** for any particular password. Memorization of long strings of random characters is not one of Alice's strengths, so she opts instead for a memorable passphrase consisting of a permutation of **7 of the 2000 most common English words**....
Suppose Alice is using a password prompt that only accepts **up to 32 characters** for any particular password. Memorization of long strings of random characters is not one of Alice's strengths, so she opts instead for a memorable passphrase consisting of a permutation of **7 of the 2000 most common English words**....
We're building a data service that is expected to go out through a single "fat pipe" channel. The design requirement says that the data in the channel must be protected by authentication and encryption. I'm ready to argue that the strongest encryption for such a system (single channel, multiple subscribers) is the "cab...
Suppose Alice is using a password prompt that only accepts **up to 32 characters** for any particular password. Memorization of long strings of random characters is not one of Alice's strengths, so she opts instead for a memorable passphrase consisting of a permutation of **7 of the 2000 most common English words**....
Yes, there is. I'm assuming your broadcast stream is (or can be) somehow broken up in smaller messages (or "packets"), and you don't need to retire a key before a message is finished. Then you produce a random session key for each message, and encrypt this session key with each of the subscribers' keys, prepend t...
The Wikipedia entry [Fair exchange][1] has only two lines, and the only paper I can find describing such a protocol is extremely complicated. Is this a new field in cryptology or can someone give an example of actual use or provide a simple implementation? [1]: https://en.wikipedia.org/wiki/Multi_party_fair_exc...
What is a fair exchange scheme?
Fair exchange protocols aren't new by any means, but there is a lack of layman-friendly material out there, unfortunately. I think the high prevalence of theoretical cryptography in fair exchange protocols may be partially responsible for that. At any rate, here is the basic idea behind a fair exchange protocol. Su...
Fair exchange protocols aren't new by any means, but there is a lack of layman-friendly material out there, unfortunately. I think the high prevalence of theoretical cryptography in fair exchange protocols may be partially responsible for that. At any rate, here is the basic idea behind a fair exchange protocol. Su...
Fair exchange protocols aren't new by any means, but there is a lack of layman-friendly material out there, unfortunately. I think the high prevalence of theoretical cryptography in fair exchange protocols may be partially responsible for that. At any rate, here is the basic idea behind a fair exchange protocol. Su...
On Solaris there's a function `pkcs11_PasswdToKey`() which is a wrapper of `C_GenerateKey`(). I made a simple test and it turned out that `pkcs11_PasswdToKey`() only supports following `CKK_`types: CKK_AES CKK_BLOWFISH CKK_DES CKK_DES2 CKK_DES3 CKK_RC4 From my understanding, other sym...
PKCS#11: Which CKK_types are supported by CKM_PKCS5_PBKD2?
I am not familiar with that specific Solaris library (is that a software token?). However, what I can say is that PKCS#11 does not set any minimum requirement for the algorithms that a certain implementation should offer. `CKK_IDEA` *could* be supported, but only if the implementer chooses to. For instance, up to a ...
I'm writing TLS 1.2 implementation (in c#) over custom protocol. My question is how to generate the IV attached to each message, I don't want to use RandonNumberGenerator because of performance and instead using some PRNG. I'm only going to suppport AES128/256. From reading around I understand that using random I...
Is using sensor raw data a good way of generating true random numbers? I mean using an IPhone's gyro/accelerometer raw output as a base for generating an array of true random numbers.
To answer your specific questions: From reading around I understand that ... encrypting a counter and use that as the IV is OK, is that true? For CBC mode, that is absolutely true (as long as the key that you use to encrypt the counter is secret; that is, not known to any possible adversary). Shou...
Let $h$ be a bitstring and let $P(h, n)$ be the n-bit prefix of $h$. A partial collision of length $n$, for a hash function $H$ is a pair $(x,y)$, such that $P(H(x),n)=P(H(y),n)$. What is known about this type of collisions? I'm particularly interested in md5. Can rainbow tables be adapted to quickly look for these?...
Tl;dr: Yes, if you do it carefully. Breaking it down a bit first, we step into a definition. "True" random numbers of the kind you are discussing are those that are truly unpredictable, where the preceding data has absolutely no relationship to the next data. This measure of unpredictability is called "entropy" by...
Is there any mathematical result that gives us the minimum number of 1's in a 160-bit SHA-1 hash output? What is the probability that a 160-bit SHA-1 hash output contains at least 128 1's?
SHA-1:Is there any mathematical result that gives us the minimum number of 1's in a 160-bit SHA-1 hash output?
No, theoretically a SHA1 hash can be any 160-bit value, including the string of 160 zeroes. As for your second question, if we fudge a little bit and consider SHA1 a truly random function this becomes the same question as the following: If we flip 160 coins, what is the probability that at least 128 of them wi...
To answer your specific questions: > From reading around I understand that ... encrypting a counter and use that as the IV is OK, > is that true? For CBC mode, that is absolutely true (as long as the key that you use to encrypt the counter is secret; that is, not known to any possible adversary). > Sh...
Decoy for whom? Security, and cryptography specifically, has a need for public scrutiny. It's been proven time and time again that hiding the nature of the protocol/algorithm/scheme doesn't provide any tangible security. [Kerckhoffs' principle](http://en.wikipedia.org/wiki/Kerckhoffs%27_principle) explains this: A ...
> Is there any mathematical result that gives us the minimum number of > 1's in a 160-bit SHA-1 hash output? A good (secure) hash function has output that is uniformly and evenly distributed and shouldn't be distinguishable from random value. ![enter image description here][1] *[Chi-squared tests][2] of several...
Suppose Alice and Bob decide to communicate using elgamal elliptic curves. In this algorithm, Bob selects a prime $p$, an elliptic curve $E$, a point $\alpha$ on $E \pmod p$, and a secret integer $f$. Suppose that Bob has selected $p =8115633240307$; $E: y^2 = x^3 + 45x + 1$; $\alpha = (1728910711, 274151521448)$, $f=...
Suppose we use elgamal elliptic curves for secure communication. Bob selects a prime $p$, an elliptic curve $E$, a point $\alpha$ on $E \pmod p$, and a secret integer $f$. Suppose that Bob has selected $p =8115633240307$; $E: y^2 = x^3 + 45x + 1$; $\alpha = (1728910711, 274151521448)$, $f=7$; How would we calculate $\...