instruction
stringlengths
15
30k
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...
Does a method exist where a secret is generated so that is is unknown until 3 or more people (predetermined) reach concencus that it should be revealed?
Creating own ciphertext after a padding oracle attack?
I have an RSA signature scheme with 1024-bit key where I know the following: - Public modulus $N$ - Public exponent $e=3$ - A lot of signatures **Summary:** To compute a signature, an MD5 hash is calculated from a collection of byte and the textbook RSA private key function is applied to that. The verifica...
I need to encrypt data from my software by AES, the problem is how to make the aes key secure, there is no HSM, should I hard code the key in my code?
I am using the javax.crypto.Cipher in Java to do AES/CBC/PKCS5Padding encryption. What I am observing is that, if you try to encrypt a Plaintext with no padding, PKCS5 adds another entire block just to padding. For example, if I got a 32bytes Plaintext, assuming that AES is using 16byte block size, the padding size sho...
> Is this correct or is just a matter of javax.crypto.Cipher implementation? It is correct. You need to always add some amount of padding if you are to distinguish between different padding lengths. With PKCS5 padding the length of the padding is $b - |m| \mod b$, where $b$ is the block size. With $|m|$ a multiple o...
I need to encrypt/decrypt data from my software by AES, the problem is how to make the aes key secure, there is no HSM, should I hard code the key in my code? it seems that hacker can read the key data by reverse engineering the software
In this paper: "Sequential Aggregate Signatures with Short Public Keys: Design, Analysis and Implementation Studies" the authors sell the paper as the first who propose Aggregate signatures without interactive assumptions as LRSW but with static ones. What renders an assumption interactive? The fact that is not a stand...
What is the notion of an interactive assumption?
In this paper: [Sequential Aggregate Signatures with Short Public Keys: Design, Analysis and Implementation Studies][1] the authors sell the paper as the first who propose Aggregate signatures without interactive assumptions as LRSW but with static ones. What renders an assumption interactive? The fact that is not a st...
I spent all day trying to figure ring signature schemes out but apparently I wasted time. I read the original *ring signature* paper (Rivest's *[How to leak a secret](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.116.2833)*). I'm having numerous problems. Let's just say that a nice and simple example wo...
I would like to use the NaCl cryptography library (or TweetNaCl), but I would very much like to have perfect forward secrecy for my application. From what I understand, all Bob needs to to decrypt a message from Alice with NaCl's *crypto_box_open* is the public key of Alice and his private key. Thus, if an eavesdrop...
While [Poncho's answer][1] is fully valid I'll hereby extend the part on the proposed idea being inferior to factoring. > 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. As poncho said this is only feasible i...
What you are looking for is called white-box cryptography. In short white-box crypto aims to make an implementation of a cypher (for example AES) in such a way that it is impossible for an attacker to extract the key, even if the attacker (the user of the computer) has access to the source code and a debugger. Up...
I currently am writing a web app and am using two random hashes that are before and after the string and are both 50 char long (alphabet, numbers, and special chars). strlen($hash1) = 50; strlen($hash2) = 50; $sha3pw = sha3($hash1+$password+$hash2); What are the chances that someone will be able to find...
What you are looking for is called white-box cryptography. In short white-box crypto aims to make an implementation of a cypher (for example AES) in such a way that it is impossible for an attacker to extract the key, even if the attacker (the user of the computer) has access to the source code and a debugger. Up...
I wonder what is wrong with this scheme for authentication. 1. Server sends random challenge, C 2. Client returns (C, B(P)) encrypted in H(B(P)) where B(P) is high work factor salted hash of the user passphrase (e.g., bcrypt), and H() is a low work factor hash 3. Server has K = H(B(P)) in database, and can use...
Encrypt hash using hash of hash?
One of the conditions that a one-way function has to satisfy is the following: $$Pr[A(f(x))\in f^{-1}(f(x))] \leq negl(n)$$ Now, suppose that we have the following function that's not one way: $$f(x) = x + 123$$ We know this isn't one-way since we can easily invert this since it's not at all hard to invert; tha...
One of the conditions that a one-way function has to satisfy is the following: $$Pr[A(f(x))\in f^{-1}(f(x))] \leq negl(n)$$ Now, suppose that we have the following function that's not one way: $$f(x) = x + 123$$ We know this isn't one-way since we can easily invert; that is: $$f^{-1}(x) = x - 123$$ But from t...
I wonder what is wrong with this scheme for authentication. 1. Server sends random challenge, C 2. Client returns (C, B(P)) encrypted in H(B(P)) where B(P) is high work factor salted hash of the user passphrase (e.g., bcrypt), and H() is a low work factor hash 3. Server has K = H(B(P)) in database, and can use...
I'm cryptographic diletante, so please bear with naive "programmer terms". I'm looking for behavior similiar to that of LCGs, ie input and output sizes are same. Full cycle of 2^32 different inputs generates full cycle of 2^32 different outputs, distribution of which depends on large key. Obviously combined LCGs (wi...
Are there full cycle cryptographic/one-way hash primitives?
I wonder what is wrong with this scheme for authentication. 1. Server sends random challenge, C 2. Client returns (C, B(P)) encrypted in H(B(P)) where B(P) is high work factor salted hash of the user passphrase (e.g., bcrypt), and H() is a low work factor hash 3. Server has K = H(B(P)) in database, and can use...
I wonder what is wrong with this scheme for authentication. 1. Server sends random challenge, C 2. Client returns (C, B(P)) encrypted in H(B(P)) where B(P) is high work factor salted hash of the user passphrase (e.g., bcrypt), and H() is a low work factor hash 3. Server has K = H(B(P)) in database, and can use...
I'm using AES128-CTR for generating pseudo-random values, which is considered secure for up to 1MB (at least from what I've read). I simply encrypt a 128-bit little-endian counter, starting from 0. Should I use an IV? Should I start counting from a non-zero random value? Does it make any practical difference?
Do I need an IV to use AES-CTR as a CSPRNG?
With a fixed key size: how do I calculate how many different keys and texts I have to test for an statistics study?
I'm looking for behavior similiar to that of LCGs, (i.e. input and output sizes are same). Full cycle of $2^{32}$ different inputs generates full cycle of $2^{32}$ different outputs, distribution of which depends on large key. Obviously combined LCGs (with generated parameters based on the perturb seed key) seem trivia...
With a fixed key size: how do I calculate how many different keys and texts I have to test for an statistics study? I will encrypt that samples and see how many bites has changed from the inputed block. The problem is that I dont know how many samples I have encrypt to have a good statistical foundation. Finally...
With a fixed key size: how do I calculate how many different keys and texts I have to test for an statistics study? I will encrypt that samples and see how many bites has changed from the inputed block. The problem is that I dont know how many samples I have encrypt to have a good statistical foundation. Finally...
With a fixed key size: how do I calculate how many different keys and texts I have to test for an statistics study? I will encrypt that samples and see how many bites has changed from the inputed block. The problem is that I dont know how many samples I have encrypt to have a good statistical foundation. Finally...
Suppose party A generates an ephemeral RSA key and sends the public key to B. Party B then generates a symmetric key, encrypts it with Party A's public key and sends the Ciphertext to Party A. Party A then decrypts the key that party B sent. Parties A and B then use the key that B generated to encrypt data. Does ...
[Nimbus][1] or [Thinbus][2] are two popular SRP implementations in Java and Javascript compute the proof of password as you describe `H(A|B|S)` where you can supply your own hash functions such as SHA1 or SHA256 or stronger. The actual [protocol design document][3] states `H(H(N) xor H(g), H(I), s, A, B, K)` where ...
> Does that meet the definition of Perfect Forward Secrecy? **If you discard this freshly generated key directly after usage: yes.**<br> Perfect forward secrecy means that an attacker can't learn anything about future session if he breaks the confidentiality of a key of the current session. Applied to this scenario...
Can an ephemeral RSA key give forward secrecy?
(This is probably a basic question, and may be a duplicate; if so, just let me know.) Suppose there are two clients `A` and `B`, and some server `C`. Suppose `B` and `C` have an HTTPS session. And suppose `B` records the session, and sends it to `A`. - Can `A` verify that the alleged session between `B` and `C` a...
Are HTTPS web sessions non-repudiable?
Which is more secure, using just bcrypt or SRP?
With a fixed key size – key has 128 bits, while block size is 8 byte – how do I calculate how many different keys and texts I have to test for an cryptanalytic statistics study? Differently worded: I am planning to encrypt multiple samples and see how many bites have changed, compared to the input block. Finally I ...
(This is probably a basic question, and may be a duplicate; if so, just let me know.) Suppose there are two clients `A` and `B`, and some server `C`. Suppose `B` and `C` establish an HTTPS tunnel, and `C` sends a response to `B`. And suppose `B` records the response, and sends it to `A`. - Can `A` verify that the...
What you are looking for is called white-box cryptography. In short white-box crypto aims to make an implementation of a cypher (for example AES) in such a way that it is impossible for an attacker to extract the key, even if the attacker (the user of the computer) has access to the source code and a debugger. Up...
Given the [recent news about SHA-1 collisions](https://sites.google.com/site/itstheshappening/), what is the complexity on a SHA-1 collision? Marc Steven's [HashClash](https://marc-stevens.nl/p/hashclash/) is still detailing about *2<sup>60</sup>*. Does the previous complexity still hold?
What is the complexity on SHA-1 collisions?
In [their work on SHA-1 collisions][1] (as well as in their paper [*“Freestart collision on full SHA-1”* by Stevens, Karpman, and Peyrin; published: 8 Oct 2015](http://eprint.iacr.org/2015/967)) Stevens et al show that they are able to generate "freestart collisions" on SHA-1. They say: > Even though freestart colli...
SHA-1 collisions - what about practical attacks?
Given the [recent news about SHA-1 collisions](https://sites.google.com/site/itstheshappening/), what is the complexity of finding a SHA-1 collision? Marc Steven's [HashClash](https://marc-stevens.nl/p/hashclash/) is still detailing about *2<sup>60</sup>*. Does the previous complexity still hold?
What is the complexity of finding SHA-1 collisions?
In [their work on SHA-1 collisions][1] (cf. the currently unpublished paper [*“Freestart collision on full SHA-1”* by Stevens, Karpman, and Peyrin](http://eprint.iacr.org/2015/967)) Stevens et al show that they are able to generate "freestart collisions" on SHA-1. They say: > Even though freestart collisions do not ...
With a fixed key size – key has 128 bits, while block size is 8 byte – how do I calculate how many different keys and texts I have to test for an cryptanalytic statistics study? Differently worded: I am planning to encrypt multiple samples and see how many bits have changed, compared to the input block. Finally I p...
I know that message collisions are suppose to be hard to calculate for a good cryptographic hash. Given 1k worth of data, its hard to find another 1k worth of data that collides with the same hash. But doesn't it become much easier when the message becomes variable length? i.e. its easier to find a collision in 0...
I know that message collisions are suppose to be hard to calculate for a good cryptographic hash. Given 1k worth of data, its hard to find another 1k worth of data that collides with the same hash. But doesn't it become much easier when the message becomes variable length? I.e. its easier to find a collision in 0...
I was reading this paper https://eprint.iacr.org/2012/099.pdf when I thought if something similar can be done with DES or 3DES, e.g. it is plausible to decrypt DES homomorphically ?
Can homomorphic decryption of DES be practical?
I know that message collisions are supposed to be hard to calculate for a good cryptographic hash. Given 1k worth of data, it's hard to find another 1k worth of data that collides with the same hash. But doesn't it become much easier when the message becomes variable length? I.e. it's easier to find a collision i...
Suppose I have a [Mersenne Twister](https://en.wikipedia.org/wiki/Mersenne_Twister) seeded with some unknown value, and I’ve been given the first output. Given only this first output, and no other information, is it possible to derive the unknown seed? I feel like the answer is no, but I want to be sure I’m not miss...
Is it possible to find a Mersenne Twister seed given only the first output?
> Is it impossible to go from the first output to the seed, or is there some trick that I’m missing? Yes, it is impossible, but not because the algorithm could not be reversed. If you had the whole state, you could go back to find the seed, but you need at least 624 32-bit outputs before you can uniquely find the st...
Suppose I have a [Mersenne Twister](https://en.wikipedia.org/wiki/Mersenne_Twister) seeded with some unknown value, and I’ve been given the first output. Given only this first output, and no other information, is it possible to derive the unknown seed? I feel like the answer is no, but I want to be sure I’m not miss...
> Is it impossible to go from the first output to the seed, or is there some trick that I’m missing? Yes, it is impossible, but not because the algorithm could not be reversed. If you had the whole state, you could go back to find the seed, but you need at least 624 32-bit outputs before you can uniquely find the st...
I'm interested exploring key derivation and threshold signature protocol that require point arithmetic (addition) on the private scalar values and $S$ values of the signatures in [tag:ed25519]. The ref10 code makes it easy to do point arithmetic on public key and $R$ values because the are just encoded points. Just ...
I'm interested exploring key derivation and threshold signature protocol that require point arithmetic (addition) on the private scalar values and $S$ values of the signatures in [tag:ed25519]. The ref10 code makes it easy to do point arithmetic on public key and $R$ values because the are just encoded points. Just ...
In [RFC6628](https://tools.ietf.org/html/rfc6628) section 2.2, they say: > `w` = The password remembered by the user. `W` = The password verifier registered in the server. `W = g^w mod p`, where `g` and `p` are agreed upon in advance. They claim resistance against server compromise. But if an attacker gains ac...
From [SRP](https://tools.ietf.org/html/rfc2945) section 3: > The host stores user passwords as triplets of the form > { <username>, <password verifier>, <salt> } > Password entries are generated as follows: > <salt> = random() > x = SHA(<salt> | SHA(<username> | ":" | <raw password>...
I'm interested exploring key derivation and threshold signature protocol that require point arithmetic (addition) on the private scalar values and $S$ values of the signatures in [tag:ed25519]. Specifically what I would like to be able to do 1. Generate two eddsa private keys: (pub_1,key_1), (pub_2,key_2) 2. ...
In one of my assignments, I came across this line *Due to MD5’s length-extension behavior, we can append any suffix to both messages and know that the longer messages will also collide. This lets us construct files that differ only in a binary “blob” in the middle and have the same MD5 hash, i.e. prefix || blobA || ...
In one of my assignments, I came across this line > Due to MD5’s length-extension behavior, we can append any suffix to both messages and know that the longer messages will also collide. This lets us construct files that differ only in a binary “blob” in the middle and have the same MD5 hash, i.e. prefix || blobA ||...
I was hoping to implement a software that allows testing a user-defined hash function for cryptographic properties *(Meant to pique interest in cryptographic hash function for a school showcase)*, as well as compare them with well-known hash function to identify their hash functions strong points & weak points. However...
Bruce Schneier [writes][1] (back in 2005) in a post on cryptanalysis of SHA-1: SHA-1 produces a 160-bit hash. That is, every message hashes down to a 160-bit number. Given that there are an infinite number of messages that hash to each possible value, there are an infinite number of possible coll...
For any hash value, is there infinite number of inputs that hash to it?
I need to encrypt/decrypt data from my software by AES, the problem is how to make the AES key secure, there is no HSM, should I hard code the key in my code? It seems that a hacker can read the key data by reverse engineering the software.
Bruce Schneier [writes][1] (back in 2005) in a post on cryptanalysis of SHA-1: > SHA-1 produces a 160-bit hash. That is, every message hashes down to a 160-bit number. Given that there are an infinite number of messages that hash to each possible value, there are an infinite number of possible coll...
For any hash value, is there an infinite number of inputs that hash to it?
SHA-1 is a cryptographic [tag:hash] function that is no longer considered secure and should only be used for backward compatibility. In 2006, [NIST issued a policy][1] stating that: > "Federal agencies should stop using SHA-1 ... as soon as practical, and must use the SHA-2 family of hash functions for these appl...
There are a few systems like the GNU Name System and the Sphinx mixnet packet format that employ a series of curve25519 scalars all multiplied together as a private key. Are there any caveats to multiplying several together like this? What about adding them or doing other arithmetic operations on scalars? Anot...
There are a few systems like the GNU Name System and the Sphinx mixnet packet format that employ a series of curve25519 scalars all multiplied together as a private key. Are there any caveats to multiplying several together like this? What about adding them or doing other arithmetic operations on scalars? Anot...
Why file removal tools offer gost 2 passes and British 3 passes or even gutman 35 passes options? In which case the single pseudo random pass is not enough?
Why many passes at file removal?
So after some searching, I kinda know the attack procedure of altering bit by bit. But I'm still confused how this is possible. If I understand it correctly, the attacker never has the key, or tries to iterate keys. So since the oracle can check the padding, I guess itself has the encryption key? What is a real life...
Does a padding orcale have the encryption key? Where in real life do I see such an oracle?
In cryptography Oracle models a party in a given protocol that can answer to some precise questions. It is called Oracle because as the mythological Oracles, we don't know how they get the answer. This bit is very important in proven security as it allows to model a generic attacker and prove a protocol correctness aga...
Does a padding oracle have the encryption key? Where in real life do I see such an oracle?
Suppose a message is encrypted with a symmetric block cipher with a random key. RSA is often used to wrap the symmetric key using the recipient's public key. In this case, the size of the message is increased, as the block size of the RSA encryption (depending on the modulus size) is much bigger than the actual size...
ECDH or RSA more secure for symmetric key wrapping?
Our application requires some 'mild' form of 'proof of origin' for the tokens we issue (~200 bytes), however, the value of each is trivial. The requirement is to provide 'tamper resistance' rather than 'unforgeable', to not bloat the token size, and to use commonly available 'standard' libraries and tools. In the t...
Very short signatures? (eg: 48bits?)
Noob question: It is my understanding that the raw output from 1. non-blocking /dev/random (where the kernel's entropy_avail estimate is equal to or greater than the number of random bits required) 2. or properly-initialized /dev/urandom (i.e., after roughly 256 bits of entropy have been collected by the ...
Our application requires some 'mild' form of 'proof of origin' for the tokens we issue (~200 bytes), however, the value of each is trivial. The requirement is to provide 'tamper resistance' rather than 'unforgeable', to not bloat the token size, and to use commonly available 'standard' libraries and tools. In the t...
Noob question: It is my understanding that the raw output from 1. non-blocking /dev/random (where the kernel's entropy_avail estimate is equal to or greater than the number of random bits required) 2. or properly-initialized /dev/urandom (i.e., after roughly 256 bits of entropy have been collected by the ...
Suppose a message is encrypted with a symmetric block cipher with a random key. RSA is often used to wrap the symmetric key using the recipient's public key. In this case, the size of the message is increased, as the block size of the RSA encryption (depending on the modulus size) is much bigger than the actual size...
Noob question: It is my understanding that the raw output from 1. non-blocking /dev/random (where the kernel's entropy_avail estimate is equal to or greater than the number of random bits required) 2. or properly-initialized /dev/urandom (i.e., after roughly 256 bits of entropy have been collected by the ...
After saw the xkcd comic [Self-Description](http://xkcd.com/688/), I wonder if it is theoretically possible to construct a self-descriptive string that contains its own hash value? Let's say the string's MD5 value is `663ef7d3f38cf900574cd4d9f83eb1b7`, the string would be something like: ... The md5sum v...
Is it theoretically possible to construct a string that contains its own hash value?
Given the linear block cipher Lincipher(k, p) = c **Lincipher(k, p1 ⊕ p2) = Lincipher(k, p1) ⊕ Lincipher(k, p2)** where k and p are 128-bits. If an attacker uses a chosen-cipher-text attack, how can they decrypt any plaintext by choosing 128 ciphertexts? I'm not exactly sure in which direction I have to think. ...
Our application requires some 'mild' form of 'proof of origin' for the tokens we issue (~200 bytes), however, the value of each is trivial. The requirement is to provide 'tamper resistance' rather than 'unforgeable', to not bloat the token size, and to use commonly available 'standard' libraries and tools. In the t...
Given the linear block cipher $LinearCipher(k, p) = c$ $$LinearCipher(k, p_1 \oplus p_2) = LinearCipher(k, p_1) \oplus LinearCipher(k, p_2)$$ where $k$ and $p$ are 128-bits. If an attacker uses a chosen-cipher-text attack, how can they decrypt any plaintext by choosing 128 ciphertexts? I'm not exactly sur...
The man page of cryptsetup says: > Whenever a passphrase is added to a LUKS header (luksAddKey, > luksFormat), the user may specify how much the time the passphrase > processing should consume. The time is used to determine the iteration > count for PBKDF2 and higher times will offer better protection for > low-...
The benefit of PBKDF2 for big keyfile?
> Does it mean that a binary keyfile of more than 64 random bytes (each having 8 bits of entropy?) is useless with PBKDF2 and a hash of 512 bits like SHA-512? The cost of testing all the hashes directly being cheaper than testing all the keyfiles. Yes, it does. After 128 to about 256 bits security the amount of secu...