instruction
stringlengths
15
30k
Are these 2 equations equivalent?
I'm implementing the Secure Remote Protocol that is specified to have this equation for the parameter `S`, the premaster secret. S = (B - (k * g^x)) ^ (a + (u * x)) % N But the implementation I'm referring to, has done it this way. Is this equivalent to the author's description? Its too complex for me to und...
Secure Remote Protocol - Are these 2 equations equivalent?
As evident from the site of john the ripper, JTR [example][1], john can be used for finding password form a unix machine `passwd` file. can JtR be used to crack password of a password encrypted word file? I know there is another utility by openwall which does the same... [1]: http://www.openwall.com/john/doc...
To answer your second question, Paillier and other CPA-secure homomorphic encryption schemes cannot provide order-preserving encryption. The security of these schemes rely on using a random factor during encryption to ensure their ciphertexts are distributed randomly in the ciphertext space. OPE [must use][1] a weaker ...
Suppose I have a cryptography library that provides me with a black-box random number generator that is supposed to be suitable for long-lived key generation. (Under the hood it may be assumed to use some combination of `/dev/random` or equivalent, and stretching with a CSPRNG.) I would like to write a unit test th...
To authenticate a message $m = m_1 \,\|\, \dots \,\|\,m_n$ the tag $t := F_k(r) \oplus F_k(m_1) \oplus \dotsb \oplus F_k(m_n)$ is used, where r is uniform random number $(0,1)^n$ and $m=(0,1)^n$. Even though the random number is prepended to the sequence there is still a chance of reordering the message blocks which ma...
I'm deploying a secure remote password protocol implementation and I'm wondering what the consequences are when the client generated verifier gets leaked to an attacker. I've read Thomas Wu's [paper][1] and as nice as it is, it doesn't talk about that scenario. I also read [RFC 5054][2] and it has the assertion: >...
How realistic is a dictionary attack on a secure remote password protocol (SRP) verifier?
I'm deploying a secure remote password protocol implementation and I'm wondering what the consequences are when the client generated verifier gets leaked to an attacker. I've read Thomas Wu's [paper][1] and as nice as it is, it doesn't talk about that scenario. I also read [RFC 5054][2] and it has the assertion: >...
I have a block of data crypted using twofish with a key of 128 bit. The data must be accessed from a GUI, the user gives the key, the block is decoded and the real data is accessed. Problem is that I need to be sure that the key is correct *before* trying to decode the block. My current solution is to have a ...
In order for a symmetric block cipher to be considered secure by modern standards, it has to be [IND-CPA][1], that is indistinguishable from a random oracle under a chosen plain text attack. It also has to be IND-CCA and IND-CCA2, but IND-CPA is sufficient for it to also be secure under a known plain text attack. P...
I have a block of data crypted using twofish with a key of 128 bit. The data must be accessed from a GUI, the user gives the key, the block is decoded and the real data is accessed. Problem is that I need to be sure that the key is correct *before* trying to decode the block. My current solution is to have a ...
Given that the 64 bit secret and 10 bit PIN are truly random, we are talking about brute forcing 2^74 MD5s (and we will have to do this multiple times, as each 6 digit one time password intercepted will have billions of collissions). Given a fast hardware that can do 200 Million MD5s per second, each one time password...
Given that the 64 bit secret and 10 bit PIN are truly random, we are talking about brute forcing 2^74 MD5s (and we will have to do this multiple times, as each 6 digit one time password intercepted will have billions of collissions). Given a fast hardware that can do 200 Million MD5s per second, each one time password...
Suppose you have an infinite list of random bytes, and you select the first N bytes that correspond to printable ASCII characters. Is this list of N bytes still as secure (e.g. for the purpose of a crypto secret or salt) as accepting all of the bytes (printable ASCII or otherwise)? I am basically asking whether this...
Is a subset of a random set still random?
I have the following question "What polynomial when factored over the field GF (2^8) based on the irreducible polynomial that is used in Rijndael will factor into all the polynomials in the field?" What I understand is the polynomial should be irreducible polynomial and this polynomial must factor all the polynom...
There are several questions hidden in your question. You'll have to distinguish between the polynomial ring $\mathbb Z_2[X]$, and the factor field $GF(2^8) = \mathbb Z_2[X]/F$ (where $F$ is any irreductible polynomial of degree 8). In $\mathbb Z_2[X]$, the only polynomial which **is a factor of all others** is th...
I'm working with a server/client system that has securely negotiated a private key. I need to encrypt/decrypt messages passing in both directions which are typically between 100 bytes to 100 KB. I'm working with AES-128 bit, but I cannot really understand how the private key is to be used with the encryption algorithm....
How should a private key be used with the CBC/CTR modes of encryption?
How to calculate an IV when I have a shared private key?
I assume you're using CBC mode. > Or is it fine to calculate a random IV and send the IV on the wire? That's perfectly fine. It's standard practice to send the IV over the wire together with the message. IVs aren't secret. Typically they're used so encrypting the same text twice gives different output.
Well, to start off with, IVs have different security properties than keys. With keys (as you are well aware), you need to hide them from anyone in the middle; if someone did learn your keys, then he could read all your traffic. IVs are not like this; instead, we don't mind if someone in the middle learns what the I...
I have the following question: > What polynomial when factored over the field GF (2^8) based on the irreducible polynomial that is used in Rijndael will factor into all the polynomials in the field? As I understand it, the polynomial should be an irreducible polynomial and this polynomial must factor all the poly...
I have the following question: > What polynomial, when factored over the field $GF (2^8)$ based on the irreducible polynomial that is used in Rijndael, will factor into all the polynomials in the field? As I understand it, the polynomial should be an irreducible polynomial and this polynomial must factor all the ...
Even after revision, this question makes litle sense. The OP wants a _polynomial_ with the property that > ... this polynomial must factor all the polynomials or possibly > ... will factor into all the polynomials in the field With regard to the first, a polynomial is not an operator or algorithm that c...
Even after revision, this question makes litle sense. The OP wants a _polynomial_ with the property that > ... this polynomial must factor all the polynomials or possibly > ... will factor into all the polynomials in the field With regard to the first, a polynomial is not an operator or algorithm that c...
> I'm was wondering if all the SHA algos return a fixed length hash regardless of the length of the data? Others have noted that the output is indeed a constant, fixed size, so let me nit-pick one point just for completeness: It is worth noting that these hash functions do have a limit to the input size of their...
I'm looking for some PRNGs and as I have been using Java for a long period of time I thought that the BitInteger class together with the Random class could both generate some large pseudo random numbers. Are the algorithms behind those generations cryptographically secure? Or is it just some sort of a + (b - c) mod d o...
Well, to start off with, IVs have different security properties than keys. With keys (as you are well aware), you need to hide them from anyone in the middle; if someone did learn your keys, then he could read all your traffic. IVs are not like this; instead, we don't mind if someone in the middle learns what the I...
As explained in William Stallings Book, in PGP encryption is done after compression, since it reduces redundancy. I couldnt relate encryption strength with redundancy. Could anyone explain more on that?
As explained in [William Stallings' Book][1], in [PGP][2] encryption is done after compression, since it reduces redundancy. I couldn't relate encryption strength with redundancy. Could anyone explain more on that? [1]: http://www.amazon.com/Cryptography-Network-Security-Principles-Practice/dp/0136097049 [...
Is compressing data prior to encryption necessary to reduce plaintext redundancy?
I am confused about how long a stream cipher can be used before you should change the key. To be concrete, let me use the stream cipher based on RC4 as an example. Let's say I want to encrypt a **very** long message. I pick a key with 128 bits and start encrypting using the RC4 stream cipher. How many rounds does RC...
What is the PRG period of stream ciphers such as RC4 or Salsa20?
Which encodings have |encoding key| >> |decoding key|?
The internal state of RC4 consists of a shuffled 256-element array and two pointers into that array. Thus, there are a total of $$256! \times 256^2 \approx 2^{1700.00}$$ possible states. Since the state update function of RC4 is reversible, it acts as a permutation on this set of possible states, so that every starti...
I'm using the Paillier cryptosystem in a protocol similar to mental poker. In the beginning of the protocol, each player generates a Paillier public key $(n,g)$. Later in the protocol, a player may reveal any message encrypted by his public key (by revealing both the message and the randomizer used). The other playe...
The RC4 period [depends on the exact key][1] (PDF) that was used, but should in general be very long. It is expected to be [at least 10^100][2]. See the first link, page 4, for a more detailed description of the relationship between the key and the period. [1]: http://rc4-attack.googlecode.com/files/RC4_Cryptan...
Even after revision, this question makes litle sense. The OP wants a _polynomial_ with the property that > ... this polynomial must factor all the polynomials or possibly > ... will factor into all the polynomials in the field With regard to the first, a polynomial is not an operator or algorithm that c...
First, the awkwardness of ZKPs and distributed key generation in Paillier is the reason many protocols use exponential Elgamal for protocols like mental poker. It is additively homomorphic but has the drawback on only being able to decrypt a small message space. In your case, since users are opening their encryptions, ...
I want a way to encrypt files using this process: http://crypto.stackexchange.com/a/15 . That is: generate a random password, use that to AES-encrypt a file, and use an RSA public key to encrypt the random password. I can arrange for the password (= AES key) to be randomly generated every single time, and can arrang...
Is RSA padding needed for single recipient, one-time, unique random message?
I recommend that you stick with the standard padding methods, even in your scenario. Here's one reason, if your 'random password' consists only of the AES key, and you use the raw RSA operation on it (that is, zero pad it to the size of the RSA modulus, and then compute $M^e \bmod N$), then yes, there does exist wea...
What are the constraints on the random password? You mention it will be used as an AES key, but your use of the word "password" suggests it might be something like an ASCII string that is later transformed into an AES key. One of the more straight forward attacks against RSA is when the encryption exponent and the b...
What are the constraints on the random password? You mention it will be used as an AES key, but your use of the word "password" suggests it might be something like an ASCII string that is later transformed into an AES key. One of the more straight forward attacks against RSA is when the encryption exponent and the b...
I am making an arduino project to open my garage door. I want to make it so users with the passphrase can open the door. Due to computational restrictions it is unlikely encryption is possible. Under the assumption that only hashing algorithms are available, what is a secure way of protecting the door? My thoughts:...
How to authenticate over open channel?
I am making an arduino project to open my garage door. I want to make it so users with the passphrase can open the door. Due to computational restrictions it is unlikely encryption is possible. Under the assumption that only hashing algorithms are available, what is a secure way of protecting the door? My thoughts:...
In compressed form, ECDSA public keys are one bit larger than the curve size. There are some situations where this extra bit is extremely inelegant. So I had the following idea as a way to remove it. 1. For a public key, the extra bit is always zero and so does not need to be sent. 1. If a private key produces an...
What you're suggesting is likely good enough, and very likely far more secure than just about any other lock on your house. If the only hash function you can find is MD5, go with it, but make sure to HMAC with the passphrase as the key. Again, it's not going to be the weak point of your security. I'm sure I could pi...
I want to use the improved sha1 hashing algorithm from the Intel blog described here Intel sha1 hashing. Currently I am using Openssl sha1 hashing in my application. 1. I wanted to know if anybody has used the Intel sha1 hashing and how does it compare against Openssl implementation as far as performance is concerne...
I want to use the improved sha1 hashing algorithm from the Intel blog described [here][1] Intel sha1 hashing. Currently I am using Openssl sha1 hashing in my application. 1. I wanted to know if anybody has used the Intel sha1 hashing and how does it compare against Openssl implementation as far as performance is con...
Imagine a Wi-Fi network protected by WEP/WPA/WPA2. Users can join the network in case they know the pre-shared key of the access point. Is it possible for a user A (who has successfully logged into the network) to sniff on the data communication of another user B, entirely because A uses the same pre-shared key lik...
Can a user of a password-protected Wi-Fi sniff on other user's communication?
Suppose you need to authenticate yourself to a program with the password - but the program's source code is public, the program doesn't have access to any private information and all your communications with the program are public. The only privacy you have is the information that you have but don't send. No fixed ...
Rapidly changing passwords?
there are several papers about Secure Indexes. For Example "Searchable Symmetric Encryption: Improved Denitions and Ecient Constructions" (http://eprint.iacr.org/2006/210.pdf) or "Secure Indexes" (http://crypto.stanford.edu/~eujin/papers/secureindex/secureindex.pdf). I'm trying to build a system, that uses secure inde...
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, implementing th...
Are there any Implementations of Secure Indexes?
A [comment](http://crypto.stackexchange.com/questions/2199/how-to-authenticate-over-open-channel#comment3538_2199) on [another question](http://crypto.stackexchange.com/questions/2199/how-to-authenticate-over-open-channel) made me wonder about something: > Assume you're on a rather constrained platform — say, ...
Can you make a hash out of a stream cipher?
A [comment](http://crypto.stackexchange.com/questions/2199/how-to-authenticate-over-open-channel#comment3538_2199) on [another question](http://crypto.stackexchange.com/questions/2199/how-to-authenticate-over-open-channel) made me wonder about something: > Assume you're on a rather constrained platform — say, ...
This mode is that each time generate a random number K, xor with plaintext M and the pass the result to AES. My question is that since AES is pseudo random permutation, does AES have the following property: AES(M xor K) = AES(M) xor AES(K)? Thanks.
HMAC-based One Time Password (HOTP) was published as an informational IETF RFC 4226 in December 2005. In May, 2011, Time-based One-time Password Algorithm (TOTP) officially became RFC 6238. What advantages it introduces?
What are the advantages of TOTP over HOTP?
A [comment](http://crypto.stackexchange.com/questions/2199/how-to-authenticate-over-open-channel#comment3538_2199) on [another question](http://crypto.stackexchange.com/questions/2199/how-to-authenticate-over-open-channel) made me wonder about something: > Assume you're on a rather constrained platform — say, ...
First, it's a step in some challenge found on the Internet, where we get an application and a file. The application must be feed with that file and a password (the password is the flag for the challenge). So, after reversing the application, I found that the algo used is RC4 with a small change in the "S" array, whi...
RC4 : Keystream reconstruction?
I am writing a small program which uses AES.In testing it with wrong passwords,I get error prompts from Microsoft C# component saying "the padding is bad";whereas I expect wrongly decoded texts.Let me ask whether these errors are by the AES original definition or not? Thank you in advance.
Abput AES cryptograpy,is it microsoft C# specific or by the AES design that a wrong password gets an error?
In the first decade of the 21th century, and counting, on a given $Year$, no RSA key bigger than $(Year-2000)\cdot 32+512$ bits has been openly factored other than by [exploitation of a flaw of the key generator][1]. This linear estimate of _academic_ factoring progress should be used neither for long-term predictions ...
**Background** In both, bitstrings are interpreted as a polnomical over GF(2) and they each can be used to implement a hash over a sliding window. The definitions of each are as follows: CRC: $M(x) = Q(x) \cdot G(x) + R (x)$ Rabin Fingerprint: $M(x) \cdot x^{n} = Q(x) \cdot G(x) + R (x)$ Where $M(x)$ is mes...
Does the Rabin Fingerprint algorithm have any advantages over CRC?
I am writing a small program which uses AES. In testing it with wrong passwords, I get error prompts from Microsoft C# component saying "the padding is bad"; whereas I expect wrongly decoded texts. Do these errors come from the original AES spec or not?
Does AES specify error messages when using the wrong password to decrypt?
**Background** In both, bitstrings are interpreted as a polnomical over GF(2) and they each can be used to implement a hash over a sliding window. The definitions of each are as follows: CRC: $M(x) = Q(x) \cdot G(x) + R (x)$ Rabin Fingerprint: $M(x) \cdot x^{n} = Q(x) \cdot G(x) + R (x)$ Where $M(x)$ is mes...
Do Rabin Fingerprints have any advantages over CRC?
In order to guard against denial-of-service attacks, I want to require clients to do some work (more work than the server does fulfilling the request) before talking to them. 1. Client connects 2. Server sends a challenge, including a piece of data "Find bytes x such that hash(challengeData + x) has n zero...
What challenge should I use in a challenge-response proof-of-work?
In order to guard against denial-of-service attacks, I want to require clients to do some work (more work than the server does fulfilling the request) before talking to them. 1. Client connects 2. Server sends a challenge, including a piece of data "Find bytes x such that hash(challengeData + x) has n zero...
If what the program does is "take your password, use that as-is as the key to a (modified) RC4 encryption algorithm, and use that keystream to decrypt the entire file", well, there is no obvious weakness to take advantage of. Partial information doesn't help you much (for that matter, they could have given you the ent...
If what the program does is "take your password, use that as-is as the key to a (modified) RC4 encryption algorithm, and use that keystream to decrypt the entire file", well, there is no obvious weakness to take advantage of. Partial information doesn't help you much (for that matter, they could have given you the ent...
At stackoverflow [this](http://stackoverflow.com/questions/9883359/gathering-entropy-in-web-apps-to-create-more-secure-random-numbers/9897411#comment12696984_9897411) question has been asked. It uses additional random entropy and a hash method (among others) to try and create a cryptographically secure pseudo-random nu...
At stackoverflow [this](http://stackoverflow.com/questions/9883359/gathering-entropy-in-web-apps-to-create-more-secure-random-numbers/9897411#comment12696984_9897411) question has been asked. It uses additional random entropy and a hash method (among others) to try and create a cryptographically secure pseudo-random nu...
My question might appear the same as that [question][1], but actually i did read all the answer and none of them helped me well with the details i need. I am new to cryptography and my problem is with two time pad attacks on OTP. The problem i had in my course was that i have 10 cipher texts encrypted with the same...
The cipher AES256-SHA is used among other places in TSL/SSL across the Internet. It's considered among the top ciphers. In theory it's not crackable since the combinations of keys are massive. However NSA has categorized this in [Suite B][1], they have also recommended using higher then 128-bit keys for encryptio...
How secure is AES256-SHA?
**Background** In both, bitstrings are interpreted as a polnomical over GF(2) and they each can be used to implement a hash over a sliding window. The definitions of each are as follows: Rabin Fingerprint: $M(x) = Q(x) \cdot G(x) + R (x)$ CRC: $M(x) \cdot x^{n} = Q(x) \cdot G(x) + R (x)$ Where $M(x)$ is mes...
If a pseudo-random sequence generator is built so that it uses a 128-bit seed and outputs a string that is of length 1000. Let's say one wants to generate a bit string of length 100000 and uses the previous PRSG over and over to obtain 100000 bits out of the 1000 bits produced per run. In order to stop repetitions the ...
Is anyone able to point me towards a known-to-be-good diffie-hellman group ?I currently use group 24 (RFC5114, 2048-bit MODP Group with 256-bit Prime Order Subgroup) it came to me that this group is not adequate even for AES-128 (this is according to www.cryptopp.com/wiki/Diffie-Hellman)...so far it seems my only optio...
If a pseudo-random sequence generator is built so that it uses an n-bit seed and outputs a string that is of length x. Let's say one wants to generate a bit string of length y and uses the previous PRSG over and over to obtain y bits out of the x bits produced per run. In order to stop repetitions the last n bits of ea...
Well, the question you should be asking "what are my security goals" and only then start addressing which cryptographical primitives (DH groups) meet them. I rather suspect that your real security goals fall rather short of "unless someone can perform $O(2^{256})$ operations, they can't break it". So, the real qu...
Can the premaster secret generated by SRP be used as a secure private key?
One of the methods to break a ECDLP is Pollard's rho algorithm. When ECDLP is defined over a finite field $F_p$, and given a relation $S=w.T$, where S and T are a member of $F_p$. Then ECDLP is to find w. The algorithm is supposed to take a time $O(\sqrt p)$. The authors say its exponential or subexponential, at ...
I understand the basics of OTP: |keyspace| = |plaintext| implies perfect security, key reuse destroys this. Cryptanalysis on the N-Time Pad for N > 1 involves finding patterns in the ciphertext; this, however, all seems based on the premise that patterns exist in the plaintext (e.g. English language). My question...
The cipher AES-256 is used among other places in TSL/SSL across the Internet. It's considered among the top ciphers. In theory it's not crackable since the combinations of keys are massive. Although NSA has categorized this in [Suite B][1], they have also recommended using higher then 128-bit keys for encryption....
How secure is AES-256?
I understand the basics of OTP: $|\text{key space}| = |\text{plaintext space}|$ implies perfect security, key reuse destroys this. Cryptanalysis on the $N$-Time Pad for $N > 1$ involves finding patterns in the ciphertext; this, however, all seems based on the premise that patterns exist in the plaintext (e.g. Englis...