instruction stringlengths 15 30k |
|---|
A stream cipher usually generates a stream of pseudo-random bits which get XORed with the plaintext to form the ciphertext. The stream is generated using a given IV / nonce and a secret key. CTR-mode for block ciphers is usually described as turning a block cipher into a stream cipher.
It is now widely known that th... |
Are all stream-ciphers IND-CPA? |
I recently created a program that hashes a password using SHA256 and potentially using salt. How can I crack that if I know that the password only contains lowercase letters? |
Why we need ECDSA for? |
ECDSA and ECDH give us the following methods:
// ECDSA
var signature = ECDSA.sign(priavteKey, hash);
var isValid = ECDSA.verify(publicKey, hash, signature);
// ECDH
var sharedSecret1 = ECDH.compute(node1.publicKey, node2.privateKey);
var sharedSecret2 = ECDH.compute(node2.publicKey, no... |
ECDSA and ECDH give us the following methods:
// ECDSA
var signature = ECDSA.sign(priavteKey, hash);
var isValid = ECDSA.verify(publicKey, hash, signature);
// ECDH
var sharedSecret1 = ECDH.compute(node1.publicKey, node2.privateKey);
var sharedSecret2 = ECDH.compute(node2.publicKey, no... |
In Hoffstein, Pipher, and Silverman's book *An Introduction to Mathematical Cryptography*, the authors make the following remark:
>An attack in which Eve has access to an oracle that decrypts
arbitrary ciphertexts is known as a chosen ciphertext attack. The preceding
proposition shows that the ElGamal system is secu... |
ECDSA and ECDH give us the following methods:
// ECDSA
var signature = ECDSA.sign(priavteKey, hash);
var isValid = ECDSA.verify(publicKey, hash, signature);
// ECDH
var sharedSecret1 = ECDH.compute(node1.publicKey, node2.privateKey);
var sharedSecret2 = ECDH.compute(node2.publicKey, no... |
Why we need ECDSA when we have ECDH? |
As already mentioned in a previous answer and the comments, you are right regarding that ElGamal is not secure against chosen-ciphertext attacks. An immediate reason is that the scheme is multiplicatively homomorphic, and that is not compatible with CCA.
Also, something worth mentioning is that the proof given in t... |
In [“Towards quantum-resistant cryptosystems from supersingular elliptic curve isogenies” by DeFeo, Jao and Plut](https://eprint.iacr.org/2011/506.pdf) (PDF), the public parameters are defined as:
1. Supersingular curve $E$, and
2. bases $P, Q$ generating the torsion subgroup $E[l]$ respectively for Alice and Bob... |
As already mentioned in a previous answer and the comments, you are right regarding that ElGamal is not secure against chosen-ciphertext attacks. An immediate reason is that the scheme is multiplicatively homomorphic, and that is not compatible with CCA.
Also, something worth mentioning is that the proof given in t... |
Assume that $h:\{0,1\}^* \rightarrow \{0,1\}^\lambda$ is a cryptologic hash function, $r$ is taken randomly from $\{0,1\}^\lambda$, $p$ is a low-entropy password and $p^*$ is a guess. Now we get $h(p) \oplus h(p^*) \oplus r$ and $h(r)$ but don't know $h(p)$ or $h(p^*)$.
Then there <del>are two problems</del> is a p... |
Why don't you just use RSA? It's the common solution for that problem. User $a$ sends a message to $b$, signs it with $SK(a)$ and encrypts it with $PK(b)$. Read more at [the Wikipedia article about DH](http://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange#Public_Key).
The main problem I see (even when usi... |
Recently I started studying *Elliptic Curve Cryptography* and I just loved it. I want to transfer some big data (like 3KB), What is the best method, ECDSA, ECIES, or ECDH (and why)?
I am confused, how should I choose between ECDSA, ECIES and ECDH?
|
As already mentioned in a previous answer and the comments, you are right regarding that ElGamal is not secure against chosen-ciphertext attacks. An immediate reason is that the scheme is multiplicatively homomorphic, and that is not compatible with CCA: the attacker could query the decryption oracle with the ciphertex... |
I learned from Dan Boneh's course that many cryptographic primitives (prngs, stream ciphers, hashes, hmac, key derivation functions) can be built from just one a block cipher or PRF.
for example the SHA-1 hash is based on a compression function which can be used to make a block cipher SHACAL-1. More generally a Hash... |
one cipher to rule them all? |
When using symmetric cipher, does the following statement holds:
`E(x, k)` means encrypting x with key k in ECB mode
`E(E(x, k1), k2) = E(E(x, k2), k1)` ?
Then the decryption could go in opposite way round and the message x would be the same. |
I would like to know how public key crypto is used in the banking world. I am not looking for big details but for exemple :
- Are banking card embedding a private key used for signing (authenticating) user transactions ?
- During a transaction between Bank A and Bank B, is Bank A expected to sign the transaction so... |
How far is public-key crypto involved in "banking world"? |
I am looking at some decompiled Java code from an Android app. As a security measure, a signature is passed as a parameter to a number of JSON requests.
The method that generates the signature is as so:
private String getSignature(String s, String s1)
{
try
{
Charset charse... |
Is there any good reason to chain HMACs in this manner? |
I am looking at some decompiled Java code from an Android app. As a security measure, a signature is passed as a parameter to a number of JSON requests.
The method that generates the signature is as so:
private String getSignature(String s, String s1)
{
try
{
Charset charse... |
I would like to know how public key cryptography is used in the banking world. I am not looking for big details, but for example:
- Are banking card embedding a private key used for signing (authenticating) user transactions?
- During a transaction between Bank A and Bank B, is Bank A expected to sign the transacti... |
I am looking at some decompiled Java code from an Android app. As a security measure, a signature is passed as a parameter to a number of JSON requests.
The method that generates the signature is as so:
private String getSignature(String s, String s1)
{
try
{
Charset charse... |
Suppose I have `x = <64 bits of data>`. I build a 128 bit block $P = x || x$, and transmit a message $M = AES(K, P)$. The receiver has the same $K$. Would they be able to securely authenticate the message? |
Does AES(x || x) provide secure message authentication? |
Concatenating two copies of your message is unnecessary and is equivalent to padding out your 64 bit message to the full 128 bits with zeros from a security standpoint (which happens automatically in the encryption process).
> Would they be able to securely authenticate the message?
I assume you mean Authenticate... |
Suppose I have `x = <64 bits of data>`. I build a 128 bit block $P = x || x$, and transmit a message $M = AES(K, P)$. The receiver has the same $K$.
The receiver can then decrypt the message, split the decrypted block in two 64 bits parts, and comparing them for equality. What kind of guarantee would the equality ch... |
Does AES(x || x) provide secure message authentication when message fits in a single block? |
Concatenating two copies of your message is unnecessary and is equivalent to padding out your 64 bit message to the full 128 bits with zeros from a security standpoint (which happens automatically in the encryption process).
> Would they be able to securely authenticate the message?
I assume you mean Authenticate... |
First, a bit of background. If we refer to the size of an elliptic curve group as $n$, we select an elliptic curve with $n = hq$, where $q$ is a large prime, and $h$ is a small integer called the cofactor; it is typically either 1, 4 or 8. The values of $q$ and $h$ will be part of the curve definition.
As you know... |
Suppose I have `x = <64 bits of data>`. I build a 128 bit block $P = x || x$, and transmit a message $M = AES(K, P)$. The receiver has the same $K$.
The receiver can then decrypt the message, split the decrypted block in two 64 bits parts, and comparing them for equality. What kind of guarantee would the equality ch... |
First, a bit of background. If we refer to the size of an elliptic curve group as $n$, we select an elliptic curve with $n = hq$, where $q$ is a large prime, and $h$ is a small integer called the cofactor; it is typically either 1, 4 or 8. The values of $q$ and $h$ will be part of the curve definition.
As you know... |
Say Alice has information that's already encrypted with bob's key.
She wants Bob to decrypt it without knowing what he just decrpyted.
So she encrypts it with her key and sends it to him, he decrypts with his key, and sends it back and she decrypts it with her key.
Is there a block cipher where this would work? |
Say Alice has information that's already encrypted with Bob's key.
She wants Bob to decrypt it without knowing what he just decrypted.
So she encrypts it with her key and sends it to him, he decrypts with his key, and sends it back and she decrypts it with her key.
Is there a block cipher where this would work? |
This question is based on opinion. At least kind-of. But the variants between one can choose are quite few.
As for general construction the **sponge construction** (like Keccak / SHA-3 uses) are very versatile and can be used for many purposes, for example hashing, authenticating (= "MAC'ing"), authenticated encrypt... |
I am researching on Hashing Algorithms and would like to know if takes individual bits of MD5.
Say we take first 8 bits or any random 8 bits of MD5 then what is the randomness probability of having same 8-bits(at exact same position) in any two different MD5 hashes ?
|
What is degree of randomness in individual bits of MD5 hash? |
I am researching on Hashing Algorithms and would like to know if we take individual bits of MD5, say we take first 8 bits or any random 8 bits of MD5 then what is the randomness probability of having same 8-bits(at exact same position) in any two different MD5 hashes ?
I read somewhere that MD5 being good PRF has un... |
I have spent the past hour reading up on salting and still don't understand how it is achieved. Forgive me if im wrong, but the way I am thinking of salting is, storing an ArrayList of random strings for example 100 strings. Now when a user registers, a method gets a random string from the array list and retrieves the ... |
Salting in asp.net? |
Suppose I have a message M for which I generate an RSA-2048 digital signature as follows:
H = SHA-256(M)
S = H^d mod N
Assume N = p*q is properly generated and d is the RSA private key. And I verify the signature as follows:
S^e mod N == H'
where H' is the SHA-256 of the message to be authentic... |
Suppose I have a message $M$ for which I generate an RSA-2048 digital signature as follows:
$H = H(M)$, $H(M)$ being the SHA-256 of the message $M$<br>
$S = H^d \bmod N$
Assume $N = pq$ is properly generated and $d$ is the RSA private key. And I verify the signature as follows:
$S^e \bmod N = H'$
where $H'... |
How much more entropy gives a Hardware Random Number Generator or True Random Number Generator than Pseudo Random Number Generator? I know it depends on which TRNG is used, but I'm thinking in general? Is it worth buying a TRNG for more security? |
TRNG vs PRNG - Entropy? |
How much more entropy gives a Hardware Random Number Generator or True Random Number Generator compared to a Pseudo Random Number Generator?
I know it depends on which TRNG is used, but I'm thinking in general. Does a TRNG generally provide more security than a PRNG? |
I am researching on Hashing Algorithms and would like to know if we take individual bits of MD5, say we take first 8 bits or any random 8 bits of MD5 then what is the randomness probability of having same 8-bits (at exactly the same position) in any two different MD5 hashes ?
I´ve read somewhere that MD5 being good ... |
I learned from Dan Boneh's course that many cryptographic primitives (prngs, stream ciphers, hashes, hmac, key derivation functions) can be built from just one a block cipher or PRF.
For example, the [tag:SHA-1] hash is based on a compression function which can be used to make a block cipher SHACAL-1. More generally... |
This question is based on opinion. At least kind-of. But the variants from which one can choose are quite a few.
As for general construction the **sponge construction** (like Keccak / SHA-3 uses) are very versatile and can be used for many purposes, for example hashing, authenticating (= "MAC'ing"), authenticated en... |
One cipher to rule them all? |
It appears that the conditions for applicability of Elligator-2 against many of the SaveCurves curves, where q mod 4 = 3 will inevitably poke a hole in the bit-string set over (0, 1, .. (q-1)/2).
There are two conditions for use of the decoding of a bit string to a point on the curve: (1 + u*r^2) /= 0 and A^2*ur^2 /... |
It appears that the conditions for applicability of Elligator-2 against many of the SaveCurves curves, where $q \mod 4 = 3$ will inevitably poke a hole in the bit-string set over $(0, 1, .. (q-1)/2)$.
There are two conditions for use of the decoding of a bit string to a point on the curve: $(1 + u*r^2) /= 0$ and $A^... |
MD5 was designed with the goal that any change in the input uniformly affects all the bits of the output. It's not perfect, but it's pretty good. If you're choosing the input "randomly enough" (e.g., by appending random bits before hashing) then I think your question approaches this one:
> Given two randomly genera... |
MD5 was designed with the goal that any change in the input uniformly affects all the bits of the output. It's not perfect, but it's pretty good. If you're choosing the input "randomly enough" (e.g., by appending random bits before hashing) then your question approaches this one:
> Given two randomly generated 8-bi... |
The two primes(p and q) part of the public key need to be **distinct**.
What's the reason for them to be distinct? Is it because factorization of p^2 where p is a prime is relatively easier, or is there some other reason? |
Why should the primes used in RSA be distinct? |
We all know that textbook ElGamal falls due to chosen ciphertext attacks, because of its multiplicative homomorphic property ($E(A)*E(B)=E(AB)$).
However these attacks require the ciphertext ($E(A)$ or $E(B)$) to be given, meaning as per [this answer][1] this would mean ElGamal isn't IND-CCA2, but IND-CCA1 as the ac... |
Is ElGamal IND-CCA1? |
Entropy as defined in information theory and cryptography is a difficult concept. One of the most common fallacies is that a piece of data has or "contains" entropy by itself. People who misunderstand this talk about bit streams having entropy, or measuring entropy of a piece of data. Or measuring entropy of a RNG.
... |
So. Sorry for bothering you with such a simple question, but I can't really get this done.
It's just an exam question in which I need to use CRT in order to calculate the RSA signature of a msg m=101(dec), given RSA public modulus n=527=p*q=17*31.
So using CRT I need to calculate p^-1mod(q), which is, for the Eu... |
Multiplicative inverse (17^-1 mod31)? |
The tests you can do depend on how much time you want to spend for checking each certificate and the "stupidity" you assume for the given key-owner.
You already mentioned the basic checks:
- Modulus is too small, only interesting if it's smaller than 1024 bits
- Exponent is unusual, not exactly a vulnerability... |
What is the benefit of using elliptic curves over the standard finite field, when the cyclic subgroup we consider of the EC's solution group is just isomorphic to some integer residue class of prime order? Is it because the group operation is more complex? |
Why Elliptic Curves? |
Lately I've been studying cryptography and in the current course I'm taking we're reviewing statistical tests and how they can be used to determine if a pseudo-random generator is secure or not. Essentially, one of the requirements for a Pseudo-random generator to be secure is that the probability of guessing the next ... |
How is an epsilon of 1/1000 non-negligible? |
In [“Towards quantum-resistant cryptosystems from supersingular elliptic curve isogenies” by DeFeo, Jao and Plut](https://eprint.iacr.org/2011/506.pdf) (PDF), the public parameters are defined as:
1. Supersingular curve $E$, and
2. bases $P, Q$ generating the torsion subgroup $E[l]$ respectively for Alice and Bob... |
Lately I've been studying cryptography and in the current course I'm taking we're reviewing statistical tests and how they can be used to determine if a pseudo-random generator is secure or not.
Essentially, one of the requirements for a Pseudo-random generator to be secure is that the probability of guessing the ne... |
**Found the answer:**
The l-Torsion subgroup ist isomorph to a direct sum of two quotient groups:
$E[l] \simeq \mathbb{Z}_n \oplus \mathbb{Z}_n$, hence the basis requires two points and the elements of $E[l]$ are represented my linear combinations of such a basis.
[Reference: Elliptic Curves, Washington, section 3... |
My assumptions are:
- encryption must be commutative
- man-in-the-middle is not an issue
I would like to implement the following scheme between 2 parties ($A$ and $B$) to exchange a key:
Lets $C = P \oplus F(K, IV)$ is a commutative encryption, resp. CTR mode of some symmetric block cipher with random key ... |
Is this commutative encryption protocol secure? |
I think most of us know the notion Shoup introduced of KEM/DEM (Key encryption material / data encryption material) which is used for example by the (famous) ECIES, where the key is the hash of some random element which can only be recovered by the legitimate owner of the private key and the sender.
Now [Bernstein e... |
IES: What security has the asymmetric primitive to provide? |
Consider the point multiplication $Q=[d]P$, where $P$ a point on elliptic curve multiplied with an integer $d$ to get another point $Q$ on the same curve. This operation can be computed by a predefined sequence of point additions and point doublings. It is possible to apply the same technique to Montgomery curves, as g... |
Does exponentiation by squaring work on Montgomery curves? |
Consider the point multiplication $Q=[d]P$, where $P$ a point on elliptic curve multiplied with an integer $d$ to get another point $Q$ on the same curve. This operation can be computed by a predefined sequence of point additions and point doublings. Is it possible to apply the same technique to Montgomery curves, as g... |
I have a webserver which only supports TLS 1.0 and I am not sure about something: Which is the better cipher in this group when aiming for the best security?
TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA (0xc00a)
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (0xc014)
TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA (0xc009)
TLS_... |
I am studying Fractal Merkle Tree Traversal algorithm in the book [“Post Quantum Cryptography”][1] (PDF). On the [pag. 54] I don't understand this paragraph:
> We may determine the number of pebbles returned at these times by observing that a leaf is returned every single round, a pebble at height
> $ih + 1$... |
How to compute two EC point multiplication? |
The two primes $p$ and $q$ part of the public key need to be **distinct**.
What's the reason for them to be distinct? Is it because factorization of $p^2$ where $p$ is a prime is relatively easier, or is there some other reason? |
Point multiplication using Montgomery ladder technique over Montgomery curves only require x coordinate, which in many situation leads to faster implementation as compared to point multiplication over standard curves. However, to compute point multiplication over Montgomery curves, a differential point addition operati... |
The symbol Z/qZ (given that q is prime) represents the prime field Zq. Basically, the elements of this field are represented by {0, 1 ... q-1}, let's call this the "normal representation". However, in lattice based crypto, the elements of the filed are represented in {-(q-1)/2, ... (q-1)/2}, let's call this the "lattic... |
The symbol $\mathbb Z/q\mathbb Z$ (given that $q$ is prime) represents the prime field $\mathbb Z_q$. Basically, the elements of this field are represented by $\{0, 1, \dots, q-1\}$, let's call this the "normal representation". However, in lattice based crypto, the elements of the field are represented by $\{-(q-1)/2, ... |
What is the difference between the standard representants of $\mathbb Z/q\mathbb Z$? |
How do I calculate the number of computations needed to break SHA256 in case we are using it for safely storing passwords (together with a salt)?
Are there any formulas that can be employed?
For example:
>Passwords are chosen to be 5-character strings composed of lowercase Latin letters and numbers, and are sto... |
In [ “Towards quantum-resistant cryptosystems from supersingular elliptic curve isogenies"][1] by DeFeo, Jao and Plut (PDF), there is a reduction from the Decisional Supersingular Product (DSSP) problem to Decisional Supersingular Isogeny (DSSI) problem mentioned.
Though i could not find such a reduction anywhere, or ... |
I would like to transpose the Ed25519 ref10 implementation to a similar twisted Edwards curve that is based on another prime, in order to have the same speed optimizations in place for the new curve. Most of the code is not too hard to understand.
However, I don't understand what is going on in the function 'fe_mul'... |
I would like to clarify something about the definition of computational indistinguishability and pseudorandom number generators. Suppose we wanted to show that linear congruential generators of the form $x_t = ax_{t-1} + b \pmod m$ are **not** pesudorandom number generators. Then we wish to show that given a sequence o... |
Computational indistinguishability: are function parameters known? |
I would like to clarify something about the definition of computational indistinguishability and pseudorandom number generators. Suppose we wanted to show that linear congruential generators of the form $x_t = ax_{t-1} + b \pmod m$ are **not** pesudorandom number generators. Then we wish to show that given a sequence o... |
I would like to clarify something about the definition of computational indistinguishability and pseudorandom number generators. Suppose we wanted to show that linear congruential generators of the form $x_t = ax_{t-1} + b \pmod m$ are **not** pesudorandom number generators. Then we wish to show that given a sequence o... |
It appears that the conditions for applicability of Elligator-2 against many of the SaveCurves curves, where $q \mod 4 = 3$ will inevitably poke a hole in the bit-string set over $(0, 1, .. (q-1)/2)$.
There are two conditions for use of the decoding of a bit string to a point on the curve: $(1 + u \cdot r^2) \neq 0$... |
In Massey-Omura three pass protocol:
- how many bits long should be the prime modulus $M$ in order to be secure?
- should be the the $M$ secret?
- should be the $M$ generated every time or it could be reused every time to generate new keys? |
I am currently trying to understand this Ring-LWE article: http://www.cims.nyu.edu/~regev/papers/ideal-lwe.pdf and I have a question.
Firstly, it is mentioned in the paper that we can view the elliptical Gaussian distributions $D_{\textbf{r}}$ (which are initially defined on $H$) as distributions on $K_{\mathbb{R}} ... |
Is there a multiple asymmetric encryption algorithm, which requires all private keys to reveal the secret? |
As I understand length extension attacks, they depend on the coincidental property of most cryptographic hash functions that the hash value is exactly the hash function state after hashing the last block of data. This enables an attacker to initialize their own hash function with the state as it "left off".
This bei... |
Why isn't outputting only a portion of the hash state a simple defense against length extension attacks? |
I'm trying to understand the comment in the page 103 of the book [Postquantum Cryptography][1]. about convert the identification Stern procedure for signing. Can you write an example of signature of this conversion?
> The standard method to convert the identification procedure into a proce-
dure for signing, is to... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.