instruction
stringlengths
15
30k
Let $E_k$ : {0,1}$^l$ be a block cipher encryption function with block-size $l$ and key-length $n$. In class, we saw that a double encryption with two independent keys $E{}'_{k_1k_2}(x)$ = $E_{k_1}(E_{k_2}(x))$, can be brute-forced in $O(2^n)$ time and $O((l + n)2^n)$ space using the meet-in-the-middle attack: ...
Basically my knowledge in passwords consist of setting up a [Diceware][1] master password back then, and I know hashes are not convertible back to the original password. Some basic question I want to know the answer for is how can a password be predicted from the hash? Like it can be known how many characters long i...
Where can I leary basic cryptography to know more about passwords and Bitcoin?
Hint: suppose someone told you $n-m$ bits of $k_2$; how much time/space would a meet-in-the-middle attack take then?
Forgive me if this has been asked before, I looked but haven't seen any answers that suit. Is there any danger in using cbc, encrypting a message plus one initial block of garbage, discarding the iv, and when decrypting, use any random IV, and then discard the resulting initial plaintext block? I'm sure I'm not ...
why not use cbc, not send IV, and assume first plaintext block is garbage?
Sure you can do that and it would work just fine, but why would you do it? It doesn't save any on the communications side of the house as you still have to communicate the garbage ciphertext block. On the computation side of things, if you decrypt that garbage block and throw it away, you have made one additional ca...
Rather, is it possible for big prime numbers? Classroom examples usually involve smaller primes so for example if you are given a prime number pair 3,13 you would get (39,5) for both private and public keys, making encryption and decryption the same for a message x or cipher x. This can be a big problem, e.g. if a serv...
What happens if an RSA public+private key pair is the same?
Forgive me if this has been asked before, I looked but haven't seen any answers that suit. Is there any danger in using CBC, encrypting a message plus one initial block of garbage, discarding the IV, and when decrypting, use any random IV, and then discard the resulting initial plaintext block? I'm sure I'm not t...
Why not use CBC, not send IV, and assume first plaintext block is garbage?
The proper precautions, this is an acceptable way to implement CBC (and yes, it interoperates with the more traditional implementation of CBC, at least, implementations of CBC that put the IV immediately in front of the ciphertext). The proper precaution is to make sure, in the encrypt direction, that the value of t...
This is not an answerable question. The requirements for a P-box (whatever that is) depend upon the cipher it is embedded in; that cipher imposes some requirements on the P-box. Therefore, you cannot do P-box design in the abstract, without knowing what the requirements are. There is no one, single answer that is va...
I don't have any experience with this myself, Tom Ritter talked about [this on twitter](https://twitter.com/TomRittervg/status/263652369257070593): > **Matthew Green:** Out of curiosity: do you happen to know offhand how much it costs to factor a 512-bit RSA key on EC2? > **Tom Ritter:** My personal costs are $12...
I don't have any experience with this myself, but Tom Ritter talked about [this on twitter](https://twitter.com/TomRittervg/status/263652369257070593): > **Matthew Green:** Out of curiosity: do you happen to know offhand how much it costs to factor a 512-bit RSA key on EC2? > **Tom Ritter:** My personal costs are...
At the core of your question is a concept called "[entropy][1]", which is the amount of uncertainty or unpredictability in a set of data. It's strongly related to Shannon entropy, which is "how much information is contained in this data?" In cryptography, entropy is related to probabilities, expressed in terms of...
My Friend and I have been generating a few ssh2-rsa keys and noticed that all the public keys began with "AAAAB3NzaC1yc". The similarity extended to "AAAAB3NzaC1yc2EAAAABIwAAAQEA" between two keys I generated on the same machine on two successive attempts. I can even google "AAAAB3Nz" and end up getting a few hits. ...
Why do all SSH-RSA Keys begin with "AAAAB3NzaC1yc"?
I'm wondering why RSA encryption usually is only used for messages that fit into one block. For larger messages hybrid encryption in combination with symmetric ciphers like AES seem to be the solution of choice e.g. c.f. [Bouncy castle FAQ](http://www.bouncycastle.org/wiki/display/JA1/Frequently+Asked+Questions). ...
Where can I learn basic cryptography to know more about passwords and Bitcoin?
What Blinding does & Where we usually using it ? can you describe a sample implantation ?
What Blinding does and where do we usually use it? Can you describe a sample implantation?
What's "Blinding" used for in cryptography?
Examples of applications that use the Schnorr digital signature?
How can we determine if two discret logarithms are equal?
Can the [knapsack][1] be used in cryptography in a secure sense (described below)? **Knapsack problem:** Given some number $X$ and a set $W$ of weights $w_1, w_2, ... w_n$, find a subset $S$ of $W$ whose weights sum to $X$. Even though this problem is NP hard, there exist ["pseudo-polynomial-time][2]" algorithms...
How secure is the knapsack? (non-public key use)
Can the [knapsack][1] be used in cryptography in a secure sense (described below)? **Knapsack problem:** Given some number $X$ and a set $W$ of weights $w_1, w_2, ... w_n$, find a subset $S$ of $W$ (if it exists) whose weights sum to $X$. Even though this problem is NP hard, there exist ["pseudo-polynomial-time]...
How secure is the knapsack?
I have noticed that some programs used for file encryption will tell you if an entered key is wrong when you try to decrypt. It seems (to me at least) that this would mean that the key somehow is written into the encrypted file. And the algorithms that I know of will produce an output even if the key is wrong. 1. H...
How and why can a decryption program tell me that a key is incorrect?
Dispite their theoretical security advantages, Schnorr signatures aren't very popular. Probably because they were patented. Since the patents recently expired they might rise a bit in popularity. But probably only in the elliptic curve form, and not in finite fields. I don't know of any application actually using Sc...
Despite their theoretical security advantages, Schnorr signatures aren't very popular. Probably because they were patented. Since the patents recently expired they might rise a bit in popularity. But probably only in the elliptic curve form, and not in finite fields. I don't know of any application actually using Sc...
I am doing a course on cryptography on coursera and one of the topics covered was the ElGamal Encryption system. I am using the terms as defined in [Wikipedia][1]. Alice publishes $g$ and $g^x$. Theoretically an attacker could calculate $g^i$ for all $i$ from 0 to $n$. At some point the attacker will get the value...
Why can't I break ElGamal encryption by brute-forcing the secret exponent?
Despite their theoretical security advantages, Schnorr signatures aren't very popular. Probably because they were patented. Since the patents expired in 2008 they might rise a bit in popularity. But probably only in the elliptic curve form, and not in finite fields. I don't know of any application actually using Sch...
Can the [knapsack][1] be used in cryptography in a secure sense (described below)? **Knapsack problem:** Given some number $X$ and a set $W$ of weights $w_1, w_2, ... w_n$, find a subset $S$ of $W$ (if it exists) whose weights sum to $X$. Even though this problem is NP hard, there exist ["pseudo-polynomial-time]...
Unless 2^t is the order of 2 in the group Zn, in which case the solution is trivial Unless the factors of n are known, in which case the Chinese remainder theorem can be used, Unless n (or its factors) has a spexcial form, with only a few sparse bits being set e.g n = 2^a + 2^b + 1 and similar cases where n has o...
What does "blinding" mean in cryptography, and where do we usually use it? Can you describe a sample implementation?
What is "Blinding" used for in cryptography?
How can we determine if two discrete logarithms are equal?
Unless $2^t$ is the order of $2$ in the group $\mathbb Z_n$, in which case the solution is trivial. Unless the factors of $n$ are known, in which case the Chinese remainder theorem can be used. Unless $n$ (or its factors) has a special form, with only a few sparse bits being set (e.g. $n = 2^a + 2^b + 1$) and sim...
I want to combine two or more keys to create a single encryption key that relies on all of them. What is the proper method for doing that? Simple XOR? Using hash functions? Something else? I personally used this: k = md5( key1 || key2 ). Note: || means concatenation. I used md5 because I use 128-bit encryption a...
Can the [knapsack][1] be used in cryptography in a secure sense (described below)? **Knapsack problem:** Given some number $X$ and a set $W$ of weights $w_1, w_2, ... w_n$, find a subset $S$ of $W$ (if it exists) whose weights sum to $X$. Even though this problem is NP hard, there exist ["pseudo-polynomial-time]...
It may be possible to use the knapsack problem to build a secure cryptosystem, though experience suggests it is tricky and delicate. There are many known algorithms for attacking the knapsack problem, which may or may not work, depending upon the specific parameters you choose. Therefore, the security of the scheme w...
Can the [knapsack][1] be used in cryptography in a secure sense (described below)? **Knapsack problem:** Given some number $X$ and a set $W$ of weights $w_1, w_2, ... w_n$, find a subset $S$ of $W$ (if it exists) whose weights sum to $X$. Even though this problem is NP hard, there exist ["pseudo-polynomial-time]...
Can we use Threshold scheme to construct an (yes/no)-election protocol, such that every voter can give a positive or negative vote or he can abstain, and such that only the result of the election is revealed, but the number of positives, negatives and abstains stays secret? Is there some alternatives to do this with...
How to construct yes/no - election protocol, such that only the result is revealed?
Let's define the following block cipher: $C_n = M_n \oplus H(k + n)$ where $C_n$ is the nth block of ciphertext, $M_n$ is the nth block of plaintext, $H$ is a cryptographic hash function, and $k$ is the secret key. Decryption can be performed trivially, by computing $M_n = C_n \oplus H(k + n)$. Assuming a prop...
Is it possible to break a hash-based block cipher?
hash trees can provide quantum resistant signatures to replace RSA for signing securely ? how much is the key size and how many time we can use same key ?
Can hash trees can provide quantum resistant signatures to replace RSA for signing securely? What is the key size and how many times can we use same key?
Are hash trees an alternative, quantum-resistant signature scheme which can replace RSA?
As the title states, would the One Time Pad (OTP) be considered a cryptographic hash function?
Is the One Time Pad (OTP) considered a cryptographic hash function?
When using Encrypt-then-mac with AES and HMac by password, and given 128 bits of payload with the ciphertext to store a random salt, which would be more secure: * Using PBKDF2 with then entire 128 bit random salt and generating 512 bytes of derived data to split into a 256 bit Aes Key and a 256 bit Hmac key. ...
How to salt PBKDF2, when generating both an Aes key and a HMac key for Encrypt then Mac?
When using Encrypt-then-mac with AES and HMac by password, and given 128 bits of payload with the ciphertext to store a random salt, which would be more secure: * Using PBKDF2 with then entire 128 bit random salt and generating 512 bits of derived data to split into a 256 bit Aes Key and a 256 bit Hmac key. o...
When using Encrypt-then-MAC with AES and HMAC by password, and given 128 bits of payload with the ciphertext to store a random salt, which would be more secure: * Using PBKDF2 with then entire 128 bit random salt and generating 512 bits of derived data to split into a 256 bit AES Key and a 256 bit HMAC key. or ...
How to salt PBKDF2, when generating both an AES key and a HMAC key for Encrypt then MAC?
Kryptos : K1. What is the origin of the "palimpsest" keyword?
LastPass encrypts its data before sending it to their servers. The key for the data is generated using a combination of the master password and username. How then can a one-time password be used to decrypt this data? The data on the server has been encrypted with the master password and username. Does this mean that...
The only people who can answer your question definitively are the programmers at LastPass, however, I'll try. I assume you're referring to [this][1]. If LastPass really does encrypt your data with your [password/username][2], then logically it could only be decrypted with the same key. Their 'one-time' password f...
Rather, is it possible for big prime numbers? Classroom examples usually involve smaller primes, so for example if you are given a prime number pair $p = 3$, $q = 13$ you would get $n = 39$ and $e = d = 5$, making encryption and decryption the same for a message $x$ or ciphertext $x$. This can be a big problem, e...
What happens if an RSA key pair has identical public and private exponents?
The question of implementing peer to peer mental poker has already been asked on [stackoverflow][1]. And there appears to be an implementation called [LibTMCG][2]. Also on this site a [question][3] was asked about problems such as clients disconnecting or refusing to act (show cards, bet/check/fold). LibTMCG seemed ...
A while ago, I came across the problem of trying to systematically reduce "RNG abuse" in the competitive battling environment of Pokémon (which, for anyone who's into this stuff, runs quite rampant) while developiong an engine for the game. For anyone who's not familiar, "RNG abuse" is tricking the pseudorandom number ...
First off, many block modes of operation require a message to be padded so that its length is evenly divisible by the block size of the cipher. CBC mode (Cipher Block Chaining), for instance, typically pads a message either with an entire block of zeroes if it happens to be exactly divisible by the block size, or with ...
First off, many block modes of operation require a message to be padded so that its length is evenly divisible by the block size of the cipher. CBC mode (Cipher Block Chaining), for instance, typically pads a message either with an entire block of zeroes if it happens to be exactly divisible by the block size, or with ...
as you can see [*here*][1] , cryptographic algorithms performance is determinate by cycle per byte for symmetric ciphers and cycle per operation for asymmetric ciphers. what is cycle meaning exactly ? and is that always same amount of cycles for one AES or RSA decryption or it can be different cycles every time ? (...
What does cycle mean in cryptography benchmarks?
as you can see [*here*][1] , cryptographic algorithms performance is determinate by cycle per byte for symmetric ciphers and cycle per operation for asymmetric ciphers. what is cycle meaning exactly ? and is that always same amount of cycles for one AES or RSA decryption or it can be different cycles every time ? (...
First off, many block modes of operation require a message to be padded so that its length is evenly divisible by the block size of the cipher. CBC mode (Cipher Block Chaining), for instance, typically pads a message either with an entire block of zeroes if it happens to be exactly divisible by the block size, or with ...
I'm attempting to encrypt some information into our database to be later pulled back out and displayed to the user. Searching and reading up on different methods I found a post over at stack exchanged with example code for doing AES Encryption. http://stackoverflow.com/questions/165808/simple-2-way-encryption-for-c-...
In [this table][1], for example, cryptographic algorithm performance is measured in cycles per byte for symmetric ciphers, and in cycles per operation for asymmetric ciphers. What does "cycle" here mean, exactly? And does one AES or RSA decryption always need the same amount of cycles, or can it be different every ...
What does a "cycle" mean in cryptography benchmarks?
The textbook proof for Elgamal encryption basically reduces to the Decisional Diffie-Hellman assumption (DDH). Elgamal: $Gen(.): x \xleftarrow{R} \mathbb{Z}_p$; $Enc(m,g^x): r \xleftarrow{R} \mathbb{Z}_p, U= m.(g^x)^r, V = g^r$; $Dec(U,V,x): m = U/V^x$. Suppose I prove the secure of Elgamal (in the CPA securit...
Why does proof-by-reduction needed (for Elgamal proof of security, for example)?
I want to generate a few random numbers using an LFSR. However, the LFSR output depends on the number of taps, so for a large period I use large (relative) number of bits. This causes the numbers to be as large as the period. For example, I would like to use a 16-bit LFSR to generate random 5-bit numbers. What is the p...
Why is proof-by-reduction needed (for Elgamal proof of security, for example)?
>Why is proof-by-reduction needed? In general, reduction proofs are a very common thing in computer science. Specifically in cryptography, the reasoning goes something like this: >The general cryptographic community believes that problem $X$ is very difficult to solve. I have designed a new cipher $Y$ and want t...
In regards to NaCl, I [asked DJB](https://twitter.com/hashbreaker/status/289234463311925249) he had any intent to add a streaming API to an authenticated cipher. His response was obvious in retrospect, that one should never release a decrypted plaintext before verifying the authenticator. However, this got me to thi...
This is **not a programming question**, but i'm trying to understand an algorithm I want to implement. I'm trying to implement an evoting algorithm, which is described at the paper "Internet Voting Protocol Based on Improved Implicit Security" by Abhishek Parakh & Subhash Kak. At the Example 1 described at the paper...
Can anyone shed some light onto the advantages/disadvantages of using Rijndael with 256-bit block size, as opposed to the 128-bit (AES) implementation? (please note: I'm not referring to key-size here). These are standard implementations in Mcrypt. I'm vaguely aware that a larger block size can help to mitigate s...
Difference between Rijndael 128 / 256 blocksize implementations? (and impact of block size in general)
I'm trying to implement an e-voting algorithm, which is described at the paper "Internet Voting Protocol Based on Improved Implicit Security" by Abhishek Parakh & Subhash Kak. At the Example 1 described in the paper where we have m1=85, at the step 2 it says "2. Choose randomly and uniformly a number r1 = 101 an...
What does modular inversion mean?
> I'm just curious to know why the 128-bit version become the standard[.] That question is easy to respond. In the section [Minimum Acceptability Requirements](http://csrc.nist.gov/archive/aes/pre-round1/aes_9709.htm#sec3) of **Request for Candidate Algorithm Nominations for the AES**, it says: > The candidate al...
I want to generate a few random numbers using an LFSR. However, the LFSR output depends on the number of taps, so for a large period I use large (relative) number of bits. This causes the numbers to be as large as the period. For example, I would like to use a 16-bit LFSR to generate random 5-bit numbers. What is the p...
Contrary to what's stated in the question and its comments, extracting any $m\le n$ bits from the sequence of the states of an $n$-bit LFSR still result in a sequence with period $2^n-1$, assuming the state of the $n$-bit LFSR is not zero and its generating polynomial is primitive. Proof sketch: by a fundamental proper...
Contrary to what's stated in the question and its comments, extracting any $m\le n$ bits from the sequence of the states of an $n$-bit LFSR still result in a sequence with period $2^n-1$, assuming the state of the $n$-bit LFSR is not zero and its generating polynomial is primitive. Proof sketch: by a fundamental proper...
Contrary to what's stated in the question and its comments, extracting any $m\le n$ bits from the sequence of the states of an $n$-bit LFSR still result in a sequence with period $2^n-1$, assuming the state of the $n$-bit LFSR is not zero and its generating polynomial is primitive. Proof sketch: by a fundamental proper...
Can anybody help me to understand elgamal based decryption mexnet? Pure elgamal can be used in mixnet(re-encryption mixnet) and its very easy and i have implemented decryption mixnet using RSA also. https://docs.google.com/viewer?a=v&q=cache:oPBtOQjGQqYJ:courses.csail.mit.edu/6.897/spring04/L18.pdf+&hl=en&gl=bd&pid...
I've already sent my correct solution to a programming question on an online class: > Let us see what goes wrong when a stream cipher key is used more than once. Below are eleven hex-encoded ciphertexts that are the result of encrypting eleven plaintexts with a stream cipher, all with the same stream cipher key. You...
I've already sent my correct solution to a programming question on an online class: > Let us see what goes wrong when a stream cipher key is used more than once. Below are eleven hex-encoded ciphertexts that are the result of encrypting eleven plaintexts with a stream cipher, all with the same stream cipher key. You...
Can anybody help me to understand elgamal based decryption mixnet? Pure elgamal can be used in mixnet (re-encryption mixnet) and its very easy, and I have implemented decryption mixnet using RSA also. See for example, http://courses.csail.mit.edu/6.897/spring04/L18.pdf But I am failed to gather any idea on the i...
OK, I have a shadow file with a password that I know, it is 4 letters followed by two numbers. Using John The Ripper with OpenCL support, on a laptop with AMD Radeon Mobility graphics, how long would it take to brute-force it? What speed should I expect?
Suppose I devised the following challenge-response proof-of-work system: A server generates a 2048-bit RSA modulus, and uses the *public* exponent (usually 65537) to sign a random nonce a fixed number of times, say, 256. The server then sends the signed nonce to the client, along with the *private* exponent (whic...
Is it safe to use RSA as a proof-of-work system?
> Is this usable? Or does the generation of the modulus outweigh any > gains in the difference in signing time? Yes, it does work to some extent, and the generation cost isn't too important, because signing any one nonce doesn't help the client sign any other nonce, so you can just use a single key all the time (if...