instruction
stringlengths
33
27.2k
I am reading the paper ‘Town Crier: An Authenticated Data Feed for Smart Contracts’ by Zhang et al (2016), but there is something I just cannot wrap my head around. In Section 7 and Appendix C, it is stated that three theorems (Authenticity, Gas Sustainability, and Fair Expenditure) are proven following the UC framewo...
In the Kyber paper in section 3 about the Kyber IND-CPA Encryption there is a proof by sequence of games containing three games. I understand that in the first game hop the M-LWE advantage is used to bound the advantage of distinguishing the games. The second hop (from $G_1$ to $G_2$) exchanges two elements ($\boldsymb...
I computed $\Pr[\mathsf{CT} = 1] = \Pr[\mathsf{CT} = 2] = \Pr[\mathsf{CT} = 4] = 2/9$ and $\Pr[\mathsf{CT} = 3] = 1/3$. When I calculate the first entry in the table, I get 1/2 not 1/9. Is my calculation wrong or is the image wrong? How do I fill the table and tell if they are independent?
I have a big problem about encryption with AES-GCM. Between using dotnet and Node.js, the encryption results are slightly different. Here is the code in Node.js from JOSE using Crypto Library : var cipher = crypto.createCipheriv("id-aes256-GCM", key, iv); cipher.setAutoPadding(false); cipher.setAAD(aad); ...
Wen-Her Yang and Shiuh-Pyng Shieh proposed two password authentication schemes by employing smart cards, one is timestamp-based and the other one is nonce-based. Their scheme consists of 3 phases: Registration, login and authentication phase. Considering timestamp-based scheme, step 3 of registration phase says: Find...
The article Cryptographic Protocols with Everyday Objects by James Heather, Steve Schneider, and Vanessa Teague describes the following unanimity protocol for three players: Three players want to determine whether they all agree on the point at issue; if they do not all agree, then they will not discover who stands ...
I've noticed that AWS CloudHSM uses an openssl command to generate a fake private key for web servers that offloads cryptographic functions to a CloudHSM. How does this key work? And what purpose does it serve? As an example from the AWS CloudHSM docs: Generate a fake private key using: openssl genrsa -engine cloudhsm...
My question (at the bottom) is in regards to the part of the protocol where the Verifier challenges the Prover by sending a bit b where b = 0 or b = 1. Example for context One Time Setup p = 3 q = 5 n = 15 privKey = 8 (co-prime to n) pubKey = privKey^2 mod n ⇒ 64 mod 15 = 4 At this point, the verifier knows:...
So I've been reading about salt, and am confused about why the length is so critical. From my understanding salt is used for protection against pre-computed attacks. Say I have a single password that is hash with salt length n. Suppose this hash and salt is accessible to the attacker. My questions are as follow: If t...
If the message that was signed with a digital signature is not known, can it still be recovered if you have the private key?
Is that possible to prove that 'I do not know something' (i.e, the private key for a cryptocurrency wallet) using cryptography? The problem might be nonsense at first glance. But the intuition for this might be to prove that I do not hold the crypto coins under a specific wallet.
Just to help form this question, this is a Feistel network:- To me this looks like:- Why does the generic architecture have to have two halves? We already have asymmetry in some variants. As I understand it, the principal security comes from a secure permutation within the round function. All that happens outside...
How can we find the minimum number of differentially active s-boxes in a block cipher (actually a Feistel network with several input cells) in a truncated characteristic form? In a recursive algorithm when we get to the situation that there are binary cases, I don't know what to do? For example when I get a xor of two...
The state of the art hash-based post-quantum signature schemes, like Sphincs and XMSS, are using variations of WOTS (Winternitz OTS), like WOTS+, that require extra random bitmasks along with the public key. Some history: These bitmasks were initially introduced from Dahmen et al. in order to build hash-based signature...
For a beginner user, and someone with not a huge math background, what would be the best or easiest programming language to start doing cryptography in?
Suppose we visit https facebook.com for the very first time. We are creating a new account and creating a password. Then we send then password to the server, the server receives this and only then hashes it. All consequent log-ins, you won't have to send your password as a plaintext, it will be sent as a hash and the ...
I want to encrypt video directly at the source where it is being captured, e.g. inside a video camera. This way I can transmit the encrypted stream over WiFi securely. I could use AES on the chip inside the camera, but this would be open to an attack on the semiconductor package, where an actor could retrieve the AES e...
For encryption methods there is a need for (very large) prime numbers. So for Elgamal digital signature there is the problem of finding a primitive root of $(p)$ where $p$ must be very large prime number (1024) or (2048) bits length. My question is: how does the encrypter solve this problem? I presume a loop to check a...
The Approximate Greatest Common Divisor (AGCD) problem is the difficulty of obtaining the value $\ p\ $ when given samples of $\ pq_i + e_i$ for secret values $p, q_i, e_i$. I would like to know how the difficulty of the problem changes when modular reduction is incorporated. Specifically: is the problem of obtaining ...
I am working through Introduction to Mathematical Cryptography and am not in school anymore, so I don't have any advisers or peers to ask (my background is a BS in math). In the text they present the Shanks's BS-GS Algotrithm with a proof. I am having trouble figuring out how the total running time of the algorithm fol...
this is a very top-level question - as I'm just starting to delve into crypto. The main objective is to be able to communicate between 2 mobile devices through a BAAS server such as Firebase so that one app can notify another one and send data. The data to be exchanged are encrypted image documents. Security is paramo...
Whether the receiver can be sure that the message is sent by the source only and not spoofed by someone else?
for my thesis I am trying to develop a system where nodes from a peer to peer network agree in generate a random number every tot seconds. I am stocked in this problem since almost 1 week anyone can help me with some great ideas not to hard to implement? I already found this "Scalable Bias-Resistant Distributed Randomn...
We determine a system IND-CPA secure when an adversary has a negligible advantage after any feasible amount of queries. AES256-GCM uses a 128bit block cipher. We know that the distinguishability from random of counter mode encryption follows the birthday bound. If we encrypt a stream of static data, with counter mode ...
I am looking at Wikepedia Galois Counter Mode article. I see this diagram I am trying to figure out where the IV works its way in. Is it used to initialize the counter? If so, how does a sequence of 12 bytes (96 bits)initialize a counter on a 32 bit machine?
when dealing with S3 Client Side Encryption, it's using "AESWrap" (defined in rfc3394) algorithm to encrypt the data-key; I'm trying to play with openssl command line to see if it's possible decrypt it "AESWrap", does anyone know how to use call openssl decrypt AESWrap encrpyted content? https://docs.aws.amazon.com/AWS...
I'm trying to apply the hash function combination method described in https://eprint.iacr.org/2013/210.pdf to a HKDF PRNG construction. Thing is it needs 4 uniformly random parameters/keys chosen by the signer during the combination step, but that's what I was already using the PRNG for so it feels like I'm running int...
Does the application of Shor's algorithm in any way relate/affect the schnorr signature in ed25519?
What are some differences between a Single photon QKD system (BB84) and an EPR photon-pair QKD system (BBM92) for quantum public key distribution?
I found an article on the internet about an RSA attack with continued fractions. Given are the following numbers: $n = 205320043521075746592613$ $e = 70760135995620281241019$ $\frac{e}{n}=[0;2,1,9,6,54,5911,1,5,1,1,...]$ The method says that if $d<n^{\frac{1}{4}}$, then $\frac{e}{n}$ is an approxiation of $\frac{...
If: \begin{align} k &= a\cdot b\cdot c\\ k_m &= k \bmod m\\ a_m &= a \bmod m\\ b_m &= b \bmod m\\ c_m &= c \bmod m\\ \end{align} Then is $B^{k_m} \bmod N$ always equivalent to: $$\left(\left(B^{a_m} \bmod N\right)^{b_m} \bmod N\right) ^ {c_m} \bmod N$$ If not, what is a counter example?
In the handbook of applied cryptography, we can find the following formula for testing PRNG. My question is what does mean 2 in the upper index of the n_00 and others? It is not power because then the formula does not make sense. (source)
In my previous question, I asked about potential symmetric cryptosystems which are designed to be computed by a reversible computer. I am now wondering if there are any cryptographic hash functions which consist mainly of non-injective components. It seems like using too many irreversible components in a cryptographic ...
Normally, when decrypting messages, you need to check if the message is authentic and integral (aka, never decrypt before checking the MAC). With ECIES, this seems to be done internally. Is it necessary to include a MAC on your messages you encrypt when using ECIES?
There has been recent work, due to Joux, Gologlu, Zumbragel and others which has developed efficient algorithms for discrete logarithms in small (and specifically binary) characteristics, where the exponents have some special form. See the discussion in the questions how-robust-is-discrete-logarithm-in-GF(2^n) and d...
I am new in hash cryptography. I am trying to build the sha256 hardware accelerator. I am thinking about using the different hash value to optimize the performance. I am trying to fetch custom hash initial value which already computed sometime ago. Does this approach valid and what problem i would get. Thanks
Let $A$ denote a sequence of bits. Let $H$ denote a cryptographic hash function that has no limit on the length of its input (for example, SHA-3). Consider the following infinite sequence of bits: $$B = H(A) \mathbin\Vert H(0 \mathbin\Vert A) \mathbin\Vert H(1 \mathbin\Vert A) \mathbin\Vert H(00 \mathbin\Vert A) \m...
Is it feasible to use triple encryption for block ciphers with the maximum keysize being the only significant security issue? I mean $C = E_{k_1}(E_{k_2}(E_{k_3}(P)))$ and $P = D_{k_1}(D_{k_2}(D_{k_3}(C)))$ where $E$ is encryption, $D$ is decryption, $P$ is a plaintext block, and $C$ is a ciphertext block. $k_1$, $k_2$...
Is there a way to find out the first few digits of the factors of the RSA numbers (RSA-1024 or RSA-2048)? I do not want to get all the digits but only first 4-5 digits. My question is thus more precisely: Is there a known, efficient, classical algorithm, that given a composite number, outputs the 4-5 most significant ...
I was attempting to figure out a way to implement the modulo operation as a set of gates in an Rank-1 Constraint System, detailed by Vitalik Buterin here However, it occurred to me that maybe we don't actually need to break down each step of the calculation into an R1CS gate, as long we sufficiently implement gates whi...
ECC requires less CPU power, less memory and shorter keys than RSA or any other asymmetric cryptography I came across in the literature (correct me if I am wrong). Is there a lower cost asymmetric cryptography than elliptic-curves based cryptography?
I was reading about path ORAM, and I have few questions I was wondering if an adversary knows all write accesses will be performed and has a view of the tree of which path being accessed. Can he infer anything about the system?
A MAC (or HMAC) can be represented by the general formula: MAC = H(key, message) I am calling "Multikeyed Hash" the operation (probably there exists already a name for this concept, which I don't know) below: MkHash = H(key1, key2, key3, ...., keyN, message) Are there known algorithms to compute that? Note that I ca...
Normally, the standard answers of why passwords shouldn't be stored using a groups of hash algorithms, including SHA-256 or higher, even if salted, are "because they are 'fast' hashes", "the attacker has access to specific hardware", and so on. Why SHA-256 (or some other hashes) is too fast for passwords but "slow" for...
I'm trying to understand why the RSA problem is not related to the Discrete Log problem, and how breaking the Discrete Log problem does not directly compromise RSA. I will explain my reasoning of why it seems to me that they are the same in hope that someone will find the flaw in my reasoning and correct me. If you don...
Is it basically safe and correct to use the Matyas–Meyer–Oseas construction to turn a fast block cipher like AES into a really fast single block hash function? By single block hash function I mean one that hashes, say, 128 bits of input and produces 128 bits of output. I don't need variable or larger message sizes and ...
If ed25519 is that attractive that it seems to be, can someone explain why adoption has been slow and if there are, if any, challenges with implementing ed25519. Nathan Aw
I just want to know that in AES we use following multiplication matrix for encryption. 2 3 1 1 1 2 3 1 1 1 2 3 3 1 1 2 and for decryption it use's following matrix. 0E 0B 0D 09 09 0E 0B 0D 0D 09 0E 0B 0B 0D 09 0E So my question is that can i change these matrices? and what is the process of doing that.
I trying to understand how can an IPEK created from a given KSN and BDK (Triple DES Edition). From this article-Creating an IPEK from a given KSN and BDK (Triple DES Edition): Derivation of Initial Key (IPEK) from Base Derivation Key (BDK) The initial PIN Entry Device key (the key initially loaded into the PIN Entry ...
Consider a scenario where a message is sent encrypted and signed using public-key cryptography. When using asymmetric encryption, you end up also using symmetric encryption if the message is large (hybrid encryption), which raises the question: is a MAC required? I'm aware that not using a MAC when using Encrypt-then-S...
I have found two ways to compute the RSA private key, but i have trouble understanding why they are equivalent. $1) D={k \phi(N)+1 \over E}$ $2) E* D=1 \mod \phi(N)$ $1)$ AFAIK comes from taking the relationship between eulers theorem and a modular identity such that. $$ M^{1+ \phi(N)} \equiv M \mod N \qquad \land \qq...
I want a stateless deterministic pseudorandom generator. Following number generation is deterministic, whenever I give $constantValue$, and index it will value $A$ $A = Hash(constantValue + index)$ $index$ ranges from $0$ to infinity. It is a deterministic value generation, but I have to keep state (index) to avoid ge...
I have written an algorithm in Python to find the main AES 128 key from the last round key. However, it doesn't work; I can not find back my main key. I know that the general principle is to do $w[i] = w[i+3] \oplus w[i+4]$, with $w$ being a buffer of dimension 2 : 44 * 4 bytes. The last key is therefore $w[40]$, $w[41...
could anyone give me a small example with actual numbers and variables over a finite field of how the XL algorithm is used to solve overdetermined systems? And the steps involved. I understand the algorithm but a simple example would make my life a lot easier. Also are there any implementations of the XL algorithm avai...
I need to make a simple very basic encryption with AES 128 ECB mode. The idea is to generate a cryptogram, code it in base64 and then decipher that text from a web service in php to process its content. Later we will increase the robustness of the encryption with a 256 key and CBC mode. The problem is that the encrypte...
So first of all I've a software which basically locks/encrypts a folder with a given password. Afterwards it's almost impossible to open the folder without entering the password through the software. I locked some of my much needed files and accidently forgot the password. So my question is, is it possible to retrive t...
I am designing an IoT system based on Silicon Labs EFR32 MCUs with hardware accelerated support for SHA-256, AES-128-CBC and ECC (m255) computation. The system will communicate over a proprietary radio communication protocol in an untrusted environment, and both flash and ram footprint and the number of exchanged messa...
For a challenge, I need to find the key that enciphered a text. I know that the key is of length N (invariable). There is no assurance that the key is only alphabetical or alphanumeric, but it could be a reasonable assumption. I know that the original text is alphabetical only, no number, but there is no assurance that...
To attack an encryption algorithm, you ask the encryption oracle to encrypt a polynomial number of messages of your choice and observe the outputs. Then, you give the oracle two messages m0 and m1. The oracle will choose one of the messages uniformly at random, encrypts it, and return the ciphertext c to you. ...
I'm trying to design some kind of protocol but I'm stuck, need some help please.. Given $ (a,b,c)\in \mathbb{N}^+$ with $ a + b = c $ I need to send an asymmetric encrypted version of a,b and c though a third-party that must verify that $ a + b = c $ but this third-party can't have access to those numbers, only their e...
My question is regarding the Signal Protocol[1]. Is it possible to implement the protocol securely, without a server? (I have no particular motivation for the question other than to understand better how the Signal Protocol works, what kind of trust I give to the server, and what attacks are possible if the server can ...
I would like to know if BLS signature scheme is strongly unforgeable under adaptive chosen message attack. If it is not, is it possible to modify the BLS scheme in order to reach this property ? Thank you in advance.
I'm trying to understand the security implications of addition in a prime field. Suppose I have X + Y = Z, occurring under prime field P(W) where W is the size of the field. If I know X and Z, I can trivially derive Y.... as long as Y is known also to be within the prime field. If however, Y is number significantly ...
Hex and ASCII are encoded with the same binary code. Why is it that a message in ASCII and the same message in hexadecimal produce different hashes? For example, the message helping strangers over the internet is fun!!!!!!!!!!!!!!!!!!!!!! gives the hash 8029b81d7b1c01460710c855651d2f44062e57fca135987a8558f30d0264e07bea...
I'd like to store a large amount of objects, all authenticated using something like a Merkle tree. The root will be published, and I'd like to make sure there is no way to enumerate these objects from the root of the tree, or even prove a document is in the tree, unless this information has been published by me. Is the...
In the context of fault attacks. What is the difference between fault measurement and fault model? I am reading a lecture and I can not understand for what measurement is used? Could you help me please?
Is it possible to compare two ciphertexts (two different encryption algorithms are used to create ciphertexts) to identify redundancy?
If irreducible polynomial $m(x) = x^8+x^4+x^3+x+1$ is chosen, or even for any other value, the multiplicative inverse will not exist for $01$, as $0000 0001$ will perfectly divide $m(x) = 100011011$ leaving remainder zero. So then how it the value for $01$ mapped to $7c$ in AES S-box?
Though obviously not an alternative for proper cryptanalysis, I was wondering about statistical/black box analysis. Should I produce a new key exchange protocol. With the same shape as Diffie-Hellman: Each side picks a random number $r_i$, calculates $f(r_i)$ sends it and receives $f(r_{1-i})$ then calculate a shared k...
To calculate the values of S-Box in AES, I came across a lot of resources where constant {63} was chosen. It is said that {63} satisfies the condition of S-Box that it should not have any fixed points or opposite fixed points. What are other choices for constants? eg: will {1},{2},{3},{4} be valid choices for constants...
Is Schnorr's protocol for proving knowledge for a discrete logarithm, truly an interactive proof or is it an interactive argument? If we let P to be unbounded, after she generates the commitment $t$ and receives the challenge $c$ she can try all $r$ such that $h^r=t \cdot z^c$(where $h$ is the generator of the cyclic g...
I am trying to implement an elliptic curve discret logarithm problem, but I have got a problem due to the representation of the infinity point. I tried this code : first define what is an infinity point public Point infinity() { BigInteger xInfinity = new BigDecimal(Double.POSITIVE_INFINITY).toBigInteger();...
Suppose that $\mu(n)$ is a negligible function, which means that for every $c>0$ there is some $N$ such that for all $n>N$ it holds that $\mu(n)\leq n^{-c}$. Now, imagine that some encryption scheme, signature scheme, or some cryptographic primitive in general has an "error" (distinguishing error, forging error, etc.)...
The zk-STARK is a proof zero-knowledge proof system that, in contrast to the zk-SNARK, no longer relies on a trusted setup where the "toxic waste" parameters are initialized. What are, in layman's terms, the basic building blocks of the zk-STARK, and how do they work?
I'm really lost. I'm creating a classroom lesson about Rabin encryption and I had understood the encryption process, the creation of public-key (N = p*q) and the steps I need to find the 4 values that can be the solution. BUT, every sample I find consider the true P and Q to demonstrate the decryption process (Extended...
"All 8x8 s-boxes created using Galois Field inversion plus an Affine Transform have the same non-linearity, as the Affine Transform does not change the linear or differential properties" is what this answer claims. Is there a proof of this statement? I am unable to see how this is true. I tried to calculate the Walsh a...
I create a hash with SHA3-384. I split the resulting array into two. The first called head has the first 320 bits and the second called tail has the last 64 bits. Next, I XOR head and tail. Which in fact means I XOR the last 64 bits of head with tail. This gives me a new hash of length 320. The question is how is thi...
The following link illustrates two possible methods for solving the "Where is Waldo?" puzzle in zero knowledge. http://www.anagram.com/jcrap/Volume_0_1/crv0n1-3.pdf Let's consider the first method: How can a Simulator be built for any of the method described above? I believe that the question above can answered only...
As the title says, I have some doubts about the term "cofactor" used to describe elliptic curves. AFAIK, it's a factor of the curve order, but why is it explicitly specified in some parameter lists then? How does it apply to the curve point addition / etc. algorithms?
A sponge function is supposed to be able to generate an arbitrary length of output. Yet, SHA3 (Bouncycastle) constrains me to choose an output length between 224, 256, 384, and 512. Evidently, these are not arbitrary lengths. How then is SHA3 a sponge function? Is there a specific way to generate "arbitrary length" usi...
I recently solved a stage in a challenge where I received 5 very large integers with character labels. I think they are components of an RSA key but I am a nooby to crypto and not sure. I have p, q, dp, dq and c. Any help would be appreciated.
I saw this recently published riddle and its solution in this link. My mathematical background is not so strong. Is it possible that someone here to solve the riddle? My background in math is not strong. I understand that there is some problem in that they repeatedly XOR each (file_name + '\0' + file_content) with the ...
I am studying SSL and IPSec. I can pretty much nail down the "very high level" differences and similarities between the two, but am struggling to find a "lower level" (but not too deep) look. This may seem like a dumb question, but do SSL and IPSec use different key schemes and algorithms from another to establish con...
The scenario: There is a web application where ownership check is time expensive so during the development all users were able to access all other user's objects (let's say apples) by changing the ids in the REST urls. The user is authenticated by issuing a signed (not encrypted) JWT to the client in which one of the c...
https://www.w3.org/2008/xmlsec/Drafts/xmldsig-core-20/#sec-ECKeyValue talks about ECDSA but even the explicit curve parameter stuff won't work with Ed25519 as Ed25519 has a completely different equation with different equations for point doubling / addition, etc. Does the XML signature standard support Ed25519?
What is a simple approach in Curve25519 key exchange in basic steps?
What is the reason for incorporating the lengths of the associated data and ciphertext into the calculation of the authentication tag in GCM? Is it for security?
To protect against cache attacks (side channel attacks) generally constant time crypto implementations are advised. In some cases DJB released new algorithms (chacha) that are designed with this in mind (as one of objectives). If so -- Are constant time implementations feasible for all popular algorithms? I ask beca...
What is the probability that if I choose a random $1 < r < n - 1$, $r^{65537} \pmod n$ will be $B$-smooth? $n$ is a 1024-bit RSA modulus. The Wikipedia pages on smooth numbers and the Dickman function are too obtuse for me to understand enough to calculate for my particular case. I was contemplating an attack on somet...
I want to implement AES algorithm,instead of LUT based S-box, but I’m stuck at point creating "Inverse of equation" during implementation. In creation of S-box I am using the following steps: ($a_7a_6a_5a_4a_3a_2a_1a_0$) bits converting in to field equation. Calculating the inverse of the field equation modulo($x^8 +...
The standard Salsa20 core is a $\{0,1\}^{384} \to \{0,1\}^{512}$ random function with a 16 byte constant ($\sigma$ for a 32-byte key), an 8 byte nonce, an 8 byte counter, and a 32 byte key. The hash function does not make any distinction between the types of input. This leaves 48 bytes which can be randomly chosen. If ...
When I connect to a secure sever that has is equipped with SSL certificate. Logically, the first step is the handshake to discuss the cipher suites etc. However, the very first time my web browser does a DNS request and comes up with the location of the site, and my browser connects to the website even before starting ...
I'm using the window.crypto library in browsers. I use iv from window.crypto.getRandomValues, key from window.crypto.subtle.generateKey, and additionalData from a user-input password. After the encryption, I store iv, key, and encrypted_content in the local storage. If someone gets these three things, is it possible fo...
I have a application with two users and one middle man, all of them holding the private and public key, To make the secured chat, two users and one middle man are all sending the public key and generate a secured channel. After establishing the channel, the middle man doesn't have the ability to see the encrypted messa...
What is an example of asymmetric cryptography or public key cryptography?
Salts should be unique so that an attacker can't brute force multiple passwords at once. However, since usernames are unique, wouldn't it be possible to use some representation of the username as a salt? Of course that means that if a username changes, the password needs to be rehashed. I'm asking from a cryptographic ...
I am trying to understand how the Fortuna PRNG should be seeded correctly for the first time. Let's assume that we do have a large-enough seed file available, but not any entropy sources during first boot. To my understanding, I would: initialize the PRNG (section 9.5.4) load the seed file (section 9.6.2) produce rand...
I'm just curious why do we use pairings on elliptic curve cryptography. There is a lot of information about how to use it, but I cannot find information about why to use it. Can somebody help?
Consider a group of $n$ public keys $pk_1,...,pk_n$ with corresponding secret keys $sk_1,...,sk_n$. I'm looking for a cryptographic primitive with the following properties: Ring signature property. It allows the owner of a secret key $sk_i$ to digitally sign a message in anonymous way i.e., any one validating the sign...
Today's hashes have many uses. File integrity, verification of a secret without revealing the secret (i.e. passwords), hash maps, bloom filters, and probably a few more cases not immediately coming to mind. The Caeser Cipher and Vigenere Cipher were both originally done with pencil and paper long before computers as we...