instruction
stringlengths
15
30k
If I don't err, in the literature a stream cipher is one in which each plaintext bit is processed individually, commonly via xor-ing with one bit of a random or pseudo-random bit stream, while a block cipher (in ECB mode, i.e. ignoring the add-on processing operations like CBC etc.) operates on n bits at a time with op...
Why is there a strong distinction between stream and block ciphers?
If I don't err, in the literature a stream cipher is one in which each plaintext bit is processed individually, commonly via xor-ing with one bit of a random or pseudo-random bit stream, while a block cipher (in ECB mode, i.e. ignoring the add-on processing operations like CBC etc.) operates on n bits at a time with op...
Mathematically, a block cipher is just a keyed [pseudorandom permutation](http://en.wikipedia.org/wiki/Pseudorandom_permutation) family on the set $\{0,1\}^n$ of $n$-bit blocks. (In practice, we usually also require an efficient way to compute the inverse permutation.) A block cipher _on its own_ is not very useful f...
If I don't err, in the literature a stream cipher is one in which each plaintext bit is processed individually, commonly via xor-ing with one bit of a random or pseudo-random bit stream, while a block cipher (in ECB mode, i.e. ignoring the add-on processing operations like CBC etc.) operates on n bits at a time with op...
Ok. Untill what I have gotten is: A PRG is generator is a part of PRF that produces Psuedo-random values for the function. PRF is semantically secure and has no worries of being invertible. Fine, then where is PRP used? What is PRP, where it comes to, how it benefits. Wired question may be. :)
Asuming this scenario: Bob and Alice each have the public key of the other party for a D-H function and want to exchange data. Now, if they each generate their shared secret, is it safe to assume that: - They can exchange messages safely without the fear of a MITM - Can reuse the shared secret n times An...
Ok. Until what I have gotten is: A PRG is generator is a part of PRF that produces pseudo-random values for the function. PRF is semantically secure and has no worries of being invertible. Fine, then where is PRP used? What is PRP, where it comes to, how it benefits.
Denote C is cipher text, m is message, and PRG(k) is a psuedo randomize generator, generate an key. Because we have : C1 = m1 xor PRG(k) C2 = m2 xor PRG(k) --> C1 xor C2 = m1 xor m2 So, this is a problem because if m1 and m2 is a real text (a text that is in normal life) and use ASCII, ...
> **Possible Duplicate:** > [Taking advantage of one-time pad key reuse?](http://crypto.stackexchange.com/questions/59/taking-advantage-of-one-time-pad-key-reuse) > [How does one attack a two-time pad (i.e. one time pad with key reuse)?](http://crypto.stackexchange.com/questions/2249/how-does-one-attack-a-two-time-...
Why we need bilinear groups of composite order? What's the special security property of the composite order group in comparison with one of prime order?To put it in another way when do we need composite order groups for bilinear maps and when prime order?
when do we need composite order groups for bilinear maps and when prime order?
I have been wondering what approach to take in order to figure out what key was used to encrypt a message using the hill cipher. I know it is possible to obtain it even if it were just a known-plaintext attack, so it should be fairly possible for a chosen-plaintext one. I'm trying to figure it out with just intuiti...
I just learnt that when using CBC encryption with a random IV which is predictable is not secure. From what I understand, using certain plain texts, and then guessing the IV that is uses, the attacker can verify if the IV he guessed was right. How does this qualify as an attack ?
At present, all FHE scheme are be constructed based on circuit approach. Can we construct fully homomorphic encryption scheme based on non-circuit approach? Is Polly cracker non-circuit approach ?
Can we construct fully homomorphic encryption scheme based on non-circuit approach?
I can't get the point of prime order bilinear pairings:$\mathbb{G}\times\mathbb{G}\rightarrow\mathbb{G}_T$,$g=$ generator of $\mathbb{G}$ , $N=p*q$, $p$ and $q$ primes and $e(g,g)^N=1$. why $e(g,g)^N=1$ holds? Why is it 1?
why $e(g,g)^N=1$ in bilinear pairings holds?
This is about the new W3 WebcryptoAPI draft standard. Here is a post by one of it's authors https://plus.google.com/u/0/105761279104103278252/posts/CSwVZ1RUijo It says its in part trying to change the "Javascript Cryptography Considered Hamrful" problem. However if you look at the "Javascript Cryptography Con...
>Is Polly cracker non-circuit approach? Polly Cracker is non-circuit. >Can we construct fully homomorphic encryption scheme based on non-circuit approach? The best info for this I could find comes from a [recent paper proposing a non-circuit approach due to Xiao, et al.][1]. They identify a number of non...
I just learned that using CBC encryption with an IV which is predictable is not secure. From what I understand, using certain plain texts, and then guessing the IV that is uses, the attacker can verify if the IV he guessed was right. How does this qualify as an attack?
I am using tree hash mode of skein SHA3 on a 16 core processor. Will it automatically employ parallelism using more than one cores or do I have to use multithreading within the tree hash for parallel processing? Also, the tree hash mode requires three parameters: leaf size encoding, fan-out encoding and tree height. ...
Simply put, what does perfect secrecy means?
From what I've found, it is generally accepted a cryptographic hash function like SHA-2 has an evenly, randomly distributed output. Is there a way to test this without running through the entire 2^512 keyspace? Generate a large number of high-quality 512 bit random numbers? What about random 64 character "keyboard a...
How to test distribution of a hash function?
Well, for one, SHA-2 (either SHA-256 or SHA-512) doesn't have a 'keyspace'; that's because it doesn't have a key. SHA-2 takes an arbitrary bitstring is input, and generates an output; while there are limits on how long the bitstring can be, those limits are so huge ($2^{64}-1$ bits for SHA-256, $2^{128}-1$ bits for SH...
Got this example online In the elliptic curve group defined by y2 = x3 + 9x + 17 over F23, What is the discrete logarithm k of Q = (4,5) to the base P = (16,5)? One (naï­ve) way to find k is to compute multiples of P until Q is found. The first few multiples of P are: P = (16,5) 2P = (20,20) 3P = (14...
Got this example online In the elliptic curve group defined by $y^2 = x^3 + 9x + 17$ over $\mathbb{F}_{23}$, What is the discrete logarithm k of Q = (4,5) to the base P = (16,5)? One (naï­ve) way to find k is to compute multiples of P until Q is found. The first few multiples of P are: P = (16,5) 2P ...
is this RSA private key valid? First, here's the RSA private key in question: -----BEGIN RSA PRIVATE KEY----- MIICXwKBAQACgYDDlegCjkr+Fwf48IVDJimiQdYrpDbrlyMazVeP88ELQLQrTUp/ BrCeC82CUFOyjjbuJagixYsuHhgueS3g/NXrR7XulWBjE2BruSeek8hmK+Ch+jzu SMT+WbFIiUDHfJoERUHF02nJ12vFSuJ435/4+7vr/7zAo2M2E76et7a...
is this RSA private key valid?
I've been trying to understand cryptographic protocols and how to define their security. The problem is that while I can understand what the intuitive definition says, I have trouble understanding how this can be rigorously defined in terms of mathematics. In other words, how do we get a definition that can be used in ...
Exact mathematical definition of simulation based security?
is this RSA private key valid? First, here's the RSA private key in question: -----BEGIN RSA PRIVATE KEY----- MIICXwKBAQACgYDDlegCjkr+Fwf48IVDJimiQdYrpDbrlyMazVeP88ELQLQrTUp/ BrCeC82CUFOyjjbuJagixYsuHhgueS3g/NXrR7XulWBjE2BruSeek8hmK+Ch+jzu SMT+WbFIiUDHfJoERUHF02nJ12vFSuJ435/4+7vr/7zAo2M2E76et7a...
This is, as you guessed, an incorrectly encoded key. I suspect that OpenSSL ASN.1 decoder is written to assume that the modulus (and other parameters) is always positive, and so interprets them as if they were (that is, interprets them as if the leading 00 byte was there); hence it just happens to work. Now, what d...
Let assume two participants Alice and Bob who perform a given protocol which is a sequence of messages exchange between them. My question is: How can I provide a secure and authentic communication channel using cryptography, so that when Bob sends a message "M" to Alice, the latter will be able to know whether or no...
How does one provide a secure and authentic communication channel?
$\def\dbl{\mathrm{dbl}}$Okay, let's give the missing step between mikeazo's and poncho's answers. I assume you've read Poncho's answer to know how to add and double points. Now, how do we get a scalar multiple of a point? A simple algorithm is called "[double-and-add][1]", as it just does this. In a simple ...
I found [this example][1] online: > In the elliptic curve group defined by > $$y^2 = x^3 + 9x + 17 \quad \text{over } \mathbb{F}_{23},$$ > what is the discrete logarithm $k$ of $Q = (4,5)$ to the base $P = (16,5)$? > > One (naï­ve) way to find k is to compute multiples of $P$ until $Q$ is found. > The first ...
How does one calculate the scalar multiplication on elliptic curves?
$\def\dbl{\mathrm{dbl}}$Okay, let's give the missing step between mikeazo's and poncho's answers. I assume you've read mikeazo's answer to know how to add and double points. Now, how do we get a scalar multiple of a point? A simple algorithm is called "[double-and-add][1]", as it just does this. In a simple...
I am working on application that allows users to upload files containing company data and then share those files with a list of other users that have specific roles within the system. I want to encrypt the uploaded files to protect the data at rest while allowing the files to be shared by people who do not know the...
How to avoid a chicken and egg scenario with encrypting passwords?
A good block cipher e.g. AES running in counter mode is commonly considered to be secure. Assuming a perfectly random key, one could in this case from 128 bits generate up to 2^128*128 bits for stream encryption. However these bits could evidently have only 1/(2^128) bit of entropy each on the average. Isn't it a parad...
How could block encryption in counter mode be secure from viewpoint of entropy?
It's a quite a weak cipher, being better than a simple substitution cipher by only using digraphs instead of monographs. An interesting weakness is the fact that a digraph in the ciphertext (AB) and it's reverse (BA) will have corresponding plaintexts like UR and RU (and also ciphertext UR and RU will correspond to ...
Was wondering what is the best algorithm to encrypt files and send them over network (that kind of algorithm that doesn't make the file larger ? , and is fast enough to handle large files) ? Thanks :)
what is the best algorithm for file encryption to send over network?
As fgrieu notes, the problem as specified is unsolvable: if the server alone should not be able to decrypt the files, then there must be something (in this case, the password) possessed by the user but not the server which is needed to decrypt them. If the user loses this extra information, there's no way the server c...
I would like to use unpadded RSA for homomorphic encryption in a toy P2P game, for things like fair coin flips and shuffling. How many bits of security does unpadded RSA have in relation to its key size? [Wikipedia][1] [1]: http://en.wikipedia.org/wiki/Homomorphic_encryption#Unpadded_RSA
What is the strength of unpadded RSA?
The answer to the question: > Is there any way to store private keys that are encrypted with a users clear text password and still have a way when resetting a password to preserve access to the users data is actually **yes**. Simply store two copies of each private key - one encrypted with the user's password and...
I would like to use [unpadded RSA for homomorphic encryption][1] in a toy P2P game, for things like fair coin flips and shuffling. How many bits of security does unpadded RSA have, in relation to its key size? [1]: http://en.wikipedia.org/wiki/Homomorphic_encryption#Unpadded_RSA
When you send an email using [PGP](http://en.wikipedia.org/wiki/Pretty_Good_Privacy) to [encrypt emails](http://en.wikipedia.org/wiki/E-mail_encryption), is the recipients public key used to encrypt the email, or is your private key used? Are they both used? At what points do each of the four keys from the two key p...
When is each key is used when encrypting an email using OpenPGP?
A good block cipher e.g. AES running in counter mode is commonly considered to be secure. Assuming a perfectly random key, one could in this case from $128$ bits generate up to $2^{128}·128$ bits for stream encryption. However, these bits could evidently have only $1/(2^{128})$ bit of entropy each on the average. Is...
The standard CSP on Windows XP only supports RSA up to 512-bit, which means that it's the maximum key size I can use for authenticity verification of updates. The public key is embedded in the updater, and the update files are signed with the private key, using SHA256. I know that [RSA-768][1] was factored back in 2...
Is 512-bit RSA still safe for signature generation?
I've just been reading up on [Shor's algorithm][1], and I find it both fascinating and baffling. I don't really understand much about it, other than that it can factor semiprimes in polynomial time. Could someone provide a layman's terms explanation of how it works, and why it is reliant on quantum computing? Kee...
In layman's terms, how does Shor's algorithm work?
There are several papers about `Secure Indexes`, for Example "[Searchable Symmetric Encryption: Improved Definitions and Efficient Constructions][1]" and "[Secure Indexes][2]". I'm trying to build a system, that uses secure indexes to store and search data. Are there any existing solutions out there which implemen...
No. The challenge for [RSA-155][1] (which is 512 bits) was broken in 1999. This took [6 months][2] on [pretty advanced hardware][3] to break at the time, which works out to 8000 [MIPS years][4]. It should be much less today. FYI, RSA 768 took [just under 3 years][5]. [1]: http://en.wikipedia.org/wiki/RSA_n...
Enigma is not a Feistel cipher. A "Feistel cipher" is a block cipher with a specific structure, namely the whole business with the two halves, the combination of one half with a (one-way) function of the other half and a reversible operation (e.g. XOR), and the swap. See the [Wikipedia page][1] which has nice schematic...
The Enigma algorithm is a encryption method that was developed (I believe) by the Germans in WWII. It went a little something like this: When a letter was typed on the keyboard of the Enigma machine, it was first sent through the first rotor, which would shift the letter according to its present setting. The new let...
Could the Enigma algorithm be classified as a Feistel network?
$\def\dbl{\mathrm{dbl}}$Okay, let's give the missing step between mikeazo's and poncho's answers. I assume you've read mikeazo's answer to know how to add and double points. Now, how do we get a scalar multiple of a point? A simple algorithm is called "[double-and-add][1]", as it just does this. In a simple...
Cycles per byte seems to be a critical concern in designing and choosing stream ciphers. For example, from Wikipedia, RC4 has 7 cycles/byte on original Pentium chips. How is this calculated? Do they just time the encryption of multiple megabytes and then divide by the CPU's clock speed? Do they look at the assembly ...
FIPS 180-3 defines the initial hash value for SHA-256 as the first 32 bits of the fractional parts of the square roots of the first 8 primes 2..19. What would be the risks of using a different value (i.e. a random salt)? Conceptually, this would be the same as prepending the message with a block which hashed (using t...
[NIST Special Publication 800-57](http://csrc.nist.gov/publications/nistpubs/800-57/sp800-57-Part1-revised2_Mar08-2007.pdf "Recommendation for Key Management – Part 1: General (Revised)") defines a cryptoperiod as >the time span during which a specific key is authorized for use by legitimate entities, or the keys for...
How does one calculate the cryptoperiod?
Say if I have a given pseudorandom generator G which **takes a k-bit input and outputs a 3k-bit number**. How should I show that a specific construction using this pseudorandom generator is valid? For example, if I want a generator which **takes a 2k-bit input and output a 3k-bit number**. Is the following scheme...
There is the file, that encoded with AES-128 in ECB mode. I know format of original file and know that all files in this format have same headers. So, I have an encrypted block and the original block. Can I get the original key, using this information?
Is it possible to obtain AES-128 key from block encoded with ECB mode with known original block?
As far as is publicly known, no, you can't. If you could, that would constitute a practical [known-plaintext](http://en.wikipedia.org/wiki/Known-plaintext_attack) [key recovery](http://en.wikipedia.org/wiki/Key_recovery_attack) attack on AES, and the existence of such an attack would mean that AES would be considere...
It seems your major requirement is that the file size not increase. This is possible, but at the sacrifice of some security (namely integrity and authentication), so it seems you will only be able to provide confidentiality. If the file size can increase slightly (say no more than 300 bits) you should encrypt with an a...
It is accepted that the javascript library lacks the ability to create an adequate PRNG. My understanding that this was mainly due to the limits of a sandboxed browser enviroment that javascript resides in. Is this correct? Can server side javascript generate provably secure cryptography due to system wide access? ...
I need to build a system that stores encrypted transactions. Transaction involves always two parties. Payer and payee. Both must be able to download encrypted transaction from server and decrypt it using their own private key. And likewise issuing transaction must be possible by either one just by knowing both's public...
There are elliptic curve variants of Diffie-Hellman, ElGamal, DSA and possibly other protocols/algorithms. I know that these elliptic curve variants have smaller key and ciphertext sizes which will make communications (or storage) more efficient. >Are there other advantages to the elliptic curve variants of these s...
Besides key and ciphertext sizes what are the advantages of elliptic curve versions of various protocols?
Besides key and ciphertext sizes what are other advantages of elliptic curve versions of various protocols?
Call your original ($k$-to-$3k$ bit) PRG $G$ and your construction $G'$. Let $\mathcal{U}_t$ denote the uniform distribution on $\{0,1\}^t$. Then $G'$ is a PRG as long as the distributions $\mathcal{U}_{3k}$ and $G'(\mathcal{U}_{2k})$ are indistinguishable in $k$. Distribution $G'(\mathcal{U}_{2k})$ is just $G(\m...
What are the main differences between a nonce, a key and an IV. Without any doubt the key should be kept secret. But what about the nonce and the IV. What's the main difference between them and their purposes? It's only the fact that in literature and in practise IV is being used as "initiator" of an block cipher encry...
What's is the main difference between a key, an IV and nonce?
I'm encrypting some files using AES in CBC mode. I'm also using file's digest (SHA-1) to check that data is decrypted correctly (so I need to store it with file). Is it safe to use this digest as AES's IV and store it in the header of file? Or it has security issue?
According to the wiki article on [the RSA encryption function][1], the valid range of input $m$ is $0 \leq m \lt n$. However I have found that the following values of $m$ always return themselves when encrypted: - $0$ - $1$ - $n - 1$ - $n - 2$ Have I implemented the algorithm incorrectly or am I misreadin...
Yes, this is textbook RSA, so by definition: $0^e \equiv 0 \pmod{n}$ $1^e \equiv 1 \pmod{n}$ $(n - 1)^e \equiv (-1)^e \equiv -1 \pmod{n}$ (since $e$ must be odd as $\varphi{(n)}$ is even and thus $2$ has no modular inverse modulo $\varphi{(n)}$) This is (obviously) bad since an observer can immediately d...
RSA encryption input range - plaintexts that map to ciphertexts?
Yesterday I was thinking about elliptic curve variants of popular protocols/algorithms (ECDH, ECES\[1\], etc) and the thought occured that I had never seen an elliptic curve variant of RSA. My understanding of RSA and elliptic curves told me that it should be possible. After some searching I found the [following exp...
Why are elliptic curve variants of RSA "chiefly of academic interest"?
A [**key**](http://en.wikipedia.org/wiki/Key_(cryptography)), in the context of [symmetric cryptography](http://en.wikipedia.org/wiki/Symmetric-key_algorithm), is something you keep secret. Anyone who knows your key (or can guess it) can decrypt any data you've encrypted with it (or forge any authentication codes you'...
Yes, this is textbook RSA, so by definition: $0^e \equiv 0 \pmod{n}$ $1^e \equiv 1 \pmod{n}$ $(n - 1)^e \equiv (-1)^e \equiv -1 \equiv n - 1 \pmod{n}$ (since $e$ must be odd as $\varphi{(n)}$ is even and thus $2$ has no modular inverse modulo $\varphi{(n)}$) This is (obviously) bad since an observer can ...
What's is the main difference between a key, an IV and a nonce?
I'm able to find a lot of scattered papers on the development of mental poker since RSA proposed the initial solution but no recent report (i.e. after 2005) on what is the status of the problem, eg: what are the remaining open problems/challenges ? can we call it solved ? e.g. has the "dropout" problem been solved (...
What is the theoretical and practical status of mental poker?
I was attending a database encryption session at a developers conference. The presenter (who was a published author on the subject) said that MS SQL Server did not support salted hashes in the database, but it does support salting with encryption. This was the first I heard of salting in encryption. I asked for clarifi...
Yes, this is textbook RSA, so by definition: $0^e \equiv 0 \pmod{n}$ $1^e \equiv 1 \pmod{n}$ $(n - 1)^e \equiv (-1)^e \equiv -1 \equiv n - 1 \pmod{n}$ (since $e$ must be odd as $\varphi{(n)}$ is even and thus $2$ has no modular inverse modulo $\varphi{(n)}$) This is (obviously) bad since an observer can ...
My implementation now is that if the bit is `0`, a inter-packet delays between `min` and `middle` is generated similarly if the bit is `0`, a inter-packet delays between `min` and `max` is generated here's my code in python binary_string = '' m_time = 0.5 min_time = 0.2 max_time = 0...
I'm able to find a lot of scattered papers on the development of mental poker since RSA proposed the initial solution but no recent report (i.e. after 2005) on what is the status of the problem, eg: - What are the remaining open problems/challenges? - Can we call it solved? For example, has the "dropout" proble...
My implementation now is that if the bit is `0`, a inter-packet delays between `min` and `middle` is generated similarly if the bit is `1`, a inter-packet delays between `min` and `max` is generated here's my code in python binary_string = '' m_time = 0.5 min_time = 0.2 max_time = 0...
I encode a hidden message as different delays between packets of another data stream. My implementation now is that for each bit, * if the bit is `0`, a inter-packet delay between `min` and `middle` is generated and * if the bit is `1`, a inter-packet delay between `middle` and `max` is generated. Here's my c...
How to hide bit frequency of the inter-packet delays covert channel?