instruction
stringlengths
15
30k
Let's say I have three messages: `A` `B` `C` And I run each of these through two *different* Hashing algorithms: `MD5` and `SHA1` for this example MD5(A) = X MD5(B) = Y MD5(C) = Y SHA1(A) = N SHA1(B) = N SHA1(C) = M Notice the MD5 hash of `B` and `C` collide. And the `SHA` has...
[PBKDF2][1] (as defined by [RFC 2898][2]) is a function of the form $$DK = \text{PBKDF2}(\text{PRF}, Password, Salt, c, dkLen)$$ In most practical use cases, the [$\text{PRF}$][2] is [$\text{HMAC}$][3] instantiated with a [Merkle-Damgård][4] [hash][5] function such as [$\text{SHA-1}$][6]†.The time to compute $\te...
Elliptic Curve digital signature algorithm without "hashing to point"?
We have a classic web application, and when a user sign in, we return a session token (UUIDv4). The user can choose if the session should expire when the browser/app is closed or if he prefer to always be connected (1 year at least). If an attacker get the session token, I want a way to mitigate the possibility to u...
We have a classic web application, and when a user sign in, we return a session token (UUIDv4). The user can choose if the session should expire when the browser/app is closed or if he prefer to always be connected (1 year at least). If an attacker get the session token, I want a way to mitigate the possibility to u...
Assume a message protocol whereby one time pad messages are authenticated with a Carter Wegman type hash, or some similar construct utilizing a unique authentication key per message. Since this is a OTP system, there is a store of key material at both the sender's and receiver's ends. Some material is drawn to creat...
Does authenticating fake Carter Wegman protected OPT messages consume key material?
FALCON is a cryptographic algorithm for digital signature, but is it slower than actuals algorithms (ECDSA)?
Is Falcon (PQ signing algorithm) slower than ECDSA in terms of computing time?
Does authenticating fake Carter Wegman protected OTP messages consume key material?
In the MixColumns step of AES, one multiplies each of the columns of the $4\times 4$ box of bytes by the polynomial $a(x)=\{03\}x^3+\{01\}x^2+\{01\}x+\{02\}$ (modulo $x^4+1$). But in this polynomial, the coefficient $\{01\}=1$ is repeated twice. Why is it acceptable for the MixColumns step of AES to have a repeated coe...
In AES, why do we multiply the columns by a polynomial with a repeating coefficient?
[![enter image description here][1]][1] [1]: https://i.stack.imgur.com/vVjNV.png Based on Differentia-addition on P I can understand `(Xp,Zp)` which is the base point, `(Xq,Zq)` which comes from Doubling, but I don't know what is the equation used to get `P-Q` to get X-,Z-. So for example if I have `P1(8,3...
I'm experimenting with the parameters for argon2, using argon2_cffi. Whereas the iteration count or time_cost, and the memory_cost have obvious bearings on the speed and security of the result. I've not seen any guidance on a maximum for the parallelism parameter, other than enough for all the threads you have. I...
argon2, is there a security cost to raising the parallelism too high?
Why hashing a seed to generate a key and using chaining to get the rest of key matterial is not secure?
Why did Rijndael become the AES Standard . What is wrong with Twofish and Serpent?
It's difficult to implement AES securely and efficiently if the adversary can observe the timing and (approximate) location of memory accesses, unless you have dedicated hardware. The naive implementation uses lookup tables, which are vulnerable to attacks based on caches or on memory bus contention. Timing-invariant i...
I'm a computer programmer and I'm working on a truly unbreakable cypher and I keep going back to a book cypher (each letter of the message is referenced by a page,row,and column number in a random book where both the sender and receiver have identical copies.) In my update we use data files and auto lookup. here is m...
_[This was an irresponsible answer to write six years ago, even with a tongue-in-beak disclaimer to do your own security analysis and find the flaws in it. Please consult the (latest) literature, not this answer. Since it is an accepted answer, however, I can't delete it, so this is the best I can do to stop unwary p...
I know that if the input size in a pseurandom-function is larger than its output, many different inputs will generate the same output by the [Pigeonhole principle][1] (I also read [an article][2] related to that). AES with 256-bits key size in CTR mode will generate many equal outputs per IV across all the possible ...
When the input size in a PRF is larger than the output and many inputs will generate the same output, but why AES-256 in CTR mode is considered safe?
From OP's comment: > If all it takes is the key and the plaintext/cihertext, what is guaranteeing that some other program can't repeat the decrypt? Because the key is long enough, just long enough to make brutal-force attack impossible. There are [some basic models against which a cipher algorithm must be secu...
From OP's comment: > If all it takes is the key and the plaintext/cihertext, what is guaranteeing that some other program can't repeat the decrypt? Because the key is long enough, just long enough to make brutal-force attack impossible. There are [some basic models against which a cipher algorithm must be secu...
Can new decryption keys be issued without modifying the encrypted contents?
We have a classic web application, and when a user sign in, we return a session token (UUIDv4). The user can choose if the session should expire when the browser/app is closed or if he prefer to always be connected (1 year at least). If an attacker get the session token, I want a way to mitigate the possibility to u...
This is from Alan Rosen's video on Interactive proofs - https://youtu.be/6uGimDYZPMw?t=1754 [![Proof on Quadratic non-residuosity][1]][1] Here the proof is that - the Verifier gets a random bit $b$ . - If $b = 0$, then Verifier gets a random $y \in Z^*_n$ & sends $z = y^2$ to the Prover. - if $b=1$, the...
Is this Zero Knowledge interactive proof for Quadratic non-residuosity proper?
Schnorr signature is mentioned as a promising upgrade to bitcoin to improve scalability. It support multisignature, several signatures can be aggregated into a single, new signature. But I fail to find any information on how is this made possible mathematically. Some of my questions on the statement "several signat...
If we consider LMS with (SHA256 and LMS-OTS as the OTS scheme) as defined in sections 5 and 4 here: https://datatracker.ietf.org/doc/html/rfc8554#section-5, they provide the following formulas for LMS-OTS (section 4.4): In general, the LM-OTS signature is `4+n*(p+1)` bytes long, and public key generation wil...
I have the book "Handbook of applied cryptography". In there we have example for random tests. I have bits sequence `[11100 01100 01000 10100 11101 11100 10010 01001]*4` length on this sequence n = 160. And I need test this sequence in order to understand this sequence is random or not. And problem with understand...
I have the book "Handbook of applied cryptography". [In there][1] we have example for random tests. I have bits sequence `[11100 01100 01000 10100 11101 11100 10010 01001]*4` length on this sequence n = 160. And I need test this sequence in order to understand this sequence is random or not. And problem with under...
I'm experimenting with the parameters for argon2, using argon2_cffi. Whereas the iteration count or time_cost, and the memory_cost have obvious bearings on the speed and security of the result. I've not seen any guidance on a maximum for the parallelism parameter, other than enough for all the threads you have. I...
We have a classic web application, and when a user sign in, we return a session token (UUIDv4). The user can choose if the session should expire when the browser/app is closed or if he prefer to always be connected (1 year at least). If an attacker get the session token, I want a way to mitigate the possibility to u...
so I've been trying to use AES from OpenSSL and got to know that I need to use the EVP-based implementations rather than the ``AES_*``. I need to use AES-128 implementation to generate bitstreams, essentially pass various keys, and plaintexts to analyze the ciphertext generated for cryptanalysis of the algorithm. I...
What mode in EVP for AES-128 should I use for cryptanalysis of AES?
Maybe this be an answer for this question: When messages are an integer multiple of the block length, **counter-examples are possible, though they rely on a contrived compression function h, as Katz-Lindell said.** If $$h:\{0,1\}^{2n} \rightarrow \{0, 1\}^{n} \\ h(x_{1}\|x_{2})=h'(x_{1})$$ for some collision resistan...
Assume a message protocol whereby one time pad messages are authenticated with a Carter Wegman type hash on the ciphertext, or some similar construct utilizing a unique authentication key per message. Since this is a OTP system, there is a store of key material at both the sender's and receiver's ends. Some material...
Does authenticating fake Carter Wegman protected OTP messages consume key material at the receiving node?
As Katz-Lindell said, assume there is a collision-resistant compression function such that it is possible to efficiently find some $L, x \in \{\ 0, 1\}^{n}$ such that $h(L,x) = L - n$. \ In this case, the hash of any message $y$ of length $L-n$ is equal to the hash of the message $(x \| y)$ of length $L$. \ **BUT, th...
The [Carter–Wegman system of authenticating multiple messages](https://www.sciencedirect.com/science/article/pii/0022000081900337?via%3Dihub) works as follows: - Sender and receiver agree in advance on a key $(f, (b_1, \dotsc, b_n))$ to authenticate a sequence of $n$ messages. $f$ is a random choice of a func...
I have come across two supposedly identical definitions of lattices in the lattice crypto literature. There are mainly these two definitions of lattices, the first considers lattices as *discrete additive subgroup* and the second is the common *vector space* definition. **Definition 1**: Discrete additive subgroup ...
I've been trying to use AES from OpenSSL and got to know that I need to use the EVP-based implementations rather than the ``AES_*``. I need to use AES-128 implementation to generate bitstreams, essentially passing various keys, and plaintexts to analyze the ciphertext generated for cryptanalysis of the algorithm. I...
Would it be technically possible to use hundreds of computers processors together to work on an algorithm like the Shor's algorithm and break RSA? I've been reading about the crazy amount of qubits required to break RSA but what if hundreds of 64 bit processors work together towards the same goal? I would assume, if...
Would it be technically possible to use hundreds of computers processors together to work on an algorithm like the Shor's algorithm and break RSA?
This is routinely done for the [largest factorization records][1] of RSA-type moduli (two primes of roughly the same size), although using a classical algorithm called the Number Field Sieve. Out of its four main steps, the first two (polynomial selection and sieving) are very amenable to distributing among many dif...
If I have 256 bits of handwavium "perfectly random data" and I hash this 256 bits of data with a secure hash function (possibly sha256) could the resulting hash be considered "perfectly random data" as well? I am assuming no, but don't know why. What information / keywords would I use to find out more information a...
Logic Flaw, why cant you use randomness to seed more randomness?
If I have 256 bits of handwavium "perfectly random data" and I hash this 256 bits of data with a secure hash function (possibly sha256) could the resulting hash be considered "perfectly random data" as well? I am assuming no, but don't know why. What information / keywords would I use to find out more information a...
I am given a set of (u, v) values, Matrix A, primary key vector, private key vector, error vector and prime q. I wanted to recover the binary value of each (u, v) pairs using Learning With Error decryption. The formula I used to get that was: result = v - s * u, where s is the private key. I then compared the re...
I am given a set of (u, v) values, Matrix A, primary key vector, private key vector, error vector and prime q. I wanted to recover the binary value of each (u, v) pairs using Learning With Error decryption. The formula I used to get that was: result = v - s * u, where s is the private key. I then compared the resul...
LWE and Lattice-based cryptography: How to recover binary message M from (u, v) values?
Would it be technically possible to use hundreds of computer processors together to work on an algorithm like the Shor's algorithm and break RSA? I've been reading about the crazy amount of qubits required to break RSA but what if hundreds of 64 bit processors work together towards the same goal? I would assume, if ...
Would it be technically possible to use hundreds of computer processors together to work on an algorithm like the Shor's algorithm and break RSA?
Some [famous cryptographical protocols](https://www.math.ias.edu/~avi/PUBLICATIONS/MYPAPERS/GMW86/GMW86.pdf) rely on the construction of graphs $G_i= (V_i, E_i)$ for $i=0,1$ that are not [isomorphic](https://en.wikipedia.org/wiki/Graph_isomorphism). For the safety of this protocol, it is central that one can not easily...
Is there an implementation of [Shamir's Secret Sharing](https://en.wikipedia.org/wiki/Shamir%27s_secret_sharing) that can be regarded as "canonical" (or "reference" or "standard") implementation, so that I can test other implementations to be "standard compliant"? The above question is pretty vague. I have more deta...
Given a cryptographic prime $p$ and a generator $g$ of $\mathbb{F}_p$, the Decisional Diffie Hellman problem asks us to distinguish $(g^a, g^b, g^{ab})$ from $(g^a, g^b, g^z)$ for random $a, b, z$. This is an easy problem, because the generator has Legendre symbol -1, which allows us to differentiate between such trip...
I was reading about some way to imagine the signature of a message using the RSA problem : Let `N` be the product of two prime numbers `p` and `q`. Let `s` be the signature of a message `x`, provided that such `s` exist, defined as `s^x = x mod N`. Later on the following requirement is made on `x` : `x is prime ...
I was reading about some way to imagine the signature of a message using the RSA problem : > Let `N` be the product of two prime numbers `p` and `q`. Let `s` be > the signature of a message `x` (provided that such `s` exists) defined > as `s^x = x mod N`. Later on the following requirement is made on `x` : `x i...
Why did Rijndael become the AES Standard? What is wrong with Twofish and Serpent? Is there a security vulnerability in Twofish/Serpent? How do they work? As far as I know, Twofish and Serpent are used in some modern cryptographic software.
I was reading about some way to imagine the signature of a message using the RSA problem : > Let $N$ be the product of two prime numbers $p$ and $q$. Let $s$ be > the signature of a message $s$ (provided that such $s$ exists) defined > as $s^x = x \bmod N$. Later on the following requirement is made on $x$ : $x...
This is routinely done for the [largest factorization records][1] of RSA-type moduli (two primes of roughly the same size), although using a classical algorithm called the Number Field Sieve. Out of its four main steps, the first two (polynomial selection and sieving) are very amenable to distributing among many dif...
Some [famous cryptographical protocols](https://www.math.ias.edu/~avi/PUBLICATIONS/MYPAPERS/GMW86/GMW86.pdf) rely on the construction of graphs $G_i= (V_i, E_i)$ for $i=0,1$ that are not [isomorphic](https://en.wikipedia.org/wiki/Graph_isomorphism). For the safety of this protocol, it is central that one can not easily...
Im trying to learn more about cryptography and ran into a post, https://crypto.stackexchange.com/questions/102671/is-aes-128-quantum-safe, which asks if AES-128 is safe. From the articles and replies it seems that AES-128 (symmetric key) is safe even with the advent of quantum computers (for now). However, it seems tha...
Does Quantum Computers crack RSA and AES?
I am generating large prime numbers to create a cyclic group for ElGamal encryption, I can specify the bit-length n but want to limit the size because this will ultimately allow me to limit the amount of data passed through external channels. Also the data being protected has an extremely short time-value vector mea...
What bitlength should I use for generating primes for a ElGamal Encryption Cyclic Group (given the data to encrypt has a short time-value vector)?
Previous:\ https://web.archive.org/web/20160102181336/developers.yubico.com/U2F/Protocol_details/Key_generation.html https://www.yubico.com/blog/yubicos-u2f-key-wrapping/ $$ PrivateKey = \operatorname{HMAC-SHA256}(AppID+nonce, DeviceKey)\\ KeyHandle = nonce + \operatorname{HMAC-SHA256}(AppID, PrivateKey) $$ ...
Why did Yubico changed U2F Key Derivation method on YubiKey?
While Dilip's answer states this, it is worth explicitly stating that $GF(256)$ is quite far from being uniquely defined. So your statement > Requiring the use of GF(256) is enough to ensure that each correct split implementation will be compatible with each other correct join implementation. If this assumption is n...
Im trying to learn more about cryptography and ran into a post, https://crypto.stackexchange.com/questions/102671/is-aes-128-quantum-safe, which asks if AES-128 is safe. From the articles and replies it seems that AES-128 (symmetric key) is safe even with the advent of quantum computers (for now). However, it seems tha...
Is there an implementation of [Shamir's Secret Sharing](https://en.wikipedia.org/wiki/Shamir%27s_secret_sharing) that can be regarded as a "canonical" (or "reference" or "standard") implementation, so that I can test other implementations to be "standard compliant"? The above question is pretty vague. I have more de...
Is there an implementation of [Shamir's Secret Sharing](https://en.wikipedia.org/wiki/Shamir%27s_secret_sharing) that can be regarded as a "canonical" (or "reference" or "standard") implementation, so that I can test other implementations to be "standard compliant"? The above question is pretty vague. I have more de...
In general in Internet cryptography there is a key establishment mechanism separate from a bulk encryption mechanism. Where Diffie-Hellman (including elliptic curve Diffie-Hellman) is used, it is as a key establishment mechanism that provides a symmetric key for a bulk encryption method such as `AES-GCM` or `chacha20`....
I am new to this encryption scheme, so I may not be exactly sure of its implementation. I have a list of (u, v) ciphertext pairs to decrypt, each of them are 1-bit. { "u": [ 1, 19, 3, 2, 24 ], "v": 16 }, { "u": [ 3, 20, 22, 26, 15 ], "v": 21 }, { "u": [ 7, 3, 24, 26, 22...
There may not be anything wrong with you implementation. You should understand that Learning with Errors designs come with a probability of failure. This probability of failure applies to each bit of $m$. On the other hand, there is one part of your code that might be incorrect. Are you sure that when checking the size...
There may not be anything wrong with your implementation. You should understand that Learning with Errors designs come with a probability of failure. This probability of failure applies to each bit of $m$. On the other hand, there is one part of your code that might be incorrect. Are you sure that when checking the siz...
I'm having trouble testing a not-so-popular algorithm that I haven't found an implementation of, so I wrote it myself and now I'd like to test it with nist tests, but I have a suspicion that I'm doing something wrong. I got encrypted file with `~10,000,000` bits. I tested my algorithm in the following wayю. I set t...
I am given a set of $(u, v)$ values, matrix $A$, primary key vector, private key vector, error vector and prime $q$. I wanted to recover the binary value of each $(u, v)$ pairs using [LWE][1] decryption. The formula I used to get that was: $\mbox{result} = v - s u$, where $s$ is the private key. I then compared the...
I know I could multiple inverse of p.t with c.t mod 26 But p.t I have is 3×4 matrix (not square), so how would I get an inverse? Should I get the inverse of one side (left or right) of p.t or is there another way?
Simulation based proofs: how many simulators should be constructed?
Alas, there cannot be a standard or reference implementation of Shamir's secret-sharing scheme even if we restrict the field to be GF$(256)$ or even restrict the _implementation_ of GF$(256)$ to use the same primitive binary polynomial (of degree 8) and the same big-endian versus little-endian view as explained further...
Alas, there cannot be a standard or reference implementation of Shamir's secret-sharing scheme even if we restrict the field to be GF$(256)$. Different _implementations_ of GF$(256)$ will use different irreducible binary polynomials (of degree 8) to define the field, and even if one chooses one polynomial and say the f...
I started studying CSIDH a few weeks ago and, seeing these papers [\[1\]][1] [\[2\]][2], I was wondering: - Given $[a]E$ and $E$, find $[a]^{-1}E$. I read that is easy to find $[a]^{-1}E_0$ knowing $[a]E_0$ by quadratic twisting, but I haven't found any resources explaining how to compute $[a]^{-1}E$. So, is it...
I know I should calculate the multiple inverse of plaintext with ciphertext $\pmod {26}$. However, the problem I have is that the plaintext is a $3 \times 4$ matrix which is not square, so how would I get an inverse? Should I get the inverse of one side (left or right) of the plaintext or is there another way?
Can $s$ be any number in $s^x = x \bmod N$, where $N = p \cdot q$ for de Jonge / Chaum?
When I look up who developed SHA-2 family, [the result][1] I get is along the lines of > SHA-2 was first published by the National Institute of Standards and > Technology (NIST) as a U.S. federal standard. What I am really looking for is "Which individuals have developed SHA-2 family?". I understand, that most ...
Who developed SHA-2 family?
The [Carter–Wegman system of authenticating multiple messages](https://www.sciencedirect.com/science/article/pii/0022000081900337?via%3Dihub) works as follows: - Sender and receiver agree in advance on a key $(f, (b_1, \dotsc, b_n))$ to authenticate a sequence of $n$ messages. $f$ is a random choice of a func...
Without seeing your full code, it's difficult to debug, although even with code debugging isn't the most interesting. I'll link you to this [simple python implementation](https://github.com/mark-schultz/lwe-for-programmers) I put together previously if you want a python reference of things. Note that while I say yo...
Moin moin, - Let‘s assume there are two keypairs `(d1,e1)` and `(d2,e2)`, where `d1` and `d2` are unrelated private keys and `e1` and `e2` the corresponding public keys. - Imagine Alice knowing **neither `d1` nor `d2`** and Bob only `d1`, **not `d2`**. - Alice has a ciphertext `c` resulting from encrypting a mes...
Can Quantum Computers crack RSA and AES?
I have an algorithm that encrypts large text. I want to test this algorithm on statistical tests. The ciphertext contains `~10,000,000` bits. I decided to test the algorithm in two different ways, I took the ciphertext and passed it to the input of statistical tests: 1. The first parameters were as follows: `/assess ...
I am writing to request information about the difficulty of finding z in Z/pZ (where p is a large prime) given z^l and l. I am working on a project that involves this problem, and I am interested in learning more about its complexity. Specifically, I would like to ask for your insights on the following: 1. Is th...
I have a chat system where multiple clients communicate securely using Libsodium authenticated encryption. Every client have their own 32 byte key pair. If two clients want to communicate they first share their public key out of band and then use e.g. `crypto_box_easy` for encryption. I want to create a service tha...
Can I use Libsodium crypto_box_easy for signing with 32 byte keypair?
I am given a set of $(u, v)$ values, matrix $A$, primary key vector, private key vector, error vector and prime $q$. I wanted to recover the binary value of each $(u, v)$ pairs using [LWE][1] decryption. The formula I used to get that was: $\mbox{result} = v - s u$, where $s$ is the private key. I then compared the...
These days I'm generating some PGP keypairs, and I'm struggling to understand the correct terminology behind ECC keys. Moslty in the differences between `ed25519`/`cv25519`/`ECDSA`/`EdDSA`/`ECDH`. I tried to check [RFC 6637](https://www.rfc-editor.org/rfc/rfc6637#section-5) and [this RFC draft](https://www.ietf.org/arc...
I am given a set of $(u, v)$ values, matrix $A$, primary key vector, private key vector, error vector and prime $q$. I wanted to recover the binary value of each $(u, v)$ pairs using [LWE][1] decryption. The formula I used to get that was: $\mbox{result} = v - s u$, where $s$ is the private key. I then compared the...
This is from Alan Rosen's video on Interactive proofs - https://youtu.be/6uGimDYZPMw?t=1754 [![Proof on Quadratic non-residuosity][1]][1] Here the proof is that - the Verifier gets a random bit $b$ . - If $b = 0$, then Verifier gets a random $y \in Z^*_n$ & sends $z = y^2$ to the Prover. - if $b=1$, the...