instruction stringlengths 15 30k |
|---|
Hash Based Encryption (fast & simple), how well would this compare to AES? |
Hash Based Encryption (fast & simple), how well would this compare to AES? |
Worth reading:
[Can I use HMAC-SHA1 in counter mode to make a stream cipher?](http://crypto.stackexchange.com/questions/12810/can-i-use-hmac-sha1-in-counter-mode-to-make-a-stream-cipher)
This is basically the same construction with the difference that you don't call it counter mode and don't assume a specific has... |
Well, with CFB mode, the encryption process is "take the most recent ciphertext block, pass it through the block cipher, and then exclusive-or that with the plaintext block to generate the next ciphertext block". As for the IV, that's used as "the most recent ciphertext block" when encrypting the first plaintext block... |
In [here][1] different byte padding standarts are listed as ANSI X.923, ISO 101.26, PKCS7, ISO/IEC 7816-4 and zero padding. All of them seems to apply padding to the last byte blocks. Odds are rare but what happens if the actual data is an integer product of the block size and last bytes conflict with a padding scheme.... |
What prevents a padding standart to cause a data loss? |
In [here][1] different byte padding standards are listed as ANSI X.923, ISO 101.26, PKCS7, ISO/IEC 7816-4 and zero padding. All of them seems to apply padding to the last byte blocks. Odds are rare but what happens if the actual data is an integer product of the block size and last bytes conflict with a padding scheme.... |
What prevents a padding standard to cause a data loss? |
A major problem we still face is fazing out old encryption standards with vulnerabilities, without breaking web access to many sites and services for machines or networks running older software like WinXP and IE8, or that may have a high upgrade cost. I think we should just start forcing the issue however by announcing... |
###Q1: Why are these tests stroked out?
These tests are stroked out on pages 57-58 of the [current FIPS 140-2](http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf) because they are no longer part of the current FIPS 140-2 standard, since Change Notice 2 of 2002 December third, where these pages belong.
... |
###Q1: Why are these tests stroked out?
These tests are stroked out on pages 57-58 of the [current FIPS 140-2](http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf) because they are no longer part of the current FIPS 140-2 standard, since Change Notice 2 of 2002 December third, where these pages belong.
... |
A major problem we still face is fazing out old encryption standards with vulnerabilities, without breaking web access to many sites and services for machines or networks running older software like WinXP and IE8, or that may have a high upgrade cost. I think we should just start forcing the issue however by announcing... |
###Q1: Why are these tests stroked out?
These tests are stroked out on pages 57-58 of the [current FIPS 140-2](http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf) because they are no longer part of the current FIPS 140-2 standard, since Change Notice 2 of 2002 December third, where these pages b... |
I am learning SSH protocol. With my current understanding of SSH protocol, I think that message digest algorithms for using in digital signature should be derived from Key Exchange. But Openssh implementation uses only SHA1 for signing and verifying of digital signatures. SHA1 is hard coded in these two functions, ssh_... |
Why does Openssh use only SHA1 for signing and verifying of digital signatures? |
I clearly understand the story of Alice and Bob:
Alice and Bob are going to use double DES. They know the keys K1 and K2.
Alice sends to Bob the encrypted message c= EK1(EK2(m)). Bob decrypts the message m = DK2(DK1(c)). Alice and Bob believe that Eve (the hacker) will need to discover both keys K1 and K2 by bru... |
###Q1: Why are these tests stroked out?
These tests are stroked out on pages 57-58 of the [current FIPS 140-2](http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf) because they are no longer part of the current FIPS 140-2 standard, since Change Notice 2 of 2002 December third, where these pages b... |
Disclaimer: School work.
I am trying to implement Groestl through Java, and have got stuck on the MixBytes section which can be found [here](http://www.groestl.info/Groestl.pdf) section 3.4.5 page 11. As per the description of matrix multiplication, following was my first naive attempt to do it in matrix multiplicat... |
Disclaimer: School work.
I am trying to implement Groestl through Java, and have got stuck on the MixBytes section which can be found [here](http://www.groestl.info/Groestl.pdf) section 3.4.5 page 11. As per the description of matrix multiplication, following was my first naive attempt to do it in matrix multiplicat... |
I read about the following ["safe" ECC curves][1] and notably, secp256 and all the NIST curves are marked as "unsafe".
How should I choose among these remaining curves?
* M-221
* E-222
* Curve1174
* Curve25519
* E-382
* M-383
* Curve383187
* Curve41417
* Ed448-Goldilocks
* M-511
* E-521
Are there p... |
How do I choose between the following curves? |
Let $n$ be a 256-bit value chosen at random. Define
$$\DeclareMathOperator{\H}{H}
\DeclareMathOperator{\SHA}{SHA-256}
\H(x) = \SHA(x\mid_{128})$$
where $x\mid_{128}$ is the most significant 128 bits of $x$ (if there's better notation for the prefix of a string, please let me know).
What is the estimated amou... |
Consider the accepted answer to the question: http://crypto.stackexchange.com/questions/8835/why-are-elliptic-curves-better-than-cyclic-groups
It seems to suggest there are subexponential algorithms (i.e., algorithms with running time
$$
L_n[\alpha,c]=e^{(c+o(1))(\ln n)^\alpha(\ln\ln n)^{1-\alpha}},
$$
where $\l... |
On Wikipedia it is said that HMAC is basically (without taking into account padding):
H(key ∥ H(key ∥ message))
where ∥ denotes concatenation.
I understand the need to hash twice, but why concatenate the key a second time in the outter hashing?
Why not simply hash twice, but without reusing the key, lik... |
Why concatenate the key a second time in HMAC? |
I read about the following ["safe" ECC curves][1] and notably, secp256 and all the NIST curves are marked as "unsafe" when compared to more modern curves.
I need a curve for signing or encryption, (or both) but not sure how to choose from the following:
* M-221
* E-222
* Curve1174
* Curve25519
* E-382
* M-... |
Which of following new (2013) ECC curves is the most secure or efficient? |
###Q1: Why are these tests stroked out?
These tests are stroked out on pages 57-58 of the [current FIPS 140-2](http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf) because they are no longer part of the current FIPS 140-2 standard, since Change Notice 2 of 2002 December third, where these pages b... |
###Q1: Why are these tests stroked out?
These tests are stroked out on pages 57-58 of the [current FIPS 140-2](http://csrc.nist.gov/publications/fips/fips140-2/fips1402.pdf) because they are no longer part of the current FIPS 140-2 standard, since Change Notice 2 of 2002 December third, where these pages b... |
Let $n$ be a 256-bit value chosen at random. Define
$$\DeclareMathOperator{\H}{H}
\DeclareMathOperator{\SHA}{SHA-256}
\H(x) = \SHA(x\mid_{128})$$
where $x\mid_{128}$ is the most significant 128 bits of $x$ (if there's better notation for the prefix of a string, please let me know).
What is the estimated amou... |
On Wikipedia it is said that HMAC is basically (without taking into account padding):
$H(key\ \Vert\ H(key ∥ message))$
where ∥ denotes concatenation.
I understand the need to hash twice, but why concatenate the key a second time in the outter hashing?
Why not simply hash twice, but without reusing the key,... |
On Wikipedia it is said that HMAC is basically (without taking into account padding):
$H(key\ \Vert\ H(key\ \Vert\ message))$
where $\Vert$ denotes concatenation.
I understand the need to hash twice, but why concatenate the key a second time in the outter hashing?
Why not simply hash twice, but without reus... |
I have just started studying Elliptic Curve Cryptography, and I have this doubt. In ECC the group operation is addition (and not multiplication). So, why is ECDLP stated as a variation of the discrete log problem? Wouldn't "discrete multiplier problem" or "discrete factor problem" be more apt?
|
Is the term "Elliptic Curve Discrete Logarithm Problem" a misnomer? |
Common Criteria classifies the requirements for true Random Number Generators, and specifies how these should be tested against failures (these can occur accidentally, or following deliberate attack, e.g. by very low temperature). The relevant [Application note and Interpretation of the Scheme][1] is [AIS 31 version 3.... |
After reading some information on the way iMessage works I have been working on writing some code to try my hand at securely transferring messages in a similar manner and I wanted to confirm that the technique I'm using is considered secure and preferably best practice.
*This process assumes that the sender and rec... |
Is this a secure (and correct) sign-then-encrypt technique for transferring messages? |
Looking at http://safecurves.cr.yp.to/ to find a safe curve, I find that most curves described here are of a different form from that generally used.
In [Bouncy Caslte](https://www.bouncycastle.org/), for example, `FpCurve`s take curves of the form $y^2 = x^3+ax+b$ (Weierstrass), whereas the (safe) curves found on t... |
Consider the accepted answer to the question: http://crypto.stackexchange.com/questions/8835/why-are-elliptic-curves-better-than-cyclic-groups
It seems to suggest there are subexponential algorithms (i.e., algorithms with running time
$$
L_n[\alpha,c]=e^{(c+o(1))(\ln n)^\alpha(\ln\ln n)^{1-\alpha}},
$$
where $\l... |
What is the importance of the R and C values?
Keccak[r=1600,c=0] is stated on a calculator on the Keccak website to be a checksum. But I figured if c=0, then there's only one possible output?
If C is 128, is there only 2^64 possible outputs, despite have infinite output length and an infinite number of inputs? |
What is the importance of the $r$ and $c$ values?
Keccak[r=1600,c=0] is stated on a calculator on the Keccak website to be a checksum. But I figured if c=0, then there's only one possible output?
If C is 128, is there only 2^64 possible outputs, despite have infinite output length and an infinite number of input... |
What is the importance of the $r$ and $c$ values for the Sponge Construction? |
My estimate of the entropy after $i$ iterations is roughly $128- \lg i$ bits (as $i$ grows large). I don't have a proof of this, but I'll lay out my rough back-of-the-envelope calculations below.
----
Here is the general problem:
> **Problem 1.** Let $F:\{0,1\}^n \to \{0,1\}^n$ be a random, i.e., chosen unif... |
After reading some information on the way iMessage works I have been working on writing some code to try my hand at securely transferring messages in a similar manner and I wanted to confirm that the technique I'm using is considered secure and preferably best practice.
*This process assumes that the sender and rec... |
Does a dynamic accumulator exist yet? |
Factoring some 20-45 digit values n with a (simple) quadratic sieve, I've found that the quadratic sieve very often ends up with pairs of x and y s.t. $x^2 \equiv y^2 \pmod n$, but neither x+y nor x-y has a nontrivial gcd with n for any of the pairs.
The contini pdf (www.crypto-world.com/documents/contini_siqs.pdf) ... |
Quadratic Sieve: what's the next step after it fails? |
My estimate of the entropy after $i$ iterations is roughly $128- \lg i$ bits (as $i$ grows large). I don't have a proof of this, but I'll lay out my rough back-of-the-envelope calculations below.
----
Here is the general problem:
> **Problem 1.** Let $F:\{0,1\}^n \to \{0,1\}^n$ be a random, i.e., chosen unif... |
*First of all, I'm sorry to post here. This does not seem to be the right place for this question but this seems to be the best place to get answers from the right people.*
I have a laptop *without* the AES-NI CPU instructions but with SSE4.1.
I'm using Linux and tried the (in-memory) cryptsetup benchmark to get ... |
Would you trust the following Serpent/AES benchmarks? |
> AES has fewer rounds than Serpent so AES should be faster.
The number of rounds by itself is meaningless. Some ciphers have a few complex rounds and others have many simple rounds. See my answer to [Why does SHA-1 have 80 rounds?](http://crypto.stackexchange.com/questions/14971/why-does-sha-1-have-80-rounds/14972#... |
I have a laptop *without* the AES-NI CPU instructions but with SSE4.1.
I'm using Linux and tried the (in-memory) cryptsetup benchmark to get the rough tendency which returned:
# Algorithm | Key | Encryption | Decryption
aes-cbc 128b 133,6 MiB/s 155,7 MiB/s
serpent-cbc 128b 52,3 M... |
Why is Serpent faster than AES in this benchmark? |
> AES has fewer rounds than Serpent so AES should be faster.
The number of rounds by itself is meaningless. Some ciphers have a few complex rounds and others have many simple rounds. See my answer to [Why does SHA-1 have 80 rounds?](http://crypto.stackexchange.com/questions/14971/why-does-sha-1-have-80-rounds/14972#... |
> AES has fewer rounds than Serpent so AES should be faster.
The number of rounds by itself is meaningless. Some ciphers have a few complex rounds and others have many simple rounds. See my answer to [Why does SHA-1 have 80 rounds?](http://crypto.stackexchange.com/questions/14971/why-does-sha-1-have-80-rounds/14972#... |
In general it's hard to calculate the roots of a given polynomial P(x).
But the other way back calculating the coefficients is much easier (Vieta's formulas).
If this is a one-way function, is it possible to create a public-key cryptosystem
based on these facts? Or does it already exist? |
I am generating a key & iv with Ruby's OpenSSL wrapper for an AES CBC 256 setup:
cipher = OpenSSL::Cipher::Cipher.new('aes-256-cbc')
key = cipher.random_key
iv = cipher.random_iv
I am then storing the generated key / iv in blob columns in the database. When trying to display the key or iv it loo... |
Should an AES key generated with OpenSSL be hashed with SHA? |
The reason why you see this gibberish is that the key is random and simply interpreting it as a string of characters doesn't make sense and can lead to all kind of mistakes.
You should inform yourself about hashes! Once you hash something, you are not able to retrieve the original value, so I would guess you don't w... |
I am generating a key & iv with Ruby's OpenSSL wrapper for an AES CBC 256 setup:
cipher = OpenSSL::Cipher::Cipher.new('aes-256-cbc')
key = cipher.random_key
iv = cipher.random_iv
I am then storing the generated key / iv in blob columns in the database. When trying to display the key or iv it loo... |
Should an AES byte key generated with OpenSSL be converted to hex? |
I am generating a key & iv with Ruby's OpenSSL wrapper for an AES CBC 256 setup:
cipher = OpenSSL::Cipher::Cipher.new('aes-256-cbc')
key = cipher.random_key
iv = cipher.random_iv
I am then storing the generated key / iv in blob columns in the database. When trying to display the key or iv it loo... |
I'd like to create a PSK key to use with TLS-RSA-PSK-WITH-AES-256-CBC-SHA - is there a way to use OpenSSL or another tool to do this? |
How to create PSK key? |
Suppose we use Additive ElGamal defined as follows:
> A Tripple <K,E,D>. The Key-generator K outputs the description of a
> finite multiplicative group G of prime order q, with three generators
> <g,h,f> which are set to be the public-key of the system pk; the
> secret-key sk is set to the value log_g(h). For a p... |
Suppose we use Additive ElGamal defined as follows:
> A Tripple <K,E,D>. The Key-generator K outputs the description of a
> finite multiplicative group G of prime order q, with three generators
> <g,h,f> which are set to be the public-key of the system pk; the
> secret-key sk is set to the value log_g(h). For a p... |
Suppose we use Additive ElGamal defined as follows:
> Let $(K,E,D)$ be a triple. The key-generator $K$ outputs the description of a
> finite multiplicative group $G$ of prime order $q$, with three generators
> $(g,h,f)$ which are set to be the public-key $p_k$ of the system; the
> secret-key $s_k$ is set to the v... |
Factoring some 20-45 digit values n with a (simple) quadratic sieve, I've found that the quadratic sieve very often ends up with pairs of x and y s.t. $x^2 \equiv y^2 \pmod n$, but neither x+y nor x-y has a nontrivial gcd with n for any of the pairs.
The contini pdf (www.crypto-world.com/documents/contini_siqs.pdf) ... |
Factoring some 20-45 digit values n with a (simple) quadratic sieve, the quadratic sieve may end up with pairs of x and y s.t. $x^2 \equiv y^2 \pmod n$, but neither x+y nor x-y has a nontrivial gcd with n for any of the pairs.
The contini pdf (www.crypto-world.com/documents/contini_siqs.pdf) is an excellent resource... |
I want to ask again about distinguishing attack on CBC MAC, based on the paper published by Ketting Jia, Xiaoyun Wang, Zheng Yuan, and Guangwu Xu: Distinguishing Attack and Second-Preimage Attack on the CBC-like MACs.
In that paper said: "The adversary makes 2^{(n+1)/2} queries with m-block messages that have the sa... |
I'd like to create a PSK key to use with TLS-RSA-PSK-WITH-AES-256-CBC-SHA - what is the format of this key? |
There's a lot of references about McEliece key size being the barrier for proper usage of the algorithm, exactly (or roughly) how large are the keys? |
[Wikipedia states that McEliece is open to "information set decoding attack"][1]. What is an "information set decoding attack" and how serious is the vulnerability? (is it just a matter of choosing proper padding/parameters or is the issue deeper)
(motivated by http://crypto.stackexchange.com/questions/131/is-key-... |
In OAuth 1.0a and 2.0 using MAC Authorization, I need to generate a hash of all the QueryString Parameters, which requires normalization (alphabetical ordering) of them.
I'm trying to understand what this offers from a security perspective over just generating a hash of Secret Key + Nonce + Timestamp?
My guess is... |
What is the idea behind hashing the QueryString in OAuth? |
Why approximately $2^{(n+1)/2}$ queries? Because it makes the attack work.
As far as your final comment, it sounds like you are confusing $(n+1)/2$ with $2^{(n+1)/2}$. If we use AES, then $n=128$, so $(n+1)/2=64.5$. However, $2^{64.5}$ is a very large number. The exact number of queries is not important as long ... |
I want to ask [again][1] about distinguishing attack on CBC MAC, based on the paper published by Ketting Jia, Xiaoyun Wang, Zheng Yuan, and Guangwu Xu: [_Distinguishing Attack and Second-Preimage Attack on the CBC-like MACs_][2].
That paper says: "The adversary makes $2^{(n+1)/2}$ queries with $m$-block messages tha... |
When using this very minimal CryptoJS AES example:
<script src="http://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/aes.js"></script>
<script type='text/javascript'>
var passphrase = "Secret";
var enc = CryptoJS.AES.encrypt("Message", passphrase);
var result = enc.toString();
va... |
CryptoJS.AES result always has same first few bytes? |
The Needham-Schroeder protocol is:
1 A→S:A,B,Na
2 S→A:{Na,B,Kab,{Kab,A}Kbs}Kas
3 A→B:{Kab,A}Kbs
4 B→A:{Nb}Kab
5 A→B:{Nb−1}Kab
Here Na and Nb are nonces.
Kab is the key between a and b
Kas is the key between A and KDC
Kbs is the key between B and KDC
My Question : In step 2 if we don't encrypt with Kbs & i... |
The Needham-Schroeder protocol is:
<br>
1 A→S:A,B,Na
<br>
2 S→A:{Na,B,Kab,{Kab,A}Kbs}Kas
<br>
3 A→B:{Kab,A}Kbs
<br>
4 B→A:{Nb}Kab
<br>
5 A→B:{Nb−1}Kab
Here Na and Nb are nonces.
<br>
Kab is the key between a and b
<br>
Kas is the key between A and KDC
<br>
Kbs is the key between B and KDC
My Quest... |
How would you go about solving basic custom made ciphers - e.g. one generated from this website <http://www.wikihow.com/Write-a-Custom-Cipher-Carefully>?
This is solving it without knowing the method of the cipher beforehand. |
How to solve custom made ciphers? |
I have a laptop *without* the AES-NI CPU instructions but with SSE4.1.
I'm using Linux and tried the (in-memory) cryptsetup benchmark to get the rough tendency which returned:
# Algorithm | Key | Encryption | Decryption
aes-cbc 128b 101,4 MiB/s 159,6 MiB/s
serpent-cbc 128b 52,7 M... |
It's not clear what they actually mean by half of their things, or if there is any benefit of using them together. That site doesn't want to create any meaningful security, it's just to play around with numbers and letters.
- They state to use Vigenere, that's okay, usual classic cipher, which can be broken if the t... |
Soundness does not necessarily hold.
<br>
If `2 < m` and `n = (m*m)-1` and `h = (m*m)-2` and `g = m`, then `h` is not in the subgroup generated by `g` but `y=1` and `s=0` will cause any even challenge to result in acceptance.
<br>
What is the challenge space? |
[As both of us recently learned](http://crypto.stackexchange.com/a/15086/8525), the public key signature hash algorithm is negotiated completely separately from the MAC algorithm. DSA and RSA use SHA-1, ECDSA uses SHA-2, and [Ed25519](http://www.openssh.com/txt/release-6.5) uses, um, Ed25519.
I'm skeptical that SSH ... |
I've had an assignment to sign a file using hash and salt, so I read about salt and I got who it's important when it comes to password, but not to sign messages.
1- how to sign using salt ? the only way I could think of is I add the salt to the message then hash them, then send the hash along with the salt (encrypte... |
how to use salt to sign a message and how is it effective? |
I am studying a function where I found the some hash properties.
Hash functions:
1 Given a code c is computationally infeasible to find m such
that h(m) = c
2 Given m is computationally infeasible to find n != m such that
h(m) = h(n)
3 It is computationally infeasible to find any pair (m, n) such
that h(... |
1. Given an RSA implementation that uses Montgomery multiplications and CIOS exp algo, but NOT CRT.
2. Given a decryption1 oracle that takes chosen cipher text and responds the plain text and the time it took to decrypt it.
3. Given a decryption2 oracle that takes N,d,c and uses the same code as decryption1 oracle... |
I understand how for hash functions which are vulnerable to length extension attacks (such as SHA1 and SHA2) it is safer to use a HMAC construction.
What I don't understand is, how or why is HMAC_SHA256(message,key) safer (in terms of resistant against certain attacks) than SHA256(key1+message+key2), assuming that a... |
I have a Weierstrass elliptic curve (y^2=x^3+a*x+b (mod p) )
How can I find the order of the group itself? I have seen Mathematica has a GroupOrder[] command and WolframAlpha will do it for me, but how can I do it myself, mathematically?
The modulus, p, will be a large prime number, say 256 bits or more. |
How can I find the order of the group that an elliptic curve is defined over? |
For cryptographic hash functions, there are the 3 definitions of *collision resistance*, *(first) preimage resistance* and *second preimage resistance*.
Number 3 is collision resistance, and it is quite different than No. 1 and No. 2, which is due to the [birthday problem](http://en.wikipedia.org/wiki/Birthday_probl... |
Alice and Bob want to agree on a bit $0$ or $1$. Both know it would be fair to pick that at random, but there's no way they could meet to throw a dice and no third party they could trust. Are there known protocols that allow either side to prove that they did not manipulate the outcome?
My idea is: Both randomly (or... |
Alice and Bob want to agree on a bit $0$ or $1$. Both know it would be fair to pick that at random, but there's no way they could meet to throw a dice and no third party they could trust. Are there known protocols that allow either side to prove that they did not manipulate the outcome?
My idea is: Both randomly (or... |
Let $n$ be a 128-bit value chosen at random. Define
$$
\DeclareMathOperator{\H}{H}
\DeclareMathOperator{\SHA}{SHA-256}
\H(x) : \left\{0,1\right\}^{n} \mapsto \left\{0,1\right\}^{n}
$$
instantiated for
$$
\begin{align*}
\H(x) &= \SHA\left(x\right)\mid_{n} \\
n &= 128
\end{align*}
$$
Given $x \xlefta... |
Apparently current best practices recommend that you do not compress before you encrypt.
For example in this blog entry (*):
http://sockpuppet.org/blog/2013/07/22/applied-practical-cryptography/
It is written:
> Developers shouldn’t compress plaintext before encrypting.
Or in this question here on *crypt... |
How does compression before encryption leak info about the input? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.