instruction
stringlengths
15
30k
I'm writing a function to act as a cryptographic hash of a number within a range that returns another number of the same range. The catch is that the result needs to have certain properties. I run a simple test for these properties and call the function recursively if the test fails. Naturally this raises a red flag fo...
Is a timing side channel attack effective when the leaked information is related to the result of a hash?
I have a scenario that uses RFC-3526's Diffie-Hellman Group 14 for 2048 bit key exchanges. From the document, it specifies the P (prime) value in hexadecimal value as: FFFFFFFF FFFFFFFF C90FDAA2 2168C234 C4C6628B 80DC1CD1 29024E08 8A67CC74 020BBEA6 3B139B22 514A0879 8E3404DD EF9519B3 CD3A431B 302...
>Now when i am validating the certificate do i need to trace back the whole chain to validate the certificate? Not each time, no. You can do some caching, if you like (since root CAs tend to be valid for many years). But I don't think performance gains will be worth the added complexity of the caching idea. Also:...
I'd like to have a peek at the firmware of a piece of Hardware. Its firmware is available as a .wav file to be uploaded via audio jack. https://drive.google.com/open?id=0B6S_PcWWM1YlQnNwT2FSMnFzVE0 And it sure looks like straight forward frequency modulation. I think I can even make out a pattern: useful signal (...
https://en.wikipedia.org/wiki/Hill_climbing https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange If Eve intercepts all the values communicated between Alice and Bob, and applies the hill-climb algorithm to reverse the modulo function, how will the algorithm know whether it is following the right path?
Is it possible to apply hill-climb algorithm to diffie-hellman ciphertext?
If Eve intercepts all the values communicated between Alice and Bob in a [Diffie–Hellman key exchange][1], and applies the [hill-climbing algorithm][2] to reverse the modulo function, how will the algorithm know whether it is following the right path? [1]: https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key...
Is it possible to apply hill-climbing algorithm to Diffie–Hellman?
How can I prove I have a certain Facebook account by signature?
I have an RSA signature of 1024 bit where i know the following: - Public modulus N - Public exponent (0x03) - A lot of cypher message **Summary:** An MD5 hash is calculated from a collection of byte and is used as message (M). Our teacher give us more than one signature in order to recover the private expon...
For a software, I don't want the user to choose weak keys, so I plan to just read the needed number of bytes from /dev/random to create the needed secret keys. Is it safe to do so?
Is it safe to initialize secret keys by just reading /dev/random on Linux?
I have an RSA signature of 1024 bit where i know the following: - Public modulus N - Public exponent (0x03) - A lot of cypher message **Summary:** An MD5 hash is calculated from a collection of byte and is used as message (M). Our teacher give us more than one signature in order to recover the private expon...
I believe it contains public key but whose? the site like a bank or the certificate authority who has signed?
What does CA certs contains? public key of site or CA?
Yes, in any algorithm where keys are just random numbers, reading them from `/dev/random` is safe. However, `/dev/random` blocks if the kernel's entropy estimate goes to zero so it is often a good idea to use a user space CSPRNG seeded from `/dev/u?random` for session keys and other similar random numbers that are u...
This is problem 10 of Chapter 4 "[Symmetric Encryption][1]" (pdf) from [Lecture notes by Bellare and Rogaway][2]: > An IND-CPA secure encryption scheme might not conceal identities, in > the following sense: given a pair of ciphertexts C, C′ for > equal-length messages, it might be “obvious” if the ciphertexts wer...
How can IND-CPA encryption be identity revealing?
what is the answer this biased six sided die roll?
How secure is a pronounceable password in terms of entropy?
Generating unbiased numbers with a biased six sided die?
Consider two schemes both have computation complexity linear to the input size (i.e. number of inputs). One scheme is based on Paillier encryption and the other one is based on fully homomorphic encryption. **Question 1**: In general, can we compare their performance (i.e. which one is faster)? **Question 2**: I...
CPA attack means the attacker can send in his own plaintext to the oracle and receives some sort of ciphertext back. CCA attack means the attacker can send in his own ciphertext to the oracle and return some sort of plaintext back. When we talk about CPA and CCA secure, what exactly are we referring? All this tim...
I am trying to understand how to calculate the average key search time given a specific scenario: Suppose we have a program that uses standard DES with 56 key bits, and we can test 10^6 keys per second. The key consists of 8 characters, a simple concatenation of the 8 ASCII characters yielding 64 = 8*8 key bits....
At $10^6$ keys per second, going through the full $2^{56}$ keys would take $2^{56}/10^{6}$ seconds, or about 2200 years; the average time would be half that (or a bit more than 1000 years). Obviously, this is longer than anyone would be willing to wait. So, why is DES considered brute-forcible? Well, we can throw ...
I have some encoded strings which are probably encoded in a base64-variant - except that there aren't only 64 chars, but all the (printable) ASCII chars between 33 and 126 (0x21 to 0x7E). I've searched for other base64-variants but only found variants like base85 which excludes some characters that may cause proble...
Weird base64-like (?) encoding
I've been reading up on probabilistic polynomial-time algorithms and one-way functions, and I was hoping to get some guidance on the topic. A textbook I'm reading states the following for one of the conditions for one-way functions: **Hard to invert:** For every probabilistic polynomial-time inverting algorithm A...
I've been reading up on probabilistic polynomial-time algorithms and one-way functions, and I was hoping to get some guidance on the topic. A textbook I'm reading states the following for one of the conditions for one-way functions: **Hard to invert:** For every probabilistic polynomial-time inverting algorithm A...
I have an RSA signature of 1024 bit where i know the following: - Public modulus N - Public exponent (0x03) - A lot of cypher message **Summary:** An MD5 hash is calculated from a collection of byte and is used as message (M). Our teacher give us more than one signature in order to forge a new matching sign...
Im currently studying for a cryptography exam. Ive been given the following cipher text that has been encrypted by a columnar transposition cipher. Ive been given no shift key length or key word, only thing I know is that only 2 columns have been shifted. hsei eea tnc lnsgaliipsilmnni n p ipihaoifeo netssmfdtsp ...
I've been reading up on probabilistic polynomial-time algorithms and one-way functions, and I was hoping to get some guidance on the topic. A textbook I'm reading states the following for one of the conditions for one-way functions: **Hard to invert:** For every probabilistic polynomial-time inverting algorithm A...
I'm currently studying for a cryptography exam. I've been given ciphertext that has been encrypted by a columnar transposition cipher. I've been given no shift key length or key word, the only thing I know is that only 2 columns have been shifted. How can I determine the key? Or better yet, is there another way to d...
How to break a columnar transposition cipher?
I have seen numerous references on the internet of people describing SHA-256 as generating an "almost unique" hash. [Exhibit A](http://www.xorbin.com/tools/sha256-hash-calculator). there are more. Is there some mathematical basis to the almost uniqueness? I would have thought that as SHA-256 is an evenly-distibut...
SHA-256 "almost unique"?
Theoretically, since the domain of SHA-256 contains $2^{2^{64}-1}$ different messages and the value set only contains $2^{256}$ different message digests, there must exist at least one possible output that has more than one possible pre-image. Another important point is that SHA-256 is a deterministic function. This...
I have a question . How the system know the attributes of the users to be after that as a public key in ABE?
So I have been reading and learning a lot about cryptography lately and in particular asymmetric ciphers such as RSA. One thing that I am curious about but never seems to be mentioned is how the cipher algorithm manages to compute such enormous numbers in reasonable amounts of time. [This example][1] shows what I...
How does RSA compute such enormous numbers?
In Gentry's paper on fully homomorphic encryption using ideal lattices, he finds the values of vectors modulo a certain basis. For instance: ψ ← ψ' (mod B) taken from :https://crypto.stanford.edu/craig/craig-thesis.pdf, page 69. What does it mean to evaluate a vector modulo a basis?
In Gentry's paper on fully homomorphic encryption using ideal lattices, he finds the values of vectors modulo a certain basis. For instance: $\psi \leftarrow \psi' \mod B$ Taken from page 69 of [Gentry's thesis](https://crypto.stanford.edu/craig/craig-thesis.pdf). What does it mean to evaluate a vector modu...
Real-world example of AES-GCM?
For a college programming assignment I have to implement a secure communication protocol between a server and one or more clients. Upon instantiation of the server program, a file is generated, call it 'server_file'. This is then placed in a known location and assumed to be made available to the client program(s) via a...
Looking in some cryptographic algorithms, I've realized that: The way the plain text is encrypted/decrypted is always specified, but what about the key? Every paper I've seen describing the algorithm never show a way to generate a key, but show the available key sizes. This leads me to a question: How should I gener...
Is there a correct way to generate a symmetric key?
Everywhere I read, indistinguishability of output from true random is stated as a requirement for CSPRNGs. However nobody bothered to give the rationale for such a strong requirement. Specifically, Yarrow and Fortuna both use a block cipher as the generator, and both limit the amount of output that can be produced b...
There are many examples of md5 collisions (some of them can be found here http://crypto.stackexchange.com/questions/1434/are-there-two-known-strings-which-have-the-same-md5-hash-value). But as far as I know two inputs should have the same length to have the same md5 (or same hash in general). Is it correct? Is there an...
There are many examples of MD5 collisions (some of them can be found here http://crypto.stackexchange.com/questions/1434/are-there-two-known-strings-which-have-the-same-md5-hash-value). But as far as I know two inputs should have the same length to have the same MD5 (or same hash in general). Is it correct? Is there an...
Are there MD5 collisions for inputs of different length?
I try to understand how Complexity of an LSFR calculated. For example I have a bit sequence 110101 and it's profile 1 1 2 2 3 3. Is there any easy way in order to produce the profile?
I have an RSA signature of 1024 bit where i know the following: - Public modulus N - Public exponent (0x03) - A lot of cypher message **Summary:** An MD5 hash is calculated from a collection of byte and is used as message (M). Our teacher give us more than one signature. **Question:** Can someone give...
Lets say that f(x) is a strong one way function. Let y= f(x) and lets say i give an adversary the last bit of x. Will there be any cases where the adversary is able to invert the function with non-neglilible probability?
Given the last bit, will I ever be able to invert a strong one way function?
How to derive a key from an existing aes key?
Currently, the code I am staring at uses the `CKM_EXTRACT_KEY_FROM_KEY` mechanism. That has been disabled in our hardware module, so I need a different mechanism to derive a new key from an existing aes key. I don't want to change too much code as I don't know what the ramifications will be. I could use `C_CopyObjec...
How to derive a key from an existing AES key?
I'm looking at an implementation of SRP (Secure Remote Password) that essentially follows the Stanford documentation (http://srp.stanford.edu/design.html). I'm worried about one aspect though: In the initial message exchange the server sends the parameters to be used (modulus $N$, generator $g$, salt $s$) to the client...
How to show something is not a one-way function?
I'm trying to test the ring signature scheme proposed by Rivest Shamir and Tauman in the famous paper "How to leak a secret". One of the step consist in "4) the signer solves the following ring equation for y1: Ck,v(y1,y2,y3)=v" I have everything except y1. It's defined that - Ck,v(y1,y2,y3) = Ek(y1 XOR Ek(y2 ...
I spent all day trying to figure ring signature schemes out but apparently I wasted time. I read the original paper (how to leak a secret). I'm having numerous problems. Let's just say that a nice and simple example would make everything clear. I'm talking about something like this for RSA https://www.cs.utexas.e...
I'm trying to test the ring signature scheme proposed by Rivest Shamir and Tauman in the famous paper "How to leak a secret". One of the step consist in > 4) the signer solves the following ring equation for y1: Ck,v(y1,y2,y3)=v" I have everything except $y_1$. It's defined that > $C_k,v(y_1,y_2,y_3) = ...
I spent all day trying to figure ring signature schemes out but apparently I wasted time. I read the original paper (how to leak a secret). I'm having numerous problems. Let's just say that a nice and simple example would make everything clear. I'm talking about something like [this for RSA](https://www.cs.utexas....
I'm designing a key distribution mechanism and have thought of using a securely generated/acquired private key as a seed for a sequence of private keys to be distributed to a number of users using a key encryption key which is exchanged through a secure channel during the initialization step. The setting is as foll...
So I'm reading [this SO](http://crypto.stackexchange.com/questions/3978/understanding-a-length-extension-attack) to learn more about length extension attack, and I want to make sure I understand the basics of padding. It says in the post that given the hash and the length of the message, I can easily compute the pad...
Generally if the body is hashed, why provide the body and the hash as input into the HMAC. Instead wouldn't the same security be achieved by hashing the body and providing only the has as input into the HMAC? I looked at the documentation here: https://www.npmjs.com/package/scrypt I also looked at the answer he...
For example, Square reader uses hardware encryptions when swiping credit cards. Is it possible to know the key that is used by the hardware encryption cipher by analysing the hardware circuitries? The key has to be somewhere in the hardware, right?
For hardware encryptions, is it possible to know the key by analysing the hardware?
> Since any change in bytes 0 to 47 would change bytes 48 to 63. Why bother providing bytes 0 to 47 as input into the HMAC. Would the security be the same if the HMAC used bytes 48 to 63 as input? No, because that would be taking the HMAC of a 16-byte, i.e. 128-bit hash, rather than the 48-byte actual value. The HMA...
So I'm reading [this question](http://crypto.stackexchange.com/questions/3978/understanding-a-length-extension-attack) to learn more about length extension attack, and I want to make sure I understand the basics of padding. It says in the post that given the hash and the length of the message, I can easily compute t...
In [their work on SHA-1 collisions][1] (please don't let "Shappening" take off in the media...) Stevens et al show that they are able to generate "freestart collisions" on SHA-1. They say: > Even though freestart collisions do not directly lead to actual collisions for SHA-1, in our case, the experimental data we ob...
What is a "freestart collision"?
In [their work on SHA-1 collisions][1] Stevens et al show that they are able to generate "freestart collisions" on SHA-1. They say: > Even though freestart collisions do not directly lead to actual collisions for SHA-1, in our case, the experimental data we obtained in the process enable significantly more accurate ...
I'm wondering why there are two Algorithm Identifiers in a X509 certificate. One is in the "to be signed" part and the other one is at the end right before the actual signature. Are they used for the same purpose? Do they have to be the same? Can implementations choose which of these two fields they evaluate?
X509 certificates: Two Algorithm Identifiers?
I need advice as to whether it is worth the extra "security" and processing of an AES encrypted text string to be hidden in a PNG image as opposed to an AES encrypted text string to be saved in a readonly text file. Both the PNG image and Text file would serve as publically available AES placeholders that would be deco...
Is it worth hiding an AES encrypted text string in a PNG image for better security?
This to me, sounds like a great idea, but with all rosy-tinted ideas it needs some grounding in reality. Here are the steps of the hypothetical system (with the hypothetical part highlighted): User runs program to encrypt a file. Prompts for user password. Hypothetical part (is it secure?): - Program has a...
Hypothetical encryption technique, is it secure?
Generally if the body is hashed, why provide the body and the hash as input into the HMAC. Instead wouldn't the same security be achieved by hashing the body and providing only the hash as input into the HMAC? I looked at [the documentation here][1]. I also looked at [the answer here][2] which provides detailed des...
I need advice as to whether it is worth the extra "security" and processing of an AES encrypted text string to be hidden in a PNG image as opposed to an AES encrypted text string to be saved in a read-only text file. Both the PNG image and Text file would serve as publicly available AES placeholders that would be decod...
First, I would like to point you to [this answer][1]. Copying the TL;DR from there: > Multiple encryption addresses a problem that mostly doesn't exist. You are better off using a single well chosen algorithm. --- That said, here are answers to some of your questions: > A longer password adds more layers...
I've written a script that breaks a cipher text based on a padding oracle for an assignment, but was wondering how I would continue on to create my own cipher text with any plain text I desired? Someone on the class forum mentioned XORing the intermediate step (or the D(C_i) before XOR with C_i-1) (taken from the pr...
Creating own cipher after decrypting ciphertext with padding oracle?
I was reading some stuff on steganography. There is an example on the [wikipedia page][1] : [![enter image description here][2]][2] However, I tried many software to get the hidden image, but no one worked. Is there anything wrong about that? I tried OpenStego (Windows), SecretLayer (Windows) and VSL (Linux...
According to wikipedia, a perfect hash function is a hash function that uses algorithms that has a certain random aspect to their logic. It is suppose to be collision-free. However due to the pigeon hole principle where given a set of all possible preimages *M* & a set *S* where *S* is the set of all possible hash v...
How does perfect hash function works?
> How does a perfect hash function have collision-resistant in this case? Well, when we select a perfect hash function, we take as inputs a set of messages $M_1, M_2, M_3, ..., M_n$, and use them to select a hash function for which $H(M_i) \ne H(M_j)$ (if $i \ne j$) Now, according to the pigeon hole principle, th...
First, I would like to point you to [this answer][1]. Copying the TL;DR from there: > Multiple encryption addresses a problem that mostly doesn't exist. You are better off using a single well chosen algorithm. --- That said, here are answers to some of your questions: > A longer password adds more layers...
First, I would like to point you to [this answer][1]. Copying the TL;DR from there: > Multiple encryption addresses a problem that mostly doesn't exist. You are better off using a single well chosen algorithm. --- That said, here are answers to some of your questions: > A longer password adds more layers...
I've written a script that breaks a cipher text based on a padding oracle for an assignment, but was wondering how I would continue on to create my own cipher text with any plain text I desired? Someone on the class forum mentioned XORing the intermediate step (or the $D(C_i)$ before XOR with $C_{i-1}$) (taken from ...
I am in high school and I am writing a paper on RSA. I want to show that low values of the public key exponent can make it easy to 'invert' the function so that the encrypted message can be recovered. How is this done? I have tried to read the Handbook of Applied Cryptography but it's not making sense... Would this...
According to wikipedia, a perfect hash function is a hash function that uses algorithms that has a certain random aspect to their logic. It is suppose to be collision-free. However due to the pigeon hole principle where given a set of all possible preimages *M* & a set *S* where *S* is the set of all possible hash v...
I'm working on a system that has a P2P component. When an individual downloads a binary and decides to mirror it, they advertise themselves in a providers set. The binaries can range from 1-1000MB. I need a mechanism to prevent the abuse use case where they flood the provider set without ever having the binary, and ser...
Is there a cryptographic protocol that let's me prove someone has a large binary?
I'm working on a system that has a P2P component. When an individual downloads a binary and decides to mirror it, they advertise themselves in a providers set. The binaries can range from 1-1000MB. I need a mechanism to prevent the abuse use case where they flood the provider set without ever having the binary, and ser...
I'm working on a system that has a P2P component. When an individual downloads a binary and decides to mirror it, they advertise themselves in a providers set. The binaries can range from 1-1000MB. I need a mechanism to prevent the abuse use case where they flood the provider set without ever having the binary, and ser...
> I've written a script that breaks a cipher text based on a padding oracle for an assignment, but was wondering how I would continue on to create my own cipher text with any plain text I desired? You cannot. The padding oracle attack does not give you enough information to produce the ciphertext for *any* plaintext...
> - Must the bit length of the hash value be long enough to cover *N* number of messages? Yes. > - Does it not simply make a perfect hash function as a specified lookup table for a set of predetermined message? Yes, but it is an *efficient* lookup table. If you used e.g. binary search for the lookup, you woul...