instruction stringlengths 15 30k |
|---|
While it may be confusing, that Wikipedia article is actually correct! Let me try to explain it a bit better…
# Definition of key whitening
Key whitening is an extremely simple technique to make block ciphers like DES much more resistant against brute-force attacks. Like you’ve already discovered yourself, this i... |
How can I control the output of a hash function to output to specific data according to similarity? |
What characters may be present in a PGP encrypted message or a PGP signature? For example, do encrypted messages only use the Roman alphabet + some numbers and symbols? Can the character set be configured by the user? Is everything Base64 encoded?
Also, are there special characters that will never be used in a messa... |
What characters are valid in PGP encrypted and signed messages? |
Such a scheme would have two effects against an attacker trying to analyze the frequency of words and word combinations:
1. They would need more samples to differentiate between two words at the same level of confidence.
2. For two different tokens with similar frequency they would no longer know that the words dif... |
Such a scheme would have two effects against an attacker trying to analyze the frequency of words and word combinations:
1. They would need more samples to differentiate between two tokens at the same level of confidence.
2. For two different tokens with similar frequency they would no longer know that the words di... |
While it may be confusing, that Wikipedia article is actually correct! Let me try to explain it a bit better…
# Definition of key whitening
Key whitening is an extremely simple technique to make block ciphers like DES much more resistant against brute-force attacks. Like you’ve already discovered yourself, this i... |
Like people always say: *“Attacks only get worse…”* — which is why I'm asking early.
I have been reading the paper [“RSA Key Extraction via Low-Bandwidth Acoustic Cryptanalysis”](http://www.tau.ac.il/~tromer/papers/acoustic-20131218.pdf) published December 18, 2013 by Daniel Genkin, Adi Shamir, Eran Tromer.
# Att... |
Most plaintext must be fed as a string or a binary object to be encrypted.
However, it's often possible to mis-decode the plaintext before encrypting it.
i.e. If it's received as a string in JSON, you often don't know if the string
is an encoded representation (e.g. plain, hex encoded, base64 encoded, etc)
**Ex... |
Is it insecure to encrypt the wrong plaintext? |
Most plaintext must be fed as a string or a binary object to be encrypted.
However, it's often possible to mis-decode the plaintext before encrypting it.
i.e. If it's received as a string in JSON, you often don't know if the string
is an encoded representation (e.g. plain, hex encoded, base64 encoded, etc)
**Ex... |
As long as you're using any modern encryption algorithm (and you're using it correctly: random key, new random or unique IVs for each message, depending on the mode of operation, etc.) then you'll be fine. In fact, you'd be fine even if an attacker got to *choose* which plaintext you encrypted and got to see the result... |
As long as you're using any modern encryption algorithm (and you're using it correctly: random key, new random or unique IVs for each message, depending on the mode of operation, etc.) then you'll be fine. In fact, you'd be fine even if an attacker got to *choose* which plaintext you encrypted and got to see the result... |
Most plaintext must be fed as a string or a binary object to be encrypted.
However, it's often possible to mis-decode the plaintext before encrypting it.
i.e. If it's received as a string in JSON, you often don't know if the string
is an encoded representation (e.g. plain, hex encoded, base64 encoded, etc)
**Ex... |
I have been wracking my brain trying to develop a functioning implementation of SRP-6a in Python to use with a 3rd-party API that claims to use SRP-6a with N=2048-bit prime and generator of 2. Unfortunately it has proven quite difficult to find two implementations that "match" to themselves.
For example, http://srp... |
I have been wracking my brain trying to develop a functioning implementation of SRP-6a in Python to use with a 3rd-party API that claims to use SRP-6a with $N=$ 2048-bit prime and generator of $2$. Unfortunately it has proven quite difficult to find two implementations that "match" to themselves.
For example, [Stan... |
This sounds like a classic [codebook][1] or [nomenclator][2].
Even if we assume a perfect [random oracle][3] that generates a completely random codeword for each word of English text,
I agree with otus that frequency attacks and N-grams would likely
be able to decode the most-frequently-used words.
Also, a know... |
I've already read this:
http://crypto.stackexchange.com/questions/48/is-it-feasible-to-build-a-stream-cipher-from-a-cryptographic-hash-function
However, my proposed construction differs…
Suppose the hash generates N bits. These bits are split into two parts:
- $S$ bits are kept secret,
- $X$ bits are used ... |
From the perspective of a Birthday Paradox attack, isn't it true that CMAC based on AES-128 is weaker than HMAC-SHA-1? The attack on CMAC-AES-128 requires about 2^64 operations whereas the same attack on HMAC-SHA-1 requires 2^80.
Regardless from the comparison of the CMAC-AES-128 with HMAC-SHA-1 it seems to me that ... |
From the perspective of a Birthday Paradox attack, isn't it true that CMAC based on AES-128 is weaker than HMAC-SHA-1? The attack on CMAC-AES-128 requires about $2^{64}$ operations whereas the same attack on HMAC-SHA-1 requires $2^{80}$.
Regardless from the comparison of the CMAC-AES-128 with HMAC-SHA-1 it seems to ... |
I used aes256-cbc to SSH to a remote server. Recently it stopped working with the following message:
> no matching cipher found: client aes256-cbc server
> aes128-ctr,aes256-ctr,arcfour256,arcfour,3des-cbc
When I used aes256-ctr as a cipher to SSH to the server, it worked as expected.
I read [this][1] article... |
I used AES256-CBC to SSH to a remote server. Recently, it stopped working with the following message:
no matching cipher found: client aes256-cbc server
aes128-ctr,aes256-ctr,arcfour256,arcfour,3des-cbc
When I used AES256-CTR as a cipher to SSH to the server, it worked as expected.
I read [this][1] ... |
Some ciphers are talked about at [“Is there a secure cryptosystem that can be performed mentally?”][1], but (at the time of writing) I don't see an answer.
Are they strong enough, or are non-computer ciphers more or less just a toy and one should abandon using them for practical purposes?
[1]: http://crypto.st... |
During a regular Diffie–Hellman public key exchange, Alice and Bob agree to use a prime number $p$ and a base $g$… which are both made public and are therefore also assumed to be known by Eve. Alice chooses a secret integer $a$ and sends $(A = g^a \mod p)$ to Bob, Bob chooses a secret integer $b$ and sends $(B = g^b \m... |
He is a quote from Wikipedia page for Secret Sharing:
> If the players store their shares on insecure computer servers, an attacker could crack in and steal the shares. If it is not practical to change the secret, the uncompromised (Shamir-style) shares can be renewed. The dealer generates a new random polynomial wi... |
> While a known plaintext attack successfully finds the keys, nobody has been able to put forward a general solution to this cipher. Is that possible?
You really have to go back in time to learn that ChaoCipher has been subject to some cryptanalysis before the description of the algorithm/device was published. As an... |
What does well-typed mean? |
I am currently studying Cryptography and I don't really understand what does 'well-typed' mean when talking about secure cryptographic protocols. I can't find any reasonable explanation on the internet either.
It would be great if someone could give definition and maybe example.
For example quote from [here][1]: ... |
In Information Security Class I learned a non-adaptive chosen ciphertext attack using "blinding" but I just can't follow the proof and therefore can't reconstruct it. From what I've found out, it seems to be based on this Wikipedia entry (although not entirely I think): http://en.wikipedia.org/wiki/Blind_signature#Dang... |
In Information Security Class I learned a non-adaptive chosen ciphertext attack using "blinding" but I just can't follow the proof and therefore can't reconstruct it. From what I've found out, it seems to be based on this Wikipedia entry (although not entirely I think): http://en.wikipedia.org/wiki/Blind_signature#Dang... |
I have to to find the shift value and the message for the following caesar cipher.
**OC_VAWDGPM_VHWTVX_VXJOCVZ_GDX_MWO_VWIZVYGWIZ_NODI_**
I have already tried it and with the shift value of 21 i get the following.
**TH_AFBILUR_AMBYAC_ACOTHAE_LIC_RBT_ABNEADLBNE_STIN_**
Does this look like the correct decrypted m... |
I have to to find the shift value and the message for the following caesar cipher.
**OC_VAWDGPM_VHWTVX_VXJOCVZ_GDX_MWO_VWIZVYGWIZ_NODI_**
I have already tried it and with the shift value of 21 i get the following.
**TH_AFBILUR_AMBYAC_ACOTHAE_LIC_RBT_ABNEADLBNE_STIN_**
Does this look like the correct decrypted m... |
I have to to find the shift value and the message for the following caesar cipher.
**OC_VAWDGPM_VHWTVX_VXJOCVZ_GDX_MWO_VWIZVYGWIZ_NODI_**
I have already tried it and with the shift value of 21 i get the following.
**TH_AFBILUR_AMBYAC_ACOTHAE_LIC_RBT_ABNEADLBNE_STIN_**
Does this look like the correct decrypted m... |
I was reading about hash functions, namely SHA, and I read that it is made of the Merkle-Damgard construction. And then the text said that the compression function used is based on the Davis-Meyer compression function. The text also mentioned that SHA-256 is based on the block cipher SHACAL-2.
I got a little bit con... |
When we talk about a Number used ONCE (NONCE) in Initialization Vector (IV), is it required to use numbers only? Is is possible to use letters or special characters? |
Is it possible to create a streaming mode of operation where the reuse of a nonce does not destroy confidentiality?
In this question it would be allowed for the streaming mode to leak if ciphertexts are (partially) identical or not - like in CBC mode of operation. It is of course not permitted to introduce other sec... |
I was wondering if there were any security implications of deriving session keys from a symmetric key using SHA256 in the following manner:
<b>Ks = SHA256(Nonce||K)</b>
Here Nonce is the session specific nonce & K is the pre-shared symmetric key. And Ks will be derived at both ends as mentioned above.
As far a... |
What is the most secure way to combine two "random" keys *X* of size *k* (*k* ≤ 512 bits) and *Y* of size 512 bits in one key *Z* of size *k*?
Result *Z* will be used for encryption/decryption with various symmetric ciphers (most commonly with AES-256 in CBC mode) or as HMAC key (most commonly with SHA1 and SHA256).
... |
Although SHA-1 theoretically has collisions, HMAC-SHA-1 which is based on SHA-1 is still widely used widely (in TLS for example) and is considered to be secure. How is that possible? |
Is HMAC-SHA-1 secure? |
What is the most secure way to combine two "random" keys *X* of size *k* (*k* ≤ 512 bits) and *Y* of size 512 bits in one key *Z* of size *k*?
Result *Z* will be used for encryption/decryption with various symmetric ciphers (most commonly with AES-256 in CBC mode) or as HMAC key (most commonly with SHA1 and SHA256).
... |
I have a question about the message that is being encrypted and signed. Say, two users called Tom and Mary, both have a pair of private key and public key. Tom sends a message through a system that will encrypt and sign the message. 2 kinds of message will be sent
1. encrypted message and,
2. hash function of the m... |
This is my scenario:
1. A small structured text message (1-2kB) is to be sent over an insecure channel.
2. Everything except for the header portion (which contains a title, timestamp, category and tags) is confidential.
3. The message as a whole has integrity and non-repudiation as additional requirements.
Th... |
Do I need to use AE/AEAD in my particular scenario? Or is it redundant? |
This is my scenario:
1. A small structured text message (1-2kB) is to be sent over an insecure channel.
2. Everything except for the header portion (which contains a title, timestamp, category and tags) is confidential.
3. The message as a whole has integrity and non-repudiation as additional requirements.
Th... |
Although SHA-1 theoretically has collisions, HMAC-SHA-1 which is based on SHA-1 is still widely used (in TLS for example) and is considered to be secure. How is that possible? |
I'm currently working on the discrete logarithm problem and the relevant attacks. I'm fine on the mathematical side of things, but when it comes to estimation of running times I run into problems. More specifically: if we take a generic square algorithm like Baby Step Giant Step for a cyclic group of size $n$, we usual... |
Computational Complexity - When is it really exponential time? |
I'm currently working on the discrete logarithm problem and the relevant attacks. I'm fine on the mathematical side of things, but when it comes to estimation of running times I run into problems. More specifically: if we take a generic square algorithm like Baby Step Giant Step for a cyclic group of size $n$, we usual... |
> While a known plaintext attack successfully finds the keys, nobody has been able to put forward a general solution to this cipher. Is that possible?
You really have to go back in time to learn that ChaoCipher has been subject to some cryptanalysis before the description of the algorithm/device was published. As an... |
To determine the complexity class of an algorithm, you have to determine which operation can be done in unit time. For example, a typical PC will to word-size, $w$-bit (32- or 64-bit) addition and multiplication in constant time.
From that, you can calculate how many of those primitive operations an algorithm requir... |
> encrypt it with the message author's private key
This statement makes me uncomfortable. Normally, in asymmetric cryptography, one encrypts with the public key and signs with the private key. Did you mean “sign it with the message author's private key”? Otherwise, I would not accept your protocol without a clear, d... |
Out of band my services have exchanged secret keys. These secret keys are then used to prevent two things of the webhooks (HTTP calls triggered by Service A to Service B when an event occurs in Service A).
1. Webhook Spoofing
2. Webhook Replaying
The basic problems with webhooks involve the fact that, short of... |
Are there any cryptographic flaws in my webhook signing process? |
In this [Intel blog posting][1], the author claims:
> The amount of work required to brute-force predict a random value that has n bits of entropy is $O(2^n)$. If you concatenate two values together, the entropy required to brute force the result becomes only $2^n + 2^n = 2^{n+1}$. By combining two n-bit random valu... |
This is my scenario:
1. A small structured text message (1-2kB) is to be sent over an insecure channel.
2. Everything except for the header portion (which contains a title, timestamp, category and tags) is confidential.
3. The message as a whole has integrity and non-repudiation as additional requirements.
Th... |
In CTR mode encryption, the encryption block is not required to be invertible. Thus, a PRF can be used instead of a PRP. However most of the implementations of CTR mode are based on AES which is a PRP.
This made me think if we can have a PRG as the encryption block where the (key || counter_i) can be supplied as a s... |
This is my scenario:
1. A small structured text message (1-2kB) is to be sent over an insecure channel.
2. Everything except for the header portion (which contains a title, timestamp, category and tags) is confidential.
3. The message as a whole has integrity and non-repudiation as additional requirements.
Th... |
Encrypt-then-MAC does provide ciphertext integrity, but no plaintext integrity. With MAC-then-Encrypt it’s the other way around: Plaintext integrity but no ciphertext integrity.
What comes to mind is that it could make sense to use both to fix that *“partially missing integrity”* issue:
$$\tt MAC_1(plaintext)-EN... |
Security issues of a MAC-then-Encrypt-then-MAC approach? |
Encrypt-then-MAC does provide ciphertext integrity, but no plaintext integrity. With MAC-then-Encrypt it’s the other way around: Plaintext integrity but no ciphertext integrity.
What comes to mind is that it could make sense to use both to fix that *“partially missing integrity”* issue:
$$\tt MAC_1(plaintext)-EN... |
Wikipedia says about a Merkle tree:
> Nodes further up in the tree are the hashes of their respective children. Usually, a cryptographic hash function such as SHA-2 or SHA-3 is used for the hashing.
A cryptographic hash function can be defined using a 1-way compression function. Can we use a 1-way compression fun... |
Hash or compression function in Merkle tree nodes? |
What is the most secure way to combine two "random" keys *X* of size *k* (*k* ≤ 512 bits) and *Y* of size 512 bits in one key *Z* of size *k*?
Result *Z* will be used for encryption/decryption with various symmetric ciphers (most commonly with AES-256 in CBC mode) or as HMAC key (most commonly with SHA1 and SHA256).
... |
Wikipedia says about a Merkle tree:
> Nodes further up in the tree are the hashes of their respective children. Usually, a cryptographic hash function such as SHA-2 or SHA-3 is used for the hashing.
A cryptographic hash function can be defined using a 1-way compression function. Can we use a 1-way compression fun... |
Does this hold in asymetric bilinear pairings?
$e(e_1,e_2)e(e_3,e_4) = e(e_1e_3,e_2e_4)$, where $e_1,e_3 \in \mathbb{G}_1$ and $e_2,e_4 \in \mathbb{G}_2$ for a bilinear pairing $e$ |
Does this hold in asymetric bilinear pairings?
$e(x_1,x_2)e(x_3,x_4) = e(x_1x_3,x_2x_4)$, where $x_1,x_3 \in \mathbb{G}_1$ and $x_2,x_4 \in \mathbb{G}_2$ for a bilinear pairing $e$ |
Let say I want to truncate SHA256 to 128 bits. What would be the best way to do it?
1. Taking the last 16 bytes
2. Taking the first 16 bytes
3. XORing the first 16 bytes and the last 16 bytes together
And should I assume that the same logic will apply for other hash functions from the SHA-2 set (like SHA516) as... |
Is XORing a SHA256 better than truncating it? |
Let say I want to truncate SHA256 to 128 bits. What would be the best way to minimize a probability of a collision?
1. Taking the last 16 bytes
2. Taking the first 16 bytes
3. XORing the first 16 bytes and the last 16 bytes together
And should I assume that the same logic will apply for other hash functions fro... |
Let say I want to truncate SHA256 to 128 bits. What would be the best way to minimize a probability of a collision and improve collision resistance?
1. Taking the last 16 bytes
2. Taking the first 16 bytes
3. XORing the first 16 bytes and the last 16 bytes together
And should I assume that the same logic will a... |
As pointed out in an [answer][1] to an older question, SHA-224 is more or less just using the first bits of the output of SHA-256. That is just about the most official construction anyone can find.
The XOR approach is however not entirely unprecedented, for example [Linux uses][2] that approach on SHA1 in order to g... |
Security issues of a MAC-and-Encrypt-then-MAC approach? |
Encrypt-then-MAC does provide ciphertext integrity, but no plaintext integrity. With MAC-then-Encrypt it’s the other way around: Plaintext integrity but no ciphertext integrity.
What comes to mind is that it could make sense to use both to fix that *“partially missing integrity”* issue:
$$\tt MAC_1(plaintext) \r... |
Security issues of a MAC-then-Encrypt-then-MAC approach? |
Encrypt-then-MAC does provide ciphertext integrity, but no plaintext integrity. With MAC-then-Encrypt it’s the other way around: Plaintext integrity but no ciphertext integrity.
What comes to mind is that it could make sense to use both to fix that *“partially missing integrity”* issue:
$$\tt MAC_2(ENCRYPT(plain... |
Encrypt-then-MAC does provide ciphertext integrity, but no plaintext integrity. With MAC-then-Encrypt it’s the other way around: Plaintext integrity but no ciphertext integrity.
What comes to mind is that it could make sense to use both to fix that *“partially missing integrity”* issue:
$$\tt MAC_1(plaintext)-EN... |
Encrypt-then-MAC does provide ciphertext integrity, but no plaintext integrity. With MAC-then-Encrypt it’s the other way around: Plaintext integrity but no ciphertext integrity.
What comes to mind is that it could make sense to use both to fix that *“partially missing integrity”* issue:
$$\tt …\ MAC_2(ENCRYPT(pl... |
I'm thinking about man-in-the-middle attacks during a website login, and started wondering about reversible encryption.
What I'm imagining is an encryption that takes input `A` and creates an encrypted result, `Ax`. Like hashing, if you have `Ax`, you can't mathematically figure out `A`. But unlike hashing, there i... |
Is there an encryption that is only reversible with a key? |
I have a couple of questions pertaining to a RSA problem. I need to decipher some ciphertext and find out what the original plaintext was.
<br> *n* = 2537 and *a (or the exponent)* = 11.<br>
Encrypting function:
*E(x) = x^11* (MOD 2537)
<br><br><br>
Using Fermat's Little Theorem to start, I have successfully encr... |
Is it possible to find plaintext from ciphertext if (n) and (a) are known for RSA? |
I have a couple of questions pertaining to a RSA problem. I need to decipher some ciphertext and find out what the original plaintext was.
<br> *n* = 2537 and *a (or the exponent)* = 11.<br>
Encrypting function:<br><br>
E(x) = x^11 (MOD 2537)
<br><br>
Using Fermat's Little Theorem to start, I have successfully... |
The Luby-Rackoff theorem states that if a round function is a secure pseudorandom function (PRF) then 3 rounds are sufficient to make the block cipher a pseudorandom permutation (PRP).
PRPs are invertible whereas PRFs are not. How come 3 rounds of a PRF will make an invertible block cipher out of a non-invertible fu... |
I have a couple of questions pertaining to a RSA problem. I need to decipher some ciphertext and find out what the original plaintext was.
<br> *n* = 2537 and *a (or the exponent)* = 11.<br>
Encrypting function:<br><br>
E(x) = x^11 (MOD 2537)
<br><br>
Using Fermat's Little Theorem to start, I have successfully... |
The Luby-Rackoff theorem states that if a round function is a secure pseudorandom function (PRF)
<br>
then 3 rounds are sufficient to make the block cipher a pseudorandom permutation (PRP).
PRPs are invertible whereas PRFs are not. How come 3 rounds of a PRF
<br>
will make an invertible block cipher out of a non... |
On the surface, SHA1 and MD5 look pretty similar. Their diagrams include chunks of bits, bit rotation, xor, and special functions. Their implementations are roughly the same length (at least the ones I've seen). Yet it's widely known that MD5 is broken but SHA1 isn't currently.
Is the security difference from the in... |
How is SHA1 different from MD5? |
I have a couple of questions pertaining to a RSA problem. I need to decipher some ciphertext and find out what the original plaintext was.
Modulus: $n = 2537$ and exponent: $a = 11$
Encrypting function: $E(x) = x^{11} \mod 2537$
Using Fermat's Little Theorem to start, I have successfully encrypted some plain... |
Let's assume I want to send a secret message to $N$ recipients in an asymmetric way.
My message could be encrypted with $N$ different public keys $p_i$ one after another and send to each user individually. In practice only a symmetric key $k$ is sent in an asymmetric way I guess, but that's not the point.
Even di... |
I am currently studying Cryptography and I don't really understand what does 'well-typed' mean when talking about secure cryptographic protocols. I can't find any reasonable explanation on the internet either.
It would be great if someone could give definition and maybe example.
For example quote from [“prosecco.... |
This sounds like a classic [codebook][1] or [nomenclator][2].
Even if we assume a perfect [random oracle][3] that generates a completely random codeword for each word of English text,
I agree [with otus](http://crypto.stackexchange.com/a/18503/12164) that frequency attacks and N-grams would likely
be able to decod... |
> Are there performance, size, or power efficiencies from one curve to another?
The larger the curve, the larger the keys and signatures, and likely the slower the computations. There are exceptions to the last one – curve parameters do affect how efficiently they can be implemented, so some curves with good paramet... |
When they write *“well-typed”*, they’re simply stating that the process $P$ is well-typed in context, or type environment. (Where the type environment contains a set of type assumptions occurring in $P$.)
Keeping it simple: you can think of the term as a kind of classification. The term origins in [Type Theory](http... |
When they write *“well-typed”*, they’re simply stating that the process $P$ is well-typed in context, or type environment. (Where the type environment contains a set of type assumptions occurring in $P$.)
Keeping it simple: you can think of the term as a kind of classification. The term origins in [Type Theory](http... |
When they write *“well-typed”*, they’re simply stating that the process $P$ is well-typed in context, or type environment. (Where the type environment contains a set of type assumptions occurring in $P$.)
Keeping it simple: you can think of the term as a kind of classification. The term origins in [Type Theory](http... |
Encrypt-then-MAC does provide ciphertext integrity, but no plaintext integrity. With MAC-then-Encrypt it’s the other way around: Plaintext integrity but no ciphertext integrity.
What comes to mind is that it could make sense to use both to fix that *“partially missing integrity”* issue:
$$\tt …\ MAC_2(ENCRYPT(pl... |
Encrypt-then-MAC does provide ciphertext integrity, but no plaintext integrity. With MAC-then-Encrypt it’s the other way around: Plaintext integrity but no ciphertext integrity.
What comes to mind is that it could make sense to use both to fix that *“partially missing integrity”* issue:
$$\tt …\ MAC_2(ENCRYPT(pl... |
I've been learning about cryptography lately and I'm failing to understand how Diffie-Hellman key exchange works. Can someone please demonstrate using mathematical notation (and if possible, pseudocode) how this works?
I'm also failing to understand how it prevents man-in-the-middle attacks. If Oscar is sitting in ... |
How does Diffie-Hellman key exchange work? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.