instruction
stringlengths
15
30k
Over the past few months, I have been reading and trying to understand how ECDSA works and how safe is it. So now something does not add up between its signature verification and generation. But maybe its my code so here: import ecdsa import random import libnum import hashlib import bitcoi...
Is this ECDSA's protection mechanism or something wrong with it?
What would be the security consequences of replacing $H(R, A, M)$ with $H(R, M)$ in EdDSA?
At the Discrete Log problem we try to find the exponent ($a$) of a generator ($g$) over a finite filed. e.g. $$g^a = c \bmod{N}$$ We assume everything except the exponent is known. This also includes the factorization of $N, N-1, \phi(N) \phi(N-1)...$ and period length of $g$. We also know at least one solution for an...
$$g^a = c \bmod{N} \text{ }\rightarrow \text{ }G_{i_1}G_{i_2}G_{i_3}...G_{i_n} = C \bmod N $$ At the Discrete Log problem we try to find the exponent ($a$) of a generator ($g$) over a finite filed. e.g. $$g^a = c \bmod{N}$$ We assume everything except the exponent is known. This also includes the factorization ...
I am reading the [BGV paper][1] <br> In page 18, after addition, the protocol will also refresh (modulus and key switching), may I ask why is this required? It seems to me that I can still use the same secret to decrypt the added ciphertexts.<br> [![enter image description here][2]][2] [1]: https://people.csa...
Why the refresh (modulus and key switching) is required in BGV after addition?
I am reading the [BGV paper][1]. On page 18, after addition, the protocol will also refresh (modulus and key switching), may I ask why is this required? It seems to me that I can still use the same secret to decrypt the added ciphertexts. - $\text{FHE.Add}(pk, c_1, c_2$): Takes two ciphertexts encrypted under the sa...
The best standard cryptography has to offer is that a photo can be signed by whoever attests that it is original. If we trust the signer and their ability to use their private key wisely (that is not let others use that key, and use it only to sign what they attest is original), and we trust the certification authority...
An encryption algorithm is meant to model a pseudorandom permutation, and I think at its heart your experiment is about trying to determine how well AES does this. It sounds like you are analyzing the behavior of something like $E(x) \oplus E(x \oplus c_i)$, where $c_i$ is some low-weight constant, and your test is to...
Could you not use zk-STARK for a post-quantum signature scheme? Your private key is a random symmetric encryption key, your public key is the hash of the encryption key. To sign you run an algorithm to encrypt a hash of data-to-be-signed with your private key and hash your private key to obtain the public key. ...
Use zk-STARK for post-quantum signature scheme?
I would say that the answer is *no* without any significant introduction of new techniques. As stated in the comment, the question is too broad. There was quite a bit of effort expended by community members here on your other questions including mixing up (commutative) operations over some graph structure. Did that...
In elliptic curve cryptography using the secp256k1 curve, how can I determine the number of times the base point $G$ is been multiplied to derive a new point? The formula is as follow: $k * G = Q$ Where: .$k$ is an integer .$G$ is the base point on the curve .$Q$ is the resulting point after multiplying ...
In elliptic curve cryptography using the secp256k1 curve, how can I determine the number of times the base point $G$ has been multiplied to derive a new point? The formula is as follow: $k * G = Q$ Where: - $k$ is an integer - $G$ is the base point on the curve - $Q$ is the resulting point after multiplying $G...
Good Afternoon, Studying for Cryptology and came across a presentation regarding on "Integrity vs Authenticity" where the discussion briefly mentions how Encryption "does not provide integrity or authenticity"? Why is this the case with Symmetric Encryption for example? Or is it with Cryptology in general? Not mu...
Why does symmetric encryption not provide authentication and integrity? Is it only this type of encryption or cryptology in general have this issue?
I would like to know if there are non-lattice based NIST submissions that are affected by a polynomial time algorithm to Shortest Vector Problem. Are there known reduction from (e.g.) code based cryptography to SVP or any other non-lattice cryptographic system to SVP?
Does signing always involve encrypting a **hash** or can we call private key encryption of an **unhashed** message signing too?
> Does signing always involve encrypting a **hash** ... Do you think you can always decrypt it? In any/all digital signature algorithms? - ECDSA: the signature is $(r,s)$, doesn't look like it. - Dilithium/ML-DSA: the signature is $(z,h,c)$, doesn't look like it. - SPHINCS+/SLH-DSA: the signature is a huge arra...
I can't seem to understand what $A_{N,q}$ represents here in [this paper.][1] More specifically, I don't seem to understand what is happening in here: $\mathbb{Z}_q[X]/(X^N + 1)$. Can someone explain it to me please? >$\lfloor . \rfloor$ represents the ceiling function. > >$\mathbb Z_q = \mathbb Z \cap [-\lfloor\f...
I can't seem to understand what $A_{N,q}$ represents in [this paper (Section 2.1 - Notations)][1]. More specifically, I'm struggling to grasp the meaning of $\mathbb{Z}_q[X]/(X^N + 1)$. Could someone please explain it to me? >$\lfloor . \rfloor$ represents the ceiling function. > >$\mathbb Z_q = \mathbb Z \cap [-\...
Do there exist cryptographic primitives that have proved that they cannot be constructed from CDH assumption only but can from DDH assumption? More generally, do there exist cryptographic primitives that require decisional problems for their security?
Do there exist cryptographic primitives that have proved that they cannot be constructed from CDH assumption only but can from DDH assumption? More generally, do there exist cryptographic primitives that must require decisional problems for their security?
For a project I am writing Enigma and Bombe simulators in Python. I have coded up both and so far so good. My Enigma simulator gives the same results as the online simulator here: https://people.physik.hu-berlin.de/~palloks/js/enigma/enigma-u_v20_en.html But now I am using my Bombe simulator to find key settings ...
According to the author of the original paper[1], "Verkle Trees basically let you save space (typically bandwidth, which can be expensive) by replacing a secure hash with a vector commitment scheme, making the tree shorter and fatter with some branching factor $k > 2$. This saved bandwidth comes at the cost of some ext...
Proof of non membership in a Verkle Tree?
For a project, I am writing Enigma and Bombe simulators in Python. I have coded up both and so far so good. My Enigma simulator gives the same results as the online simulator here: https://people.physik.hu-berlin.de/~palloks/js/enigma/enigma-u_v20_en.html But now I am using my Bombe simulator to find key settings...
Besides the limited nonce size of 96 bits, are there any other weaknesses to the GCM mode of AES? I am creating a password vault and am trying to narrow down my options of encryption schemes.
Besides the limited nonce size of 96 bits, are there any other weaknesses to the GCM mode of AES? I am creating a password vault and am trying to narrow down my options of encryption schemes. Also, is this a safe and secure implementation of AES-GCM? ``` public static async Task<byte[]> EncryptAsyncV2(byte[] ...
I have the following problem. Here's a rephrased version of your problem, keeping the LaTeX commands unchanged: We are given $n \in \mathbb{N}$, $p, q \in \mathbb{N}$, and $y \in \mathbb{N}^{n+2}$. Assume the existence of a constant $K$ and a vector $x \in \mathbb{Z}^{n}$, fulfilling the relation: $$y_{j+2} =...
SHA-2 makes use of non-ARX non-linear operators such as the Choice and Majority functions: [![enter image description here][1]][1] [![enter image description here][2]][2] Why is it considered an ARX cipher the same way other primitives such as ChaCha or Blake? If anything, the greater diversity in SHA-2 makes ...
Why is SHA-2 considered an ARX construction when it also uses non-ARX operations?
In book "an introduction to mathematical cryptography" 2nd edition, page78, there is a part as following: "If we are working in the group F∗p and if we treat modular addition as our basic operation, then modular multiplication of two k-bit numbers takes (approximately) k2(k*k) basic operations, so solving the DLP by ...
In Jeffrey Hoffstein, Jill Pipher and Joseph H. Silverman's book _An introduction to mathematical cryptography_, 2<sup>nd</sup> edition, page 78, there is a part as following: > If we are working in the group $\mathbb F^∗_p$ and if we treat modular addition as our basic operation, then modular multiplication of two $k...
Modular multiplication of two $k$-bit numbers takes $k^2$ modular additions?
- We want to find $x$ such that $ g^x = h$, i.e. the discrete logarithm of $h$ to the base $g$ in $\mathbb F_p^*$ with $g$'s order $n$. For trial-and-error, brute-force, we can start to find $g^x$ starting from $x=1,2,3,\dots,n$. This is the first algorithm that was mentioned in the book. They first considere...
In Jeffrey Hoffstein, Jill Pipher, and Joseph H. Silverman's book _An Introduction to mathematical cryptography_, 2<sup>nd</sup> edition, page 78, there is a part follows: > If we are working in the group $\mathbb F^∗_p$ and if we treat modular addition as our basic operation, then modular multiplication of two $k$-bi...
- We want to find $x$ such that $ g^x = h$, i.e. the discrete logarithm of $h$ to the base $g$ in $\mathbb F_p^*$ with $g$'s order $n$. For trial-and-error, brute-force, we can start to find $g^x$ starting from $x=1,2,3,\dots,n$. This is the first algorithm that was mentioned in the book. They first considere...
- We want to find $x$ such that $ g^x = h$, i.e. the discrete logarithm of $h$ to the base $g$ in $\mathbb F_p^*$ with $g$'s order $n$. For trial-and-error, brute-force, we can start to find $g^x$ starting from $x=1,2,3,\dots,n$. This is the first algorithm that was mentioned in the book. They first considere...
- We want to find $x$ such that $ g^x = h$, i.e. the discrete logarithm of $h$ to the base $g$ in $\mathbb F_p^*$ with $g$'s order $n$. For trial-and-error, brute-force, we can start to find $g^x$ starting from $x=1,2,3,\dots,n$. This is the first algorithm that was mentioned in the book. They first considere...
In Jeffrey Hoffstein, Jill Pipher, and Joseph H. Silverman's book _An Introduction to mathematical cryptography_, 2<sup>nd</sup> edition, page 78, there is: > If we are working in the group $\mathbb F^∗_p$ and if we treat modular addition as our basic operation, then modular multiplication of two $k$-bit numbers takes...
I have seen other answers here on Stack Exchange regarding [MAC-Then-Encrypt vs. Encrypt-Then-MAC][1] (and [this article][2] regarding MAC-Then-Encrypt padding oracle attacks on SSL) as well as generic [Hash-Then-Encrypt vs. Encrypt-Then-Hash][3], but in this case I am seeking insights on the security aspects of a spec...
Christof Paar explains in [his lectures][1] that Elgamal encryption scheme picks the private key from $\{2, \ldots, p-2\}$, is there a reason for excluding the last and first elements? [1]: https://youtu.be/tKNY1zhK3sQ?si=3MY88yYucRXK7I38&t=1683
Modular multiplication of two k-bit numbers takes k^2 modular additions?
I know the theory of lattice attacks against ECDSA from [Minerva][1]. So, as far as I can understand, the lattice that they build is $$ L_M = \begin{bmatrix} 2^ln & 0 & 0 & \cdots & 0 & 0 & 0 \\ 0 & 2^ln & 0 & \cdots & 0 & 0 & 0 \\ 0 & 0 & 2^ln & \cdots & 0 & 0 & 0 \\ & \vdots & & \vdots & & \vdots \\ 0 & 0 ...
- We want to find $x$ such that $ g^x = h$, i.e. the discrete logarithm of $h$ to the base $g$ in $\mathbb F_p^*$ with $g$'s order $n$. For trial-and-error, brute-force, we can start to find $g^x$ starting from $x=1,2,3,\dots,n$. This is the first algorithm that was mentioned in the book. They first considere...
I know the theory of lattice attacks against ECDSA from [Minerva][1]. So, as far as I can understand, the lattice that they build is $$ L_M = \begin{bmatrix} 2^ln & 0 & 0 & \cdots & 0 & 0 & 0 \\ 0 & 2^ln & 0 & \cdots & 0 & 0 & 0 \\ 0 & 0 & 2^ln & \cdots & 0 & 0 & 0 \\ & \vdots & & \vdots & & \vdots \\ 0 & 0 ...
I want to test a [C implementation](https://github.com/greendow/Hash-DRBG) of [Hash_DRBG](https://csrc.nist.gov/publications/detail/sp/800-90a/rev-1/final)—which [test_demo.c](https://github.com/greendow/Hash-DRBG/blob/master/test_demo.c) file I will modify to produce random binaries indefinitely to STDOUT as to be use...
Should I Test A PRNG Using A Fixed Entropy Source For Its Seed?
- We want to find $x$ such that $ g^x = h$, i.e. the discrete logarithm of $h$ to the base $g$ in $\mathbb F_p^*$ with $g$'s order $n$. For trial-and-error, brute-force, we can start to find $g^x$ starting from $x=1,2,3,\dots,n$. This is the first algorithm that was mentioned in the book. They first considere...
Hi and welcome to the site. On the basis that you _"want to test a C implementation of Hash_DRBG"_, I'm assuming that you mean a perfect representation of their algorithm. You have no choice then but to test with NIST's example vectors. Test vectors are common in the testing of cryptography. How else can you g...
I'm building a service, that works as the cipher and decipher for instant messages. It works by following the following steps: 1. The sender encrypts the text(not long, mostly chatting messages) using a public key; 2. The sender saves the encrypted text to a server. The server generates a customized URL sche...
Using asymmetric encryption + key rotation, is it possible to make an extra obfuscation layer?
Implementation of centered binomial distribution in Kyber Key Encapsulation Mechanism?
If it is could you give me a paper that states it is possible? Thank you
Is it possible to map points from curve BN254 to C25519 and back using a 2-isogeny?
> Is it possible to map points from curve BN254 to C25519 and back using a 2-isogeny? Those curves have different (relatively prime) orders, and so the only mapping from one curve to the other that preserves the group operation is the trivial one (map all points to the identity element), which is obviously not inver...
Is there a curve that supports both? Or are there two curves that can be mapped between using a 2-isogeny that support pairing checks on one and Montgomery ladders on the other? Is there a paper on it?
Is there a curve that supports both pairing checks and Montgomery ladders?
Are there two curves that can be mapped between using a 2-isogeny that support pairing checks on on curve and Montgomery ladders on another? Is there a paper?
Are there two curves that can be mapped between with a 2-isogeny that support pairing checks and Montgomery ladders?
SHA-2 makes use of non-ARX non-linear operators such as the Choice and Majority functions: \begin{align} \mathsf{Ch}(E,F,G) &= (E \wedge F) \oplus (\neg E \wedge G)\\ \mathsf{Ma}(A, B, C) &= (A \wedge B) \oplus (A \wedge C) \oplus (B \wedge C) \end{align} Why is it considered an ARX cipher the same way other p...
Given an Ed25519 key pair, can you think of any way to get to the same X25519 public key from the Ed25519 secret as from the *non-clamped(!)* Ed25519 public key? Ed25519 secret \=> Ed25519 non-clamped public \=> X25519 public (transported) v^ should match ...
Given an Ed25519 key pair, can you think of any way to get to the same X25519 public key from the Ed25519 secret as from the *non-clamped(!)* Ed25519 public key? Ed25519 secret \=> Ed25519 non-clamped public \=> X25519 public (transported) v^ should match ...
Thanks for the question and the answer which I could not understand. My doubt is how to build f(x)=P(x⊕k1)⊕k2⊕P(x) when K is not known and our job is to find K. If K comes from superposition, then how the cipher text is used to get the key. Is it possible to get a quantum circuit for implementation of Simon's algorithm...
This is a follow up question to: https://crypto.stackexchange.com/questions/66085/bit-flipping-attack-on-cbc-mode which demonstrates that a bit flipping attack with a known IV is possible on CBC mode. Is it safe to assume that the bit flicking attack is not possible if the attacker doesn't know the IV?
Is the Bit Flipping attack on CBC mode possible if the IV is not know to the attacker?
I know the theory of lattice attacks against ECDSA from [Minerva][1]. So, as far as I can understand, the lattice that they build is $$ L_M = \begin{bmatrix} 2^ln & 0 & 0 & \cdots & 0 & 0 & 0 \\ 0 & 2^ln & 0 & \cdots & 0 & 0 & 0 \\ 0 & 0 & 2^ln & \cdots & 0 & 0 & 0 \\ & \vdots & & \vdots & & \vdots \\ 0 & 0 ...
According to the author of the original paper[\[1\]][1], > Verkle Trees basically let you save space (typically bandwidth, which > can be expensive) by replacing a secure hash with a vector commitment > scheme, making the tree shorter and fatter with some branching factor > $k > 2$. This saved bandwidth comes at...
The points of an elliptic curve forms an abelian group under the usual point addition. In finite field case, the order is finite, i.e. the curve has finite number of points. The order can be prime or composite. In your case it is prime with 19. Primes means that every element, except the identity element $\mathcal{O}$,...
Why [Oribatida][1] uses previous capacity $V_{a+m-1}$ instead of current capacity $V_{a+m}$ for masking? [1]: https://www.degruyter.com/document/doi/10.1515/jmc-2020-0018/pdf
The points of an elliptic curve forms an abelian group under the usual point addition. In finite field case, the order is finite, i.e. the curve has finite number of points. The order can be prime or composite. In your case it is prime with 19. Primes means that every element, except the identity element $\mathcal{O}$,...
I'm working on a local, client-side password manager. I want to hash a master password with argon2 to store it safely in an SQLite database. This will be how a user could login and be authenticated. (Also I'm using Rust for this project, with sodiumoxide, a rust wrapper for libsodium) I was also planning on somehow ...
Argon2 is capable of outputting more than one secret or keys. If it couldn't you could use a KBKDF such as HKDF to create multiple keys from the output of Argon2. These secrets are initially kept in memory, not stored. To authenticate you could store one of those secrets together with the used salt and iteration cou...
Is it possible to extend the general concept of homomorphic encryption: $$f(m_1)\cdot f(m_2)=f(m_1+m_2)$$ to: $$f(m_1)\cdot g(m_2)=f\cdot g(m_1+m_2)$$ is it further possible to construct the scheme in a way that the key (if compromised) $f\cdot g(\cdot)$ does not allow drawing conclusions on the encryption keys $f$...
What are the disadvantages and weaknesses of AES-GCM mode for authenticated encryption? Why does [the CAESAR competition](http://competitions.cr.yp.to/caesar-call.html) say that it’s one of the goals to "find an AE scheme that offers an advantage over AES-GCM"? What advantage they are talking about?
I'm learning PHP and I've come to the password hashing section of a course I'm following, but it's not explained well enough for my liking. It seems that when using the crypt function, and using the CRYPT_BLOWFISH hash type, I get a resultant hash that contains the salt itself. For example with the following code...
How is Blowfish not reversible when it contains the salt in the hash?
I'm learning PHP and I've come to the password hashing section of a course I'm following, but it's not explained well enough for my liking. It seems that when using the crypt function, and using the CRYPT_BLOWFISH hash type, I get a resultant hash that contains the salt itself. For example with the following code...
$g(x) = x^{4} + x + 1$, $e(x) = x^{3} + x^{14} + x^{7}$ and $F_{16} := F_{2}[\gamma]/\langle \gamma^4+\gamma+1\rangle$. The syndrome would be $S(x) := \dfrac{1}{x+\gamma^{3}} + \dfrac{1}{x+\gamma^{7}} + \dfrac{1}{x+\gamma^{14}}$. What method was used to calculate $\dfrac{1}{x+\gamma^{3}}$ = $\gamma^{10}x^{3} ...
Suppose in Patterson's algorithm for the correction of binary Goppa codes, we wish to compute the syndrome polynomial when the defining polynomial is $g(x) = x^{4} + x + 1$, and the error polynomial is $e(x) = x^{3} + x^{14} + x^{7}$ where these are polynomials over $\mathbb F_{16}$ where we write $F_{16} := F_{2}[\ga...
To anyone interested in learning more, can look at these two pointers. I'm not sure about key generation time claims like O(lg N). But understanding Ratcheting trees is important. https://blog.quarkslab.com/secure-messaging-apps-and-group-protocols-part-2.html https://news.ycombinator.com/item?id=35354226
Currently, I am using AES-GCM to encode and decode a plain text file. The key is derived from a plain text password using PBKDF2 and a random salt with SHA-256. However, I have been thinking and came to the conclusion that the resulting ciphertext is only as secure as the plain password and its entropy, plus the number...
Currently, I am using AES-GCM to encode and decode a plain text file. The key is derived from a plain text password using PBKDF2 and a random salt with SHA-256. However, I have been thinking and came to the conclusion that the resulting ciphertext is only as secure as the plain password and its entropy, plus the number...
> 1. Is the derivedOTP a One Time Password / One Time Pad at all in any aspect? No. It's a stream cipher if it produces a key stream that is XOR'ed with the plaintext. That the code buffers all of it is inefficient but any stream cipher data can be buffered. > 2. Excluding guessing / brute forcing of the plainPas...
Studying for Cryptology and came across a presentation regarding on "Integrity vs Authenticity" where the discussion briefly mentions how Encryption "does not provide integrity or authenticity"? Why is this the case with Symmetric Encryption for example? Or is it with Cryptology in general? Not much details are ment...
> 1. Assuming that the nonce values are unique and generated according to some fixed public counter sequence that is not under the attacker's control, is the encryption scheme described above (i.e. pad the nonce to a full cipher block, prepend it to the plaintext, and encrypt the result using CBC mode with an all-zero ...
Given a hash cipher `f(sha1($pepper . $plaintext))` where - f is some transformation to an 11-byte string - pepper is 24 bytes long with a character space of 62 (and is not unique for a given plaintext) - plaintext is known for a set of ciphertexts Is it possible to determine what the pepper is?
Is a reduced character space pre-image attack possible for SHA-1?
Is my summary understanding of current Digital signature standards essentially correct? I may be totally wrong. DSA is no longer to be used for new signature generation just for checking existing signatures. EdDSA is to be used for new signature generation. **Question:** *Does this mean all (most?) current sta...
Is my summary understanding of current (classical) Digital signature standards essentially correct? I may be totally wrong. DSA is no longer to be used for new signature generation just for checking existing signatures. EdDSA is to be used for new signature generation. **Question:** *Does this mean all (most?)...
Alice and Bob fix a largish $n$, say $n = 1000$, and they publish a simple, undirected graph $G$ on $n$ vertices (more precisely, its adjacency matrix, or a similar form of representation). Moreover they publicly agree on some hash function $h:\{0,1\}^*\to \{0,1\}^{1024}$ (or some other constant number of output bits)....
Does anyone know an article that explains Fortuna algorithm for people without cryptographical background? If not, I would like to have an explanation because I don't manage to understand it.
Well, for one, signature algorithms really don't use "Asynchronous Encryption". What they do is use the private key to generate a signature that has some verifiable relationship (with the public key) to the message, but given the large variety of signature algorithms, any less vague description won't be universally tr...
Well, for one, signature algorithms really don't use "Asynchronous Encryption". What they do is use the private key to generate a signature that has some verifiable relationship (with the public key) to the message, but given the large variety of signature algorithms, any less vague description won't be universally tr...
Point halving in Secp256k1 - the others are similar. Let $P = [\frac a 2]G$ i.e. we have $[2]P = [a]G = Q$. In words, $P$ is the halfpoint of $Q$. Let $P = (p_x,q_x)$ and $Q = (q_x,q_x)$ We may expect that it has two solutions $$P =\big[\frac{a}{2}\big]G =\big[\frac{a + q}{2}\big] G \left(= \big[\frac{a}{2...
I'm new to cryptography, sorry if this question is dumb. I've just read the paper of Dwork and Naor [Pricing via Processing or Combatting Junk Mail][1] and understand the example of squaring on $\mathbb{Z}/p\mathbb{Z}$. Now I'm wondering how to apply the proof of work for a different kind of data, for example, I wan...
Post-Compromise Security and Backward Security seem to mean that the attacker has obtained the communication key between two parties or groups in the current state, but cannot further obtain subsequent keys. What is the specific difference between them?
What is the difference between Post-Compromise Security and Backward Security?