instruction
stringlengths
15
30k
Assume there's an unencrypted message A, and an encrypted message B. You know that message B was encrypted using a simple XOR method of A with a private key K, resulting in message B. Thus, B = A ⊕ K Can I use Boolean algebra, i.e. truth tables, and sum of products to decode the key?
This [RFC says the RSA Exponent should be 65537][1]. Why is that number recommended and what are the impacts & risks of making that number higher or lower? [1]: http://www.ietf.org/rfc/rfc4871.txt
I'm creating an RSA key pair in Bouncy Castle and need to specify an int value for certainty. This [Stack Overflow answer][1] says it is a relative test for how prime the values are. There is another answer that says this value should be adjusted relative to the key length. **Question** * What are the corre...
What is the correct value for "certainty" in RSA key pair generation?
This [RFC says the RSA Exponent should be 65537][1]. Why is that number recommended and what are the theoretical and practical impacts & risks of making that number higher or lower? What are the impacts of making that value a non-Fermat number, or simply non prime? [1]: http://www.ietf.org/rfc/rfc4871.txt
Suppose we have a RSA-type Modulus $n = pq$ with $p,q$ prime. We also pick a random public exponent $e$ with $\gcd(e,\varphi(n)) = 1$ and compute the private exponent $d$ with $de \equiv 1 \pmod{\varphi(n)}$. $(n,e)$ is the public key, $(n,d)$ is the private key. Just like RSA, so far. Now we encrypt a message repre...
Suppose we have a RSA-type Modulus $n = pq$ with $p,q$ prime. We also pick a random public exponent $e$ with $\gcd(e,\varphi(n)) = 1$ and compute the private exponent $d$ with $de \equiv 1 \pmod{\varphi(n)}$. $(n,e)$ is the public key, $(n,d)$ is the private key. Just like RSA, so far. Now we encrypt a message repre...
**Certainty of $x$ bits** means that the probability that something (in this case $p$ being prime) not being true is smaller than $2^{-x}$. This is the same probability as guessing a random $x$-bit value correctly on the first try, hence the name. **How to select $x$**? We want the probability of $p$ (and $q$) not b...
A slightly more efficient method to perform decryption would be: 1. Compute $r^e = (y^d)$ 2. Find the multiplicative inverse $r^{-e}$ of $r^e$ modulo $n$ 3. Compute $m = (r^{-e} \cdot z)^d = (r^{-e} \cdot r^e \cdot m^e) ^d$ This has two computations of $x^d$ for some $x$; your method has three. On the...
How Replay attack works in ECB mode? I found this in wikipedia "**ECB mode** can also make protocols without integrity protection even more susceptible to **replay attacks**, since each block gets decrypted in exactly the same way." But I want to know how replay attack really works in ECB mode.
How Replay attack works in ECB mode? I found this in wikipedia "**ECB mode** can also make protocols without integrity protection even more susceptible to **replay attacks**, since each block gets decrypted in exactly the same way." But I want to know how replay attack really works in ECB mode, and how the othe...
How do replay attacks work in ECB mode? I found this [in Wikipedia](http://en.wikipedia.org/wiki/ECB_mode): > "ECB mode can also make protocols without integrity protection even more susceptible to replay attacks, since each block gets decrypted in exactly the same way. For example, the _Phantasy Star Online: Blue...
What is the probability of repeated encrypted block in Output Feedback (OFB) mode? Is there any existing documentation/studies about that? If it is existing, can you please provide me a link for that documentation, I want to analyze it carefully. Thanks.
Is there any probability/chances of repeated encrypted block in Output Feedback (OFB) mode? Is there any existing documentation/studies about that? If it is existing, can you please provide me a link for that documentation, I want to analyze it carefully, I can't find some documentation about the probability of repeat...
If a RSA certificate is created with a [low degree of certainty][1], does the value of the [exponent][2] compensate for this? I'm asking because certain implementations of key generation software hide the certainty value from the administrator, and I'd like to find reassurance in any other parameter. If the expon...
Does a high exponent compensate for a low degree of certainty?
I need to encrypt data that has a pre-defined header and footer structure, and furthermore the data follows pre-defined patterns. The header and footer structure follow a defined structure but cannot be left out because they are never truly equal. An example of this kind of data is an html file: it will in most cases s...
*I am new to cryptography, but here goes.* 1. Of your first login, the client can send to the server E(hash(password),n) with ku [public key of server] The server can decrypt and store the nth hash of the hash value. 2. From then on, the client can generate the (n-1)th hash of the password and send it, along wi...
No, in RSA, a bigger public exponent $e$ does not compensate in any way for setting a _certainty_ parameter incorrectly. A bigger key length does, by reducing to some degree the odds that a composite is selected (as most pseudo-prime tests, including Miller-Rabin, have odds of missing a composite that lowers with the s...
Blum Blum Shub is a stream cipher that is provably reducible to the difficulty of factoring integers. I'm wondering whether there is a similar construction for discrete logs? For example, I could imagine having something like this being the update function for the internal state: $x_{i+1} = g^{x_i} \mod p$ ...
[Take three, re-simplified, and strengthened] Improving on the line of thought in [that other answer][1], we will craft two efficiently computable functions $H_1$ and $H_2$ each accepting two arbitrary strings as input, with output a fixed-size string, say 512 bit; and (I conjecture) indistinguishable from a random ...
[Take three, re-simplified, and strengthened] Improving on the line of thought in [that other answer][1], we will craft two efficiently computable functions $H_1$ and $H_2$ each accepting two arbitrary strings as input, with output a fixed-size string, say 512 bit; and (I conjecture) indistinguishable from a random ...
[Take three, re-simplified, and strengthened] Improving on the line of thought in [that other answer][1], we will craft two efficiently computable functions $H_1$ and $H_2$ each accepting two arbitrary strings as input, with output a fixed-size string, say 512 bit; and (I conjecture) indistinguishable from a random ...
[Take four, simplified again, and using more narrow hypothesis for security] Improving on the line of thought in [that other answer][1], we will craft two efficiently computable functions $H_1$ and $H_2$ each accepting two arbitrary strings as input, with output a fixed-size string, say 512 bit; and (I conjecture) i...
[Take four, simplified again, and using more narrow hypothesis for security] Improving on the line of thought in [that other answer][1], we will craft two efficiently computable functions $H_1$ and $H_2$ each accepting two arbitrary strings as input, with output a fixed-size string, say 512 bit; and (I conjecture) i...
While reading the Wiki page on RC4 I noticed that the key size must be in the range of 40–2,048 bits. Why is that? Is there a reason it can't have a lower or higher length?
I need to send data between two applications. I've got requirement that says that data should be transmitted using secure protocol such as SSL/TLS. Data is sent using TCP sockets and I don't have built in SSL/TLS support. However, I'm able to encrypt content using AES and I'm also able to exchange small amount of data ...
Poor man's SSL - is this method as safe as SSL/TLS?
Background ------------ One issue with modern security proofs is that they are usually asymptotic. In other words, such proofs are usually formulated as follows: For any polynomial-time adversary $\mathcal A$, we can select a **large enough** security parameter $n$, such that the probability that $\mathcal A$ break...
I'm very new to cryptography (and security in general, for that matter), but I had an idea that I'm sure is very flawed, but is worth asking. If a computer user, online account, etc, needs to verify a username and password, wouldn't this work well? 1. Upon signup, ask for username and password as usual 2. Hash user...
Idea for user/pass hashing to prevent rainbow tables, would it work?
Is it good to used Blum Blum Shub Generator for Initialization Vector (IV) in Output Feedback Mode (OFB)?
Consider the following authenticate-and-encrypt scheme that uses AES-128 in CBC mode for encryption and AES-128 - based CBC-MAC for authentication: 1. Two keys are derived from the master key k (16 byte): `SHA256(k) = k1 || k2` (k1 and k2 are each 16 byte long) 2. The plaintext x is encrypted using AES-128 and ke...
Is there any 128-bit Pseudorandom number Generator available? I tried Blum Blum Shub Generator, but I can't produce a 128-bit pseudorandom number.. maybe before I produced a 128-bit Pseudorandom number, I need to input a 128-bit prime number which is hard to determine... [http://en.wikipedia.org/wiki/Blum_Blum_Shub...
Is it a good idea to use a [Blum Blum Shub][1] Generator to create my initialization Vector (IV) in AES-OFB (Output Feedback Mode)? [1]: http://en.wikipedia.org/wiki/Blum_Blum_Shub
Is the Blum Blum Shup Random number Generator suitable to create initialization vectors?
Is the Blum Blum Shub PRNG suitable to create initialization vectors?
The Blum-Blum-Shub generator is a deterministic Pseudo-Random Bit Generator with security reducible to that of integer factorization. Setup: Secretly chose random primes $P$, $Q$, with $P\equiv Q\equiv 3\pmod4$, and compute $N=P\cdot Q$. Secretly chose a random seed $x_0$ in $[1\dots n-1]$ with $\gcd(x_0,N)=1$. U...
How many bits can be safely extracted from the BBS generator at each step?
In terms of *security strength*, Is there any difference in using the SHA-256 algorithm vs using the first (or last, or middle, or any) 256 bits of the output of the SHA-512 algorithm? Similarly, what is the security difference between using SHA-224 and using 224 bits of the SHA-256 output?
"SHA-256" vs "SHA-512 then take 256 bits", which is more secure?
I want to build a secure file storage web application. Users should be sure that server doesn't know how to decrypt files so encryption should take place at client side (i.e. in Javascript) and TLS will be used. I plan to have encryption process like this: SymmetricKeyAlgo(file, AssymetricPublicKey) And de...
Is this design of client side encryption secure?
I want to build a secure file storage web application. Users should be sure that server doesn't know how to decrypt files so encryption should take place at client side (i.e. in Javascript) and TLS will be used. Also public key cryptography is required as users should have possibility to send files to each other. I ...
[Take four, simplified again, and using more narrow hypothesis for security] Improving on the line of thought in [that other answer][1], we will craft two efficiently computable functions $H_1$ and $H_2$ each accepting two arbitrary strings as input, with output a fixed-size string, say 512 bit; and (I conjecture) i...
[Take 4.2, back to requiring only the PRP to be secret] Improving on the line of thought in [that other answer][1], we will craft two efficiently computable functions $H_1$ and $H_2$ each accepting two arbitrary strings as input, with output a fixed-size string, say 512 bit; and (I conjecture) indistinguishable from...
I want to build a secure file storage web application. Users should be sure that server doesn't know how to decrypt files so encryption should take place at client side (i.e. in Javascript) and TLS will be used. Also public key cryptography is required as users should have possibility to send files to each other. I ...
It sounds like you're trying to set up a "host-proof" system. ( http://crypto.stackexchange.com/questions/1910/how-can-one-share-information-using-the-host-proof-paradigm ; http://crypto.stackexchange.com/questions/875/encryption-scheme-for-social-network-like-data-sharing-data-via-untrusted-server ; [tag:host-proof] ...
I have finally managed to verify some simple PGP signed message blocks. However, I discovered that for some reason, my implementation limits me to verifying data that is 9-16 bytes long. no less. no more. is there some instruction somewhere ([RFC4880][1] or elsewhere) that specifies how to deal with plaintext data ...
my question from stackoverflow: http://stackoverflow.com/questions/11374592/why-do-we-need-diffie-hellman Diffie–Hellman offers secure key exchange only if sides are authenticated. for authentication, sides are using public/private key. so if side A knows the public key of the side B, then A can simply use that key ...
why do we need Diffie Hellman?
There has been [some discussion][1] about it being more practical to use SSL due to advances in hardware. From my understanding, stronger public-key encryption means that both encrypting/decrypting and breaking it (via brute-force or vulnerabilities) take longer. Is the return (in security) for the performance loss ...
Is SSL getting faster because it's getting less secure?
Can't you just put random text in the first 16 bytes of your plain text, encrypt using a random IV, then during decryption use any IV and just throw away the first 16 bytes of the result?
Correct me if I'm wrong, but it sounds like the question is really, "If I encrypt a document multiple times with different keys in ECB mode, does the [common vulnerability of patterns][1] in plaintext showing in ciphertext go away?" The answer to this is no. Consider a simple cipher which has the following mappings:...
I have finally managed to verify some simple PGP signed message blocks. However, I discovered that for some reason, my implementation limits me to verifying data that is 9-16 bytes long. no less. no more. is there some instruction somewhere ([RFC4880][1] or elsewhere) that specifies how to deal with plaintext data ...
Given this description from RFC 4880 sec 5.1: > The value "m" in the above formulas is derived from the session key as > follows. First, the session key is prefixed with a one-octet algorithm > identifier that specifies the symmetric encryption algorithm used to > encrypt the following Symmetrically Encrypted Dat...
Given this description from RFC 4880 sec 5.1: > The value "m" in the above formulas is derived from the session key as > follows. First, the session key is prefixed with a one-octet algorithm > identifier that specifies the symmetric encryption algorithm used to > encrypt the following Symmetrically Encrypted Dat...
Given this description from RFC 4880 sec 5.1: > The value "m" in the above formulas is derived from the session key as > follows. First, the session key is prefixed with a one-octet algorithm > identifier that specifies the symmetric encryption algorithm used to > encrypt the following Symmetrically Encrypted Dat...
Given this description from RFC 4880 sec 5.1: > The value "m" in the above formulas is derived from the session key as > follows. First, the session key is prefixed with a one-octet algorithm > identifier that specifies the symmetric encryption algorithm used to > encrypt the following Symmetrically Encrypted Dat...
In terms of *security strength*, Is there any difference in using the SHA-256 algorithm vs using *any random* 256 bits of the output of the SHA-512 algorithm? Similarly, what is the security difference between using SHA-224 and using *any random* 224 bits of the SHA-256 output?
"SHA-256" vs "any 256 bits of SHA-512", which is more secure?
I see there's a [project][1] to combine [Quantum Key Distribution][2], [Physical Unclonable Functions][3], and classical crypto, in order to secure a high speed (100Gb/s) link. On the face of it, this seems a reasonable attempt to solve one of the problems of QKD: it is by itself _not_ secure against a [Man-In-The-Midd...
How do QKD and PUF combine?
I see there's a [project][1] to combine [Quantum Key Distribution][2], [Physical Unclonable Functions][3], and classical crypto, in order to secure a high speed (100Gb/s) optical link. On the face of it, this seems a reasonable attempt to solve one of the problems of QKD: it is by itself [_not_ secure][4] against a [Ma...
How do Quantum Key Distribution and Physical Unclonable Functions combine?
I want to build a secure file storage web application. Users should be sure that server doesn't know how to decrypt files so encryption should take place at client side (i.e. in Javascript) and TLS will be used. Also public key cryptography is required as users should have possibility to send files to each other. I ...
I see there's a [project][1] to combine [Quantum Key Distribution][2], [Physical Unclonable Functions][3], and classical crypto, in order to secure a high speed (100Gb/s) optical link. On the face of it, this seems a reasonable attempt to solve one of the problems of QKD: it is by itself [_not_ secure][4] against a [Ma...
I checked RSA's patent application, which was registered in 1983. As patents don't last more than 20 years, it seems to me it should be free. But my friend said to use RSA I have to buy a license from MIT. Is it true ?
RSA algorithm's license free or paid?
I see there's a [project][1] to combine [Quantum Key Distribution][2], [Physical Unclonable Functions][3], and classical crypto, in order to secure a high speed (100Gb/s) optical link. While there does not seem to be a direct combination of QKD and PUF in that particular project, I wonder if that combination could b...
Do Quantum Key Distribution and Physical Unclonable Functions combine, and how?
Consider the following authenticate-and-encrypt scheme that uses AES-128 in CBC mode for encryption and AES-128 - based CMAC for authentication: 1. Two keys are derived from the master key k (16 byte): `SHA256(k) = k1 || k2` (k1 and k2 are each 16 byte long) 2. The plaintext x is encrypted using AES-128 and key k...
You are correct, anyone can use it without asking for permission or paying anybody. The RSA patent [US 4,405,829][1] expired in 2000, and the RSA algorithm was never patented anywhere else (because the rest of the world won't allow you to patent something that has already been published; the US gives you a year). ...
we normally always encrypt by public key and decrypt with private key. -first question is if i encrypt with private key, then its still secure as normal PKI ? i mean known-plain-text will not take private key on the risk ? (for example when people know the plain text and signed message with private key, then privat...
Encryption with private key?
we normally always encrypt by public key and decrypt with private key. 1. If i encrypt with private key, then its still secure as normal PKI ? i mean known-plain-text will not take private key on the risk ? (for example when people know the plain text and signed message with private key, then private key is safe or...
Well, first of all, this is not a generic 'public-key' question. With RSA, it can make sense to talk about 'encrypting with the private key', for most other public key algorithms, there's isn't an obvious interpretation. For example, with DSA, the public key operation (which is a signature verification) is 'plug the ...
When we talk about nonce in Initialization Vector(IV), is it required to used numbers only? not any letters or special characters?
**SHA-512 truncated to 256 bits is as safe as SHA-256 as far as we know**. The NIST did basically that with SHA-512/256 introduced March 2012 in [FIPS 180-4][1] (because it is faster than SHA-256 when implemented in software on many 64-bit CPUs). SHA-224 is just as safe as using 224 bits of SHA-256, because that's basi...
I see there's a [project][1] to combine [Quantum Key Distribution][2], [Physical Unclonable Functions][3], and classical crypto, in order to secure a high speed (100Gb/s) optical link. While there does not seem to be a direct combination of QKD and PUF in that particular project, I wonder if that combination could b...
if Alice want to send a message to Bob with digital signatures , Mallory can send its public key to Bob acting as Alice to send message to Bob and signature verify. but lets say Alice send its public key to Bob when Mallory is still sleeping, Mallory still can send spoofed message to Bob with advanced methods ? si...
can we trust signatures?
I'm working on a background entropy collector for key generation that monitors hardware and produces an entropy pool. Here's my list of sources: - Mouse position - Keyboard timings (i.e. time between keystrokes) - Network - Bytes sent - Bytes received - Datagrams sent - Datagrams received -...
Entropy of system data - use all and hash, or trim least significant bits?
I'm working on a background entropy collector for key generation that monitors hardware and produces an entropy pool. Here's my list of sources: - Mouse position - Keyboard timings (i.e. time between keystrokes) - Network - Bytes sent - Bytes received - Datagrams sent - Datagrams received -...
I need to derive a key from a username and a password. These are the only two things I have access to. What I thought is using PBKDF2 with username as the salt and password as the master password. Could someone help me evaluate / confirm this solution in terms of security?
Consider that Alice wants to send a digitally signed message to Bob. Mallory might be able to publish his public key under Alice's name and then impersonate Alice to send a message with an apparently valid signature. But let's assume that Bob already has received Alice's correct public key. Can Mallory still send ...
Can we trust digital signatures?
I need to derive a key from a username and a password. These are the only two things I have access to. What I thought is using PBKDF2 with username as the salt and password as the master password. Could someone help me evaluate / confirm this solution in terms of security? **Update:** Since the salts are required...
I am doing a research about secure communication protocols. I would be interested to know whether a protocol exists such that it grants that the two end-points taking part to the communication cannot be traced (i.e. They can deny the communication ever took part). Can anyone point out any relevant publication? ...
I am doing a research about secure communication protocols. I would be interested to know whether a protocol exists such that it grants that the two end-points taking part to the communication cannot be traced (i.e. They can deny the communication ever took part). Can anyone point out any relevant publication?
To the best of my knowledge there is no formal distinction, since "password hashes" aren't formally defined. That said, if you look at [this presentation from the author of scrypt][1] you'll see that he wanted: 1. Password hashing to be **CPU hard** (i.e. to require significant amounts of CPU processing, in a ma...
I understand that password hashes like [bcrypt](http://en.wikipedia.org/wiki/Bcrypt) have the principal property of taking a long time to run, but I'm wondering what if anything about password hashes make them superior to merely running a fast cryptographic has a bunch of times. In particular, why does bcrypt exist ...
What differentiates a password hash from a cryptographic hash besides speed?
I am developing a symmetric en-/decryption routine written in c# for a database containing user-specific, sensitive information. I have narrowed down the implementation to 3 different approaches, but simply cannot determine which is the "best". So, which of these is the most secure? 1. AES in GCM mode. Using ...
Which of these 3 AES 128 symmetric encrypt/decrypt routines is most secure?
I am trying to build a hash function computationally indistinguishable from random (thus collision-resistant and preimage-resistant), with input a message $M$ of fixed size $|M|=m\cdot b$ bits, and output the hash $H(M)$ of fixed size $|H(M)|=h\cdot b$ bits, using as the single primitive a $b$-bit block cipher with key...
Hash function from narrower block cipher operated in CBC-encryption mode?
I am developing a symmetric en-/decryption routine written in c# for a database containing user-specific, sensitive information. I have narrowed down the implementation to 3 different approaches, but simply cannot determine which is the "best". So, which of these is the most secure? 1. AES in GCM mode. Using ...