instruction stringlengths 15 30k |
|---|
I have to generate a password (in Python and following
<br>
current good practices) from a hash in SHA512.
How can I do that? And what about security aspects concerning
<br>
the password generation and the generated password? |
How can I generate a good password from a SHA512 hash? |
I have to generate a password (in Python and following current good practices) from a hash in SHA512.
How can I do that? And what about security aspects concerning the password generation and the generated password? |
Daniel J. Bernstein's [ChaCha][1] core is an evolution of the [Salsa20][2] core. Both are functions over the set of 512-bit bitstrings, partitioned as sixteen 32-bit words.
Can we exhibit collisions, or second-preimages (with implies the former), for the ChaCha **core**? Note: the question is _not_ about ChaCha (a s... |
Collision or second preimage for the ChaCha core? |
Daniel J. Bernstein's [ChaCha][1] core is an evolution of the [Salsa20][2] core. Both are functions over the set of 512-bit bitstrings, partitioned as sixteen 32-bit words.
Can we exhibit collisions, or second-preimages (with implies the former), for the ChaCha **core**?
Clarifications: I'm using _ChaCha core_ (w... |
I have to change local administrator passwords on machines. I don't want to store password in a database. I have to generate a password that I can find later to connect to the machine again. So I periodically generate a secret random string (stored in a database) and make a hash of it with the machine name. At this po... |
> Can we exhibit collisions, or second-preimages (with implies the former), for the ChaCha core?
No, likely not.
The Salsa20 and ChaCha cores both consist of a large number of "quarter-rounds" each of which is invertible. The only reason neither core is invertible (and thus can have collisions) is the final addi... |
I am currently learning about RSA since I didn't understand the public-key-system but now I am… kind of. So I am writing the numbers as follows:
$p = prime\ number\\
q = prime\ number\\
N = Public\ Key\ (p \times q)\\
Z = \phi(N)\\
E = Public\ exponent\\
D = Private\ key$
Now, to calculate $D$, the privat... |
> Can we exhibit collisions, or second-preimages (with implies the former), for the ChaCha core?
No, likely not.
The Salsa20 and ChaCha cores both consist of a large number of "quarter-rounds" each of which is invertible and bijective. The only reason neither core is a bijection (and thus can have collisions) is... |
I recently skimmed over tho papers on time-lock encryption:
- [“Time-release Protocol from Bitcoin and Witness Encryption for SAT”][1] by Liu, Garcia, and Ryan
- [“How to Build Time-Lock Encryption”][2] by Jager
To get the data released on a specific point in time they'd extract some information from the blockch... |
This question is about the approximate GCD problem which is defined as follows: Given any number of the approximate multiples $a_i = p \cdot q_i + r_i$ of $p$, where $p$, $q_i$ and $r_i$ are integers, the problem is to find the hidden common divisor $p$. Note that $q_i$ and $r_i$ change in each $a_i$.
I've recently ... |
Why is Rabin encryption equivalent to factoring? |
How does knowing the factorization of N help to obtain the secret? |
I got stuck in trying to find a solution to the 3.7 exercise of the Katz-Lindell book. The exercise also assumes the existence of a pseudorandom function. The problem is that a multiple messages encryption scheme has to be non-deterministic in order to be indistinguishable. So how is it possible for such encryption sch... |
I think we all know RSA. And of course we also know DJB (a.k.a. Daniel J. Bernstein).
Now some already have noticed that he has an opinion towards cryptographic questions.
In his [2008 paper][1] ("RSA signatures and Rabin–Williams signatures:
the state of the art" by Bernstein) on state-of-the-art signature sch... |
I know that the algorithm used to generate the Brainpool curves and the NIST curves is published. The algorithm should be [this one (RFC5639 Appendix A)][1]. From what it looks like it's rather slow to find secure parameters.
After some research I've also found ["Efficient Algorithms for Generating Elliptic Curves o... |
I am not exactly sure if this is for math stackexchange or crypto:
If a TRNG outputs a bit-string in the following format: $X_1,X_2,...X_N $ where each $X_i$ is a Gaussian Truly random BYTE and the random string is the concatenation of these RV outputs, is it possible to perform a non-invertible transform on each byte... |
Both [crypto.SE][1] and [security.SE][2] have excellent Q&As about how TLS generates session keys (I have linked some at the bottom).
In reading these threads I'm having troubles with terminology since the following terms seem to be used with overlapping contexts, though they are clearly different concepts. Reading ... |
Terminology: differences between the terms "pre-master secret", "master secret", "private key", and "shared secret"? |
I am curious about, if we take some randomly generated key of AES-128
And we change any random 1 byte of that 16 byte key, then this will make huge difference in the AES cipher text generated over same input string ? |
1 byte difference in AES 128 bit key can make huge difference in output ? |
Alice uses an ElGamal signature with base the group $Z^*_{107}$ and parameter $g=3$ of order $q=53$.The private key of Alice is some $x \in \{0,1,.....,52\}$ and the public key of her is $y=10$.To sign the message m,she estimates $r=(g^k) (mod107)$ for $k \in \{0,1,......,52\}$ and $s=(k \cdot h(m)+r\cdot x) (mod53)$ F... |
***Key generation***
- Select prime p and a generator g;
- Sender S selects a random integer r (secret key) such that
0 < r < p − 1 and calculates
K=(g^r)(modp);
**K, g and p are in public domain;**
***Signing***
- To authenticate message M, the sender selects another random integer
... |
I've read ["A Parallelizable Enciphering Mode" by Halevi and Rogaway][1] about the encrypt-mix-encrypt mode for ciphers and was asking myself if this mode provides "full" diffusion.
So if an attacker alters one bit of the ciphertext, how many bits (all?) get scrambled on decryption? (if using AES and blocks of size ... |
Is it possible to make ElGamal IND-CCA2 using [OAEP][1] or [OAEP+][2]?<br> (OAEP+ from: "OAEP Reconsiderd" by Shoup)
The reason I ask is that I recently answered [this question][3] and it came to my mind that OAEP or OAEP+ might be possible solutions.
Note this isn't a practical question at all. There's no intent... |
Alice uses an ElGamal signature with base the group $Z^*_{107}$ and parameter $g=3$ of order $q=53$.The private key of Alice is some $x \in \{0,1,.....,52\}$ and the public key of her is $y=10$. To sign the message m, she calculates $r=g^k \bmod107$ for $k \in \{0,1,......,52\}$ and $s=(k \cdot h(m)+r\cdot x) \bmod 53$... |
Before continuing to read this answer, read my above hint:
> Try writing down all the equations for the different s and try to solve the system of equations.
If you still can't solve this one, you may read the remainder of the answer.
First observe that $s_1 \equiv k_1 \cdot h(m) + r_1\cdot x \pmod {53}$ and $... |
Blinding is often used to mask private key operations when the underlying problem is integer factorization. For example, its used in both RSA and Rabin-Williams signature schemes. This presumes integer operations are not constant time.
I have two questions:
* Is blinding used in schemes other than integer factor... |
If we take some randomly generated key of AES-128 and we change any random 1 byte of that 16 byte key, will this make huge difference in the AES cipher text generated over same input string?
Does this 1 byte change makes output look like uniformly random? Does it have an effect on security? |
Does a 1 byte difference in AES 128 bit key can make huge difference in output? |
> If we take some randomly generated key of AES-128 and we change any random 1 byte of that 16 byte key, will this make huge difference in the AES cipher text generated over same input string?
Yes. The outputs with different keys differ greatly. If you pick two random keys the outputs *must* look completely uncorrel... |
Can a 1 byte difference in AES 128 bit keys make huge difference in output? |
I am not exactly sure if this is for math stackexchange or crypto:
If a TRNG outputs a bit-string in the following format: $X_1,X_2,...X_N $ where each $X_i$ is a Gaussian Truly random BYTE and the random string is the concatenation of these RV outputs, is it possible to perform a non-invertible transform on each by... |
Please, consider two honest parties $A$ and $B$ outsourced their private data to a malicious server $S$. So the parties store their data in the server. Then at a later point in time they want to ask the server to run some computation on both parties data and return a private result back to a party.
In order to prov... |
At the time of this writing, there are 3 sources for parameters for the McEliece public-key cryptosystem out there.
The first paper is the [original McEliece paper][1] ("A Public-Key Cryptosystem based on Algebraic Coding Theory" by McEliece), which only specifies $(n,k,t)=(1024,524,50)$, which is known to be broken... |
Given the natural number $n$,who is in the form $p^2 \cdot q^2$,with $p$,$q$ prime numbers.Also $φ(n)$ is given.Describe a fast algorithm(polynomial time) that calculates the $p$ and $q$.Apply your algorithm to calculate the $p$,$q$ when $n=34969$ and $φ(n)=29920$
I found this problem on a mathematical competition o... |
Please, consider two honest parties $A$ and $B$ outsourced their private data to a malicious server $S$. So the parties store their data in the server. Then at a later point in time they want to ask the server to run some computation on both parties data and return a private result back to a party.
In order to prov... |
Given the natural number $n$, which is in the form $p^2 \cdot q^2$ with $p$,$q$ prime numbers. Also $\varphi(n)$ is given. Describe a fast algorithm (polynomial time) that calculates $p$ and $q$. Apply your algorithm to calculate $p$ and $q$ when $n=34969$ and $\varphi(n)=29920$.
I found this problem on a mathematic... |
I am developing a new key schedule, and there is this article (Enhanced Key Expansion for AES-256 by Using Even-Odd Method) where the authors also propose a new algorithm and one of the objectives is to eliminate "weak keys" of the AES. The authors call weak keys those in which all bits are 1 or 0, or those in which th... |
Let $q$ prime number.$G$ a cyclic group with order $q$ and $g \in G$.Suppose that you have an algorithm $A$ who takes input the element $g^a$ of $G$ and gives as output the element $g^{a^2}$.Describe a fast (polynomial time) algorithm who takes as input the elements $g^a$,$g^b$ and gives as output the element $g^{a \cd... |
Both Salsa20 and ChaCha basically work like this:
1. Put the key, the nonce, the sequence number and a constant into a 4x4 matrix of 32-bit words.
2. Transform the matrix invertibly with a number of ARX rounds.
3. Add the initial matrix into the current state to produce the output block.
Now, as discussed e.g. ... |
Why is the whole initial state used in the final addition of Salsa20 and ChaCha? |
The idea is to share $n$ images among $n$ persons so that all images can be
reconstructed by someone in possession of all shares.
However, there must not be any data overhead (which means the shares sent
to the persons must not be bigger in size than the original images. In other terms: No data overhead).
The i... |
I'm struggling with the proofs exercises of the Katz-Lindell style, like the following one:
> Let G(k) be a PRG with |k| = n, and G'(k) the output of G(k) truncated to the first n bits. Prove that $F_k(x) = G'(k) \oplus x$ is not pseudorandom.
The only thing I can say is that $F_k()$ has a very specific structu... |
I am currently enrolled in a cryptography course, which uses the book by Katz and Lindell. I'm struggling with the exercies which ask for proofs, like the following one:
> Let G(k) be a PRG with |k| = n, and G'(k) the output of G(k) truncated to the first n bits. Prove that $F_k(x) = G'(k) \oplus x$ is not pseudora... |
It is possible to construct a pre-image resistance function $f:\{0,1\}^{n}\rightarrow \{0,1\}^{n}$ to second-preimage resistance. I am thinking in to use a pseudo-random generator and contruct that second pre-image resistance function in this way:
$$F(x)=f(x)+\text{PRNG}(x).$$
What kind of tests I need to make to... |
It is possible to construct a pre-image resistance function $f:\{0,1\}^{n}\rightarrow \{0,1\}^{n}$ to second-preimage resistance. I am thinking in to use a pseudo-random generator and construct that second pre-image resistance function in this way:
$$F(x)=f(x)+\text{PRNG}(x).$$
What kind of tests I need to make t... |
It is possible to convert a pre-image resistant function $f:\{0,1\}^{n}\rightarrow \{0,1\}^{n}$ to a second-preimage resistant function? I am thinking to use a pseudo-random generator and construct that second pre-image resistant function in this way:
$$F(x)=f(x)+\text{PRNG}(x).$$
What kind of tests I need to mak... |
I am looking for some standard conversion from any hash function $f$, which has pre-image resistance, to another hash function with second preimage resistance. Is there such a standard conversion? |
How to prove that a function is not pseudorandom? |
We are all aware of [Google's approach to introduce ChaCha/Poly1305 as TLS cipher suite][1]. The rationale seems clear: ChaCha is newer and seems to provide better security (and maybe speed?) gained from the experiences of the design of Salsa20.
But in his "recent" paper [McBits: fast constant-time code-based crypto... |
I've recently read ["Fully Homomorphic Encryption on Octonion Ring" by Yagisawa][1], which is based on octonion rings over finite fields.
Personally I've never encountered octonion rings in cryptography before.<br> **Is there any example of them being used in previous work?**
Please don't mention the mentioned pr... |
Is the ring of octonions "commonly" used in Cryptography? |
I have seen some examples in "Foundation of cryptography" and "Efficient two party computation", in which simulator can do some things that in the real world model the parties cannot do, for instance:
1- In "Foundation of..." page 660, Coin Tossing protocol, the simulator first recieves the result from trusted third p... |
Simulation Based Proof: What Can / Can not Simulator Do? |
I haven’t stumbled upon them in *RealLife™* cryptography either, but I am well aware of a somewhat older, related patent by the same author.
From what I’ve seen, “patents” related to cryptography are a good way to ensure that no one feels the urge to use your “invention” anytime soon… which might explain the (lack o... |
I am developing a new key schedule, and there is this article (Enhanced Key Expansion for AES-256 by Using Even-Odd Method) where the authors also propose a new algorithm and one of the objectives is to eliminate "weak keys" of the AES. The authors call weak keys those in which all bits are 1 or 0, or those in which th... |
I can’t remember having stumbled upon them in *RealLife™* cryptography either, but I am well aware of a somewhat older, related patent by the same author. (Which might or might not violate your *“Please don't mention the mentioned previous version of this scheme.”* depending on what you’ve previously been reading. The ... |
I can’t remember having stumbled upon them in *RealLife™* cryptography either, but I am well aware of a somewhat older, related patent by the same author. (Which might or might not violate your *“Please don't mention the mentioned previous version of this scheme.”* depending on what you’ve previously been reading. The ... |
I have a project that I have to use cryptosystem and signature scheme for it, so I've read about [cramer-shoup cryptosystem][1] and I want to use it since it is more secure the elgamal cryptosystem, but, I need a signature scheme based on it which I did not find, so, please is there any signature scheme based on cramer... |
is there a signature scheme for cramer-shoup cryptosystem? |
I have a project that I have to use cryptosystem and signature scheme for it.
I've read about [Cramer-Shoup cryptosystem][1] and I want to use it since it is more secure the ElGamal cryptosystem, but, I need a signature scheme based on it which I did not find. Is there such a signature scheme?
---
If it does ... |
Is there a signature scheme for the Cramer-Shoup cryptosystem? |
Can CFB mode of block cipher be used as a commutative encryption?
Is it possible to use CFB mode of AES block cipher to create commutative encryption?
With CTR it is possible but not secure. |
Can CFB mode of block cipher be used as a commutative encryption? |
I am studying the NP-Problem of the codes Syndrome Decoding. The formulation is show below.
Input: a binary matrix $H$ of dimension $r \times n$ and a bit string $S$ of length $r$.
Property: there exists a set of $w'$ columns of $H$ adding to $S$ (with $0 < w' 0 \leq w$).
I understand that this problem is har... |
I agree that conservatism is the likely reason for the choice in McBits.
ChaCha was published while eSTREAM was still running. Salsa20/12 is now in the final eSTREAM portfolio. Even in the [XSalsa paper][1] on constructing a larger nonce, Bernstein makes no mention of ChaCha.
> So what are the reasons to prefer S... |
I am studying the NP-Problem of the codes Syndrome Decoding. The formulation is show below.
Input: a binary matrix $H$ of dimension $r \times n$ and a bit string $S$ of length $r$.
Property: there exists a set of $w'$ columns of $H$ adding to $S$ (with $0 < w' 0 \leq w$).
I understand that this problem is har... |
In NaCl and libsodium, the `crypto_scalarmult` function implements the operation $Q = kP$ (scalar/point multiplication). There doesn't seem to be a function for point addition $K = P + Q$ though.
Something like point addition must be implemented somewhere I think, as part of the implementation of scalar multiplicati... |
Let F be a pseudorandom permutation, and define a fixed-length encryption scheme (Gen, Enc, Dec) as follows: on input _m_ $\in$ {0,1}$^{n/2}$ and key _k_ $\in$ {0,1}$^n$, algorithm Enc chooses a random string _r_ $\leftarrow$ {0,1}$^{n/2}$ of length _n/2_ and computes _c_ = $F_k$(r||m).
Show how to decrypt, and prove ... |
> Let $F$ be a pseudorandom permutation, and define a fixed-length
> encryption scheme $(Gen, Enc, Dec)$ as follows: on input $m \in
> \{0,1\}^{n/2}$ and key $k \in \{0,1\}^n$, algorithm Enc chooses a
> random string $r \leftarrow \{0,1\}^{n/2}$ of length $n/2$ and
> computes $c = F_k(r||m)$. Show how to decrypt, a... |
> Let $F$ be a pseudorandom permutation, and define a fixed-length
> encryption scheme $(Gen, Enc, Dec)$ as follows: on input $m \in$
> $\{0,1\}^{n/2}$ and key $k \in \{0,1\}^n$, algorithm Enc chooses a
> random string $r \leftarrow \{0,1\}^{n/2}$ of length $n/2$ and
> computes $c = F_k(r||m)$. Show how to decrypt,... |
This question is about the approximate GCD problem which is defined as follows: Given any number of the approximate multiples $a_i = p \cdot q_i + r_i$ of $p$, where $p$, $q_i$ and $r_i$ are integers, the problem is to find the hidden common divisor $p$. Note that $q_i$ and $r_i$ change in each $a_i$.
I've recently ... |
Is there a known algorithm to recover the sender's messages in ElGamal $\mathbb{F}_p^*$ if the ephemeral key is held constant in two or more transmissions, assuming the messages are always distinct?
Say Alice picks a prime $p$ between $2^{1000}$ and $2^{1001}$ and chooses a $g \in \mathbb{F}_p^*$ with large prime or... |
Is there a known algorithm to recover the sender's messages in ElGamal $\mathbb{F}_p^*$ if the ephemeral key is held constant in two or more transmissions, assuming the messages are always distinct?
Say Alice picks a prime $p$ between $2^{1000}$ and $2^{1001}$ and chooses a $g \in \mathbb{F}_p^*$ with large prime or... |
Assuming a randomize encoding scheme that takes as input a secret key $\mathsf{sk} \in \mathbb{Z}_p$ for a large prime number $p$. Then the algorithm outputs $g^{\mathsf{sk}x}, x \in \mathbb{Z}_p^*$. Analyzing the privacy of the scheme where we can reduce its security for dinstinguishing encodings of $x$ based on an in... |
Reduction to cdp,dl or cdh? |
Imagine we have a set $S$ of $m$ elements and we wants to permutes the set elements. Thus the original position of each element should be unknown after permuting. If we define a permutation function as $\pi: \{0,1\}^n \rightarrow \{0,1\}^n$, then the set elements are permuted securely if $n\le|S|$ where $n$ is the secu... |
I need a good addition chain for a number $n>2^{100}$.
Is there any tool I can use to compute such a chain, or do I have to implement something by myself? (So far, I only found tools for small numbers.)
Many thanks! |
Tool to find an addition chain for a large number? |
Imagine we have a set $S$ of $m$ elements and we wants to permutes the set elements. Thus the original position of each element should be unknown after permuting. If we define a permutation function as $\pi: \{0,1\}^n \rightarrow \{0,1\}^n$, then the set elements are permuted securely if $n\le|S|$ where $n$ is the secu... |
Imagine we have a set $S$ of $m$ elements and we wants to permutes the set elements. Thus the original position of each element should be unknown after permuting. If we define a permutation function as $\pi: \{0,1\}^n \rightarrow \{0,1\}^n$, then the set elements are permuted securely if $n\le|S|$ where $n$ is the secu... |
I need a good [addition chain][1] for a number $n>2^{100}$ in order to implement a fast exponentiation.
Finding an optimal chain for a large number is generally considered to be an NP-complete problem. However, many heuristics to find good but suboptimal chains have been proposed in literature.
Is there any tool... |
I need a short [addition chain][1] for a number $n>2^{100}$ in order to implement a fast exponentiation. The memory footprint is not important.
Finding an optimal chain for a large number $n$ is generally considered to be an NP-complete problem. However, many heuristics to find good but suboptimal chains have been p... |
I think that I've realised why you might calculate pi. It's easy.
x^2 + y^2 = 1 is a simple calculation, thus fast. If you picked another 2 dimensional shape with a non trivial perimeter, you'd have a harder time estimating which side of the perimeter a point had fallen. (Ya think?) |
I'm researching cryptography for a school project, came across the above two ciphers, and something occurred to me.
Would combining these two schemes give a considerably stronger encryption than either one individually?
Consider two encryption schemes: one in which only the vigenere cipher is used (which I'll cal... |
Playfair Cipher + Vigenere Cipher? |
I'm researching cryptography for a school project, came across the above two ciphers, and something occurred to me. Would combining these two schemes give a considerably stronger encryption than either one individually?
Consider two encryption schemes: one in which only the vigenere cipher is used (which I'll call $... |
I am developing a new key schedule, and there is this article (Enhanced Key Expansion for AES-256 by Using Even-Odd Method) where the authors also propose a new algorithm and one of the objectives is to eliminate "weak keys" of the AES. The authors call weak keys those in which all bits are 1 or 0, or those in which th... |
I need a short [addition chain][1] for a number $n>2^{100}$ in order to implement a fast exponentiation. The memory footprint is not important.
Finding an optimal chain for a large number $n$ is generally considered to be an NP-complete problem. However, many heuristics to find good but suboptimal chains have been p... |
I need a short [addition chain][1] for a number $n>2^{100}$ in order to implement a fast exponentiation. The memory footprint is not important.
Finding an optimal chain for a large number $n$ is generally considered to be an NP-complete problem. However, many heuristics to find good but suboptimal chains have been p... |
Library to find an addition chain for a large number? |
I need a short [addition chain][1] for a number $n>2^{100}$ in order to implement a fast exponentiation. The memory footprint is not important.
Finding an optimal chain for a large number $n$ is difficult (and considered by some to be an NP-complete problem). However, many heuristics to find good but suboptimal chai... |
If I understand the need for the hash function to be collision resistant and second pre-image resistant. For what reason, exactly, a hash function need to be pre-image resistant ?
If this property is not usefull for signatures, what is the origin of this requirement, maybe privacy ?
Thank you |
I understand the need for the hash function to be collision resistant and second pre-image resistant. For what reason, exactly, does a hash function need to be pre-image resistant?
If this property is not useful for signatures, what is the origin of this requirement, maybe privacy? |
I am studying the NP-Problem of the codes Syndrome Decoding. The formulation is show below.
Input: a binary matrix $H$ of dimension $r \times n$ and a bit string $S$ of length $r$.
Property: there exists a set of $w'$ columns of $H$ adding to $S$ (with $0 < w' \leq w$).
I understand that this problem is hard... |
I've been told that prime-number factoring is based on a "roman-doll" sequence of matrices, where a seed matrix of height Y and width X exists consisting of all zeros except for a single 1 at row Y column X. For every x columns added, the matrix grows by y, and two closely related formulas sum the column vectors and t... |
I've been told that prime-number factoring is based on a "roman-doll" sequence of matrices, where a seed matrix of height Y and width X exists consisting of all zeros except for a single 1 at row Y column X. For every x columns added, the matrix grows by y, and two closely related formulas sum the column vectors and t... |
AES has the following steps in encryption: SubBytes, ShiftRows, MixColumns, and AddRoundKey and the following steps in decryption: InvSubBytes, InvShiftRows, InvMixColumns, and Inverse of AddROundKey.
My question is in which step of encryption and decryption the key is used to encrypt and decrypt data?
- Thanks |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.