instruction
stringlengths
32
27.2k
In general terms, NORX works combining a cryptographic hash function and an stream cipher. At the end of an encryption operation you end with a ciphered message plus its authenticated hash. If you call AEADEnc() whith a zero length secret and postfix message, you basically get a hash function for each $(key, nonce)$ pa...
I've read a lot of information about PRNGs, PRFs and KDFs. As far as I know: PRNG: The seed for the PRNG must be a uniform string. It transforms a short real uniform string into some bits of pseudo-randomness. PRF: The PRF gets a uniform key and some additional input and transforms it into a string of pseudo-randomn...
Two of the CAESAR finalists use XEX and EME mode of operations (COLM uses EME, OCB uses XEX). I did literature to summarize the main advantages / disadvantages but I could not find much. My question is the following: What are the main advantages/ limitations of both?
I'm studying the Integrated Encryption Scheme and I did't understand which are the main differences between ECIES and DHIES. Can someone help me ? Thank you in advance.
I've been asked to write some course materials on cryptography and included in the objectives are some vulnerabilities/attacks. Most of these I have nailed but there are three that I don't seem to be able to find any info on: Version spoofing attack (possibly the same as version rollback attack which I have written ab...
I'm trying to setup an LDAP with user certificates. I have already learned that certificates can be stored in either the userCertificate attribute in DER format, or in userSMIMECertificate in PKCS#7 format, the latter having the advantage of being able to contain the full certificate chain, plus the S/MIME algorithms s...
I am reading the paper about Damgård–Jurik cryptosystem. In the proof, I found this equation $c^d = (g^mr^{n^s})^d = (\boxed{(1+n)^{j m}x^m}r^{n^s})^d = \boxed{(1+n)^{j md\pmod{n^s}}}(\boxed{x^m}r^{n^s})^{d\pmod{\lambda}}$, where $g=(1+n)^{j x}\pmod{n^{s+1}}$, $n=pq$ is an RSA module number, $\lambda$ is the l...
I want to know if there is a easy way to calculate $r$ from $c=r^t\mod{n}$ where $(c,t,n)$ is known and $t=pq$ is an RSA? If $n=t^2$, is it more easier?
I'm thinking to a particular scenario where I'm adopting the certificateless cryptography (the generic schema) where I have 2 trusted nodes, that we can identify as: $KGC_1$, $KGC_2$. Furthermore, I define two users, $A$ and $B$. The first user $A$ owns (after the interaction with $KGC_1$) the $\langle SK_A^1, SK_A^2\r...
There are several numbers that keep coming up when looking at certain random number generators, for example 6364136223846793005 is used in newer pcg-family algorithms and seems to draw it from mt19937_64. How are these numbers chosen? What are their relevance to generation of random values?
I started to read about Diffie-Hellman exchange and I encountered a problem which I don't know how to solve. Given $g=3$, $p=131$, $g^x\bmod p=112$, $g^y\bmod p=74$, compute $g^{xy}\bmod p$ $113$ $110$ $112$ $111$ How could I compute $g^{xy} \bmod p$? Or at least verify which one is correct. Any idea?
This is an improvement of the protocol described here. The protocol does not require trusted setup and is very efficient (much more efficient than anything else I could find). The protocol allows the following: Alice and Bob hold secret values $a$ and $b$ respectively. Alice can "transfer" a part of her value to Bob s...
In BLS short signatures paper, the authors describe a hash function $H\colon\ \{0, 1\}^∗ → G^∗$, where $G$ is a Gap-Diffie-Hellman group. They present a structure where a standard hash is used on a field element, and then mapped to a subgroup of $G$, later to be used in the security proof as a random oracle. How would ...
Are there any words in the English language which, when encrypted using the Caesar Cipher with any key, result in another English word? How may one go about determining which Caesar shifts are weakest in this context?
SIDH library looks good but lacks documentation and samples. The only signature-related code was found at http://github.com/yhyoo93/isogenysignature/blob/master/tests/kex_tests.c appeared not able to sign/verify message (just measure abstract performance of some partial calculations). Thus it's not clear how to mix arb...
I am making a 2 player dice game that runs for n rounds. To create random dice roles im using a concept a understood from randao. each user generates n sha3 hashes recursively of a random seed : e.g. H[0] = sha3(sha3(seed)) H[1] = sha3(sha3(H[0])) ... H[n] = sha3(sha3(H[n-1])) During the nth round, we xor the H[nth...
This is a purely theoretical question. Everyone is talking about quantum cryptography being the next big thing as quantum computers will be much faster than the computers we have today. So, from my understanding, quantum computers will have a much larger computation speed. My question is, instead of looking for new alg...
I am using a library to password protect my files into a zip file. The implementation has been taken from this piece of code. I want to understand which algorithm(if any) has been used here to password protect the files. The code is minimal and easily readable. Any leads on this would be helpful.
In the key generation of the threshold version of RSA or the threshold version of the Paillier cryptosystem (e.g. "Shoup - 2000 - Practical threshold signatures" or "Fouque et al. - 2000 - Sharing decryption in the context of voting or lotteries") a square $v$ in $\mathbb{Z}_N^*$ ($\mathbb{Z}_{N^2}^*$ respectively) is ...
I will be theoretical here. Let's say you want to create a VPN connection with some VPN provider. You have to agree on some key to encrypt the data. how can you get the key without your ISP knowing it? Even if you are the one who creates the key, the ISP still sees it as it's being sent to the VPN provider. An analogy ...
I'm working on a cryptography-related project, which uses ECC (elliptic curve cryptography). And one of the things that I need is a "secure" communication channel for two entities. I need someone to review the design. 1. First step is establishing a "shared secret". This is done in terms of Diffie-Hellman protocol. How...
It seems that not every MAC is a KDF. But would any PRF also work as both KDF and MAC? Could someone explain the relationship between these 3 definitions?
DK = PBKDF2(PRF, Password, Salt, c, dkLen) When PBKDF2 is used for key derivation (not password hashing), is it possible for an adversary who doesn't know Password to learn anything about Salt when given DK? Edit To clarify this question a bit, let's fix c and dkLen and simplify the function a bit: DK = PBKDF2(PRF, Pa...
I am trying to understand this concept of Learning With Errors. There does not seem to be a layman explanation of it anywhere. Here I describe layman as someone who understands ML concepts a bit (non expert). Can someone explain that a bit please? The wiki page refers to Parity Learning which also is not explained any...
SOURCE states the following in the proof of Theorem 2: Without loss of generality, I will assume that A is deterministic. If A is randomized, we can determinize it by fixing a sequence of coins that maximizes A’s conditional success probability; it is easy to see that this cannot reduce A’s advantage. Is this correct...
From this answer I understood how to prove key equivalence across two elliptic curves. Now, I'm trying to figure out some more practical aspects of implementing this. Before jumping into questions, here is the setup: The two elliptic curves are $g_1$ and $g_2$ of orders $q_1$ and $q_2$ such that $q_1 < q_2$. The gener...
Is there the way to generate new Koblitz curves, over $\mathbb F_{2^n}$ and $\mathbb F_p$? The Certicom SEC 2 standard says: The recommended parameters associated with a Koblitz curve were chosen by repeatedly selecting parameters admitting an efficiently computable endomorphism until a prime order curve was found. W...
There is an authority A with an associated public/private key pair (A.priv, A.pub). A can issue new "identities" by signing data (numbers or bytestrings). Each number associated with a signature by A is an identity. Here are two examples: identity_1 = (sign(A.privkey, 1), 1) identity_2 = (sign(A.privkey, 2), 2) How can...
Here is a DLP exercice $g = 51234,\; h = 90403 ,\; N = 311 \cdot 359 = 111649$. Define $r$ as the smallest positive integer with $g^r \equiv h \pmod N$. Define $s$ as the smallest positive integer with $h^s \equiv g \pmod N$. (Here, $r=33497$ and $s=27663$ ). Questions: If one looses some bits of $(r,s)$ can they be r...
CLEFIA is ISO/IEC 29192-2 standard in lightweight cryptography. According to this, the total GE area (I took the minimum) using .13 um is 2,488 (encryption mode) compared to piccolo-128 with GE area of 1,776 (encryption mode) and others lightweight block ciphers . (reference). On the software side, CLEFIA consumes la...
I want to count number of possible access structures in closed form(if possible) as a variable of $n$,the number of share holder. I have tried in several ways. Still no good progress. It is very hard to consider all cases and count it and I think there will be work by others on approximating the number. Is there any ap...
Having confusion. Plaintext = 25, Key=15 and modulus =26. Cipher=(15 + 25) mod 26=14. Now , plaintext = (15-14) mod 26=1 Here I am not getting the plaintext correctly. How to do it?
Notations: We follow the convention in the UC framework. We use $\mathcal{A}$ to denote the adversary, $\mathcal{P}$ to denote a party in the model. We focus on two types of corruption in the UC framework, which we rephrase now. Byzantine corruption: $\mathcal{A}$ takes the full control of $\mathcal{P}$. Passive cor...
I'm trying to learn libsodium to better my crypto knowledge. One nagging question I have is what is the difference between libsodium's sealed box and their normal box? Not in terms of technicalities as the docs do distinguish this well; but in terms of practical use cases. Per the docs: Sealed boxes are designed to an...
In a preparatory question we had to recover decimal digits $@$ of $r$ and $s$ given $g=51234$, $h=90403$, $N=111649$, $r=3@497$, $s=276@3$, with $r$ and $s$ the smallest positive solutions to $g^r\equiv h\pmod N$ and $h^s\equiv g\pmod N$. For large $N$ of unknown factorization, we can't compute $\varphi(N)$ from $N$ ...
I was wondering whether this encryption / decryption flow is very solid / secure. I encrypt the data using AES CBC 256 bit with an static IV. When the user logs in with his Firebase account (first phase of authentication), he gets the option to enter a security password. After that is done, some encryption values will ...
In the paper "Cryptanalysis of the Hash Functions MD4 and RIPEMD" the authors introduce the following notation (paragraph 4.1): $\Delta$$H_0$ = 0 $\xrightarrow{(M_,M')}$ $\Delta$$H$ = 0 What exactly does this mean? I understand that $\Delta$$H$ is probably the difference between hash outputs, but what about $\Delta$$...
Assume both Alice and Bob have a symmetrical key, let's call it $k$. They agree on a cryptographic hash function, let's call it $\mathsf{HASH}$. Now Alice wants to send an authenticated message. She sends $\left(\mathsf{msg}\parallel\mathsf{HASH}_\mathsf{k}(\mathsf{msg})\right)$ to Bob. Bob calculates the hash from $\m...
Google succeeded to get a collision in SHA-1 last year in an attack called shattered. Does this fact make certificates based RSA-SHA1 Signature risky for creating fraud certificates? If RSA-SHA1 signature is still safe, why is that (because the attacker doesn't have the private key)?
Suppose Alice holds a secret value $a$ to which she has publicly committed to using two elliptic curves of distinct order. The curves are $g$ and $g'$ of orders $q$ and $q'$ (with $q < q'$) and generator points $G$ and $G'$. The commitment would be $(A, A')$, where $A = a⋅G$ and $A' = a ⋅ G'$. I'm wondering if Alice co...
I'd like to encrypt my disk with a password. To generate a nice key from a password, I used PBKDF2, which applies a hash function $k$ times to a cleartext and outputs the final result. When I modify that encrypted data, I decrypt it, modify it, and re-encrypt it. When I re-encrypt, I plan to use a different key by incr...
A related question has been asked and answered here. My question is specifically about figuring out C for very large J. I have searched the web and found many scholarly articles on "jump ahead" and how to efficiently do so, but I am looking for a more "layman's" algorithm. Here is the background information. I am wo...
Note: I am not advocating anyone continues using SHA1-signed certificates: they are dead as far as security is concerned and should no longer be used. I'm just trying to clarify my understanding of the theoretical implications of Shattered as they might apply to such certificates. Prompted by this recent question: Afte...
This HRNG uses SHA3 as a sponge function (in its device driver) to inflate ots raw source output to many MByte/s. They compare this output rate to the output of other HRNG which don't use a sponge function. I'm wondering if this comparison is fair and brings me to the question to which extend a sponge function should b...
If one navigates to the ECDSA Go package page, he can observe that: This implementation derives the nonce from an AES-CTR CSPRNG keyed by ChopMD(256, SHA2-512(priv.D || entropy || hash)) While I am familiar with AES in CTR mode and SHA2-512, I am not familiar with what ChopMD refers to and I haven't been able to find...
$d = 27, e = 3, n = 40$ For encryption, I have the letter T converted to 084 by the ASCII table, which encrypts to $24$ by $84^3\bmod 40$, for example. To decrypt, I believe it would be $24^{27}\bmod40$ however this gives me 4.4342649e+38 which clearly does not fit into my ASCII table. How does one decrypt using the...
So I'm not sure if this is possible but assume I have $$c \equiv m^e \pmod n$$ I have $c$, $m$ and $n$ but no $e$, which in my case I a value that can be up to 15 digits. Is there a way to do this?
I came across a handbook named "Lecture Notes on Cryptography" from Shafi Goldwasser and Mihir Bellare and I read their definition 3.1 about poly-time indistinguishability: Let $X_n,Y_n$ be probability distributions on $\{0,1\}^n$ (That is, by $t\in X_n$ we mean that $t\in\{0,1\}^n$ and it is selected according to t...
Say I have a group $G$ with two different generators $g_1$ and $g_2$, where the discrete log from one to another is unknown. Also, there are two public commitments $g_1^{r}$ and $g_2^{r}$, where it is publicly known that they are raised to the same $r$ (but unknown which $r$). Does the latter piece of information comp...
$A$ sends $B$ the encryption $E_{pkA}(m)$. $B$ computes $R=xE_{pkA}(m) + y$ and sends $R$ back to $A$, but tells him nothing about the parameters $x$ and $y$. $A$ performs $D_{pkA}(R)$ and recovers the value $xm+y$. Is this protocol possible using the Paillier cryptosystem?
My understanding is that Zk-SNARKs (and zero-knowledge proofs in general) can be used to prove that a polynomial-time computation has a certain output, while keeping one or more of the inputs to that computation hidden. For example, say you have a string h which is the output of a fixed hash function. If you know an in...
I'm currently trying to write a server emulator for a multiplayer game. I've found what I believe to be the RSA keys. I've found that by editing them I can get the real login server to reject them saying they are corrupt, IE. not encrypted properly. So from that I can confirm they are the correct keys. However, I can't...
I am wondering, if it is possible to split a secret (s.th. like shamir's secret sharing) which can be used to generate a re-encryption key in proxy re-encryption and only serve the splitted portions for the sake of generating a re-encryption key which can only be used for a specific public key? So something like: sec =...
TL;DR - Are there any benefits to using static DH over ephemeral DH? I'm reading about the differences between static DH & ephemeral DH and I am trying to think of one logical reason to use static(-static) DH over ephemeral(-ephemeral) DH. My understanding of DHE is that it provides Forward Secrecy which is something...
In case of using client-side password stretching (plus a single hash on the server) - the server would need to send the salt before authentication, of course. Though the salt is not considered a real "secret", is having the salt that public a serious consideration for rejecting this method (i.e. client-side password st...
Let's say we have a program that only accepts numerical inputs and the output is simply an increment by one of the input. Example with input "a" and output "b": $$Input: a = 7$$ $$Output: b= a+1 = 8$$ So it would be easy to know what the program is doing. Is it possible to obfuscate the program code in such a way that...
So I recently re-read the OPAQUE paper and while reading it I found HMQV to be a bit "unnatural" / "unintuitive", which may just be because I didn't (yet) read the HMQV paper, so I wondered whether one could replace the instantiation of the key-exchange with the X3DH primitive*. So this is my question: In OPAQUE, can ...
I'm trying to do some performance (time) calculations over TLS. I have the data I need for a variety of cipher suites but in order for the calculations to generalize well, I need to know if there is a clear most popular choice for TLS 1.2 cipher suite. Data to back up any answers would be appreciated.
How to generate a BIP39 mnemonic from an Ed25519 (Ed25519+libsodium, with 8 for salt, 48 for key plus 32 bytes) encrypted private key? I have an Ed25519 encrypted private key (for which I know the password). I would like to create a BIP39 mnemonic from it. This is to import a private key generated elsewhere into a Nano...
Suppose I have the message $m_1 = \sf{i\ like\ dogs}$. Suppose its one-time pad encryption with key $k$ is a given hexadecimal string of 22 characters. How would I encrypt a message $m_2 = \sf{i\ like\ cats}$ with the same key $k$? I was given a similar question (but with different messages). Firstly I observed that t...
I cannot get my head around this. In Paillier, the ciphertext is calculated using $c = g^m.r^n\ mod\ n^2$ where $(n,g)$ forms the public key and $r$ is a random number $0<r<n$. Assuming an attacker knows $c$, $r$, $n$. and $g$, what would it take - in average - to find $m$ ?
I've been suggested to ask here instead of stackoverflow, so here I am. I'd like to encrypt the data of my application that uses a custom protocol I've created. I know about TLS and other protocols but I just want to do a basic encryption. The following code is C++, please ask me if you need any help to understand it....
As I understand it, a JSON Web Token (JWT) consists of 3 parts: the header, specifying the hashing algorithm to use for the signature; the payload itself; and the signature, which is a hash of the header and the payload using the specified hashing algorithm and a given secret. The point of the signature is for the re...
I have a scenario where entity $A$ has an unauthentic copy of the public key $P_B$ of $B$ and an authentic copy of $P_C$ of $C$, trusted by both $A$ and $B$. Now $A$ wants to establish trust in $P_B$. Steps: $B$ writes a message, signs it and sends it to $C$ : $$B \rightarrow C: M \| S_B(M)$$ $C$ is an intermediary e...
I make research about big numbers in finite fields and I need to calculate a cube root modulo prime P for the number N: N = 33307028807218380701173040920772273133747152666242396962200448019852017733098. P = 115792089237316195423570985008687907853269984665640564039457584007908834671663 All algorithms that I can find ove...
Let's assume we have the q-ary lattice $$ \mathcal{L}_q({\bf A})=\{ {\bf z}\in \mathbb{Z}^{n} : \exists {\bf s}\in \mathbb{Z}^{n}_{q} \ , \ {\bf z}={\bf A s}^{T} \mod q \},$$ where ${\bf A}\in \mathbb{Z}^{n\times n}_{q}$. My question is, can I use the Babai's algorithm with input the matrix ${\bf A}$ and a target ve...
We are working on the web application that is basically generating a self-signed certificate during the installation. It's a Java based app and for generation of the certificate we are using SHA512withRSA. Can I ask what would be the best replacement for it? Something with better encryption level and more 'modern' secu...
I plan to use GPG to encrypt a small file (32KB) for very many recipient public keys (few thousands). I tested GPG with RSA and then ECDH public key encryptions. If RSA is very slow, with ECDH (nist 256 curve) I get (still bad -but) better results: 1K destinataries encrypt: 14sec 5K destinataries encrypt: 5m42sec Now,...
Is there a well maintained, preferably documented, Sigma protocols compiler library? i.e. takes an abstraction of statements to prove, and outputs a cryptographic protocol between verifier and prover? A search yielded that paper, but it seems to point a library in which I don't find any code.
Hi I am very new to this field and I was wondering how one would prove or disprove the following statements: 1) if the DH key exchange protocol is secure for a finite cyclic group G, then computing the DL is hard in G. 2) If computing the DL is hard in G, then the DH key exchange protocol is secure in G.
I have a question regarding the resulting sizes of the blocks and shift registers in Cipher Feedback Mode. In the web there are different pictures to illustrate the CFB-mode. Now on the first picture there are no shift registers at all. I dont understand which special case the first picture describes. Is really the e...
I'm new to cryptography, so I was searching for a forgery attack, but unable to find anything. Can anybody tell me the difference between forgery attack and user impersonation attack?
Given the following Trap-door Commitment scheme Secret key receiver: $x_B \in_u Z_q$ Public key receiver: $y_B = g^{x_B} \mod p$ Here, $p=q*k+1$ for two primes $p,q$ and $k \in Z$. And $g$ is the generator of subgrup $G_q$ of $Z_p^{*}$, of order $q$. To the sender commit $w \in Z_q$, he selects $r \in_u Z_q$, the co...
I have a requirement to generate and share unique symmetric keys for a large numbers of small data objects. In many cases the storage and retrieval of the key for each object will be a significant overhead, and often larger than the individual data objects they secure, so am looking for a strategy that mitigates this. ...
Some time ago I faced the problem of the unexpected format compression of the points on elliptic curve. I used ECDH procedure with a third party service on the base of the $\mathbb({F}_{2^m})$ curve in the polynomial $(m,k_3,k_2,k_1) = (431,5,3,1)$ representation. As response I received a compressed point in the follow...
I have a simple question: Are we certain that the md5 hashing algorithm can produce $2^{128}$ different outputs ? If so, how ? Note: Sorry if this has already been asked, I really couldn't find it.
A common approach to make (secure computation) protocol descriptions and proofs simpler is to describe them in a hybrid model, where the protocol in the real world has access to some auxiliary ideal functionality F (e.g. an ideal OT functionality). Lets say I only care about standalone security (vs. UC). Assuming all c...
I'm currently reverse engineering a program that uses Curve25519 key exchange in network communication. I have only a basic understanding of ECC, so maybe this thing just seems strange to me. The client generates a private key, derives the public key from it, and sends it to the server. So far, that seems like a normal...
Edit: ok, after I re-read the paper a couple of times it is clear that Table 6 is easily derived from Table 5, which describes the collision differential. So the real question is: how did the authors come up with the collision differential? Original question: The paper Cryptanalysis of the Hash Functions MD4 and RIPE...
Could anyone explain me why the verifier in Honest verifier zero-knowledge Simulator, has to choose a random challenge to send to prover? I have not understood well. Thank you in advance.
I was reading about memory-hard functions recently. In those papers I read, they almost always introduce a time-space trade-off like this: $$ S(n) \times T(n) \in \Omega(\mathrm{Poly}(n)) $$ I understand memory-hard functions are trying to impose heavy memory usage to counter ASIC attacks. But I don't understand why he...
According to Google, to access the id_token it sends along with Access Tokens (for accessing their API), you must first validate the token using the RS256 Public Key available from this page. The public key responses look like this: { "kty": "RSA", "alg": "RS256", "use": "sig", "kid": "8c9eb968f73744eaed4...
In one of their documents, NIST recommends using an approved one-way function, followed by a list of such functions, such as HMAC, KMAC, etc.. However, the wikipedia page says: Unsolved problem in computer science: Do one-way functions exist? How does something get approved if it may not even exist? Who approves it, ...
Quote: The chosen output length of the key derivation function SHOULD be the same as the length of the underlying one-way function output. Could someone please help explain the benefits and concerns?
NIST recommends doing an additional round of hashing using a secret salt: In addition, verifiers SHOULD perform an additional iteration of a key derivation function using a salt value that is secret and known only to the verifier. This salt value, if used, SHALL be generated by an approved random bit generator [SP 800...
How are short term keys usually implemented by PKCS#11? Is the proper way to distinguish between keys that are more temporary/stored in volatile memory and those stored in non-volatile memory to label them "session objects" or "token objects" using the CKA_TOKEN attribute? Or is there another attribute or property in ...
What exactly is the difference between key transport and key encapsulation? Either they seem to be used interchangeably or I'm mixing stuff up.
I have an encryption scheme where the secret keys are $(\alpha_1, \alpha_2)$ and $(y_1, y_2)$. $(y_1', y_2')$ are public information. The ciphertext is: \begin{align*} \mathit{ct}_1 &= r_1 \cdot (\alpha_1 y_1 + \alpha_2 y_2), \\ \mathit{ct}_2 &= r_2 \cdot (\alpha_1 y_1 + \alpha_2 y_2), \\ \mathit{ct}_3 &= r_1' ...
I have 2 key pairs $(x_1, y_1)$, $(x_2, y_2)$. I also have $a = $random 256-bit array and $b = $256-bit of defined values from me. I know the values for $(x_1, y_1)$, $x_2$ and $b$. But I miss the value of $y_2$ (private key). I have the following term: // * = scalarmult_vartime (a * sha512 (a + b) [0-32]) + x1 = x2 C...
I'm currently trying to optimise the finite field multiplication in $ \operatorname{GF}(2)[x]/(p)$, where $p = x^8 ⊕ x^7 ⊕ x^6 ⊕ x ⊕1 ∈ \operatorname{GF}(2)[x] $. The thing is that I have to multiply by $ 16,32,133,148,192,194 \ \ and \ \ 251 $. Actually, what I do is that I declare 7 arrays (one for each multiplicatio...
The scenario is like this: I need 2 keys for different purposes (encryption + encryption, encryption + mac, or whatever). Because it is not good practice to reuse the same key, I'd like the 2 keys to be independent. But remembering 2 different keys are cumbersome (don't question this please), so I think there should be...
Maximum Distance Separable (MDS) Matrices are used for providing diffusion in a cipher. How to test the strength (with respect to cryptographic properties) of an MDS matrix used in a cipher?
I have an implementation of scrypt that doesn’t produce the same output as an online scrypt key generator I found. For example, if I run my own scrypt in a function like this: void test_scrypt(void) { char passwdTxt[] = "abc"; int passwdlen = strlen(passwdTxt); uint8_t passwd[passwdlen]; memcpy(passwd,...
Suppose \begin{align*} g^r &\equiv h \pmod N, \\ h^s &\equiv g \pmod N, \end{align*} for known $g$, $h$, $r$, $s$, and $N$, but not $\phi(N)$. Then $$g^{r\cdot s - 1} \equiv 1 \pmod N,$$ so I can calculate $r\cdot s - 1 = k\cdot\phi(N)$. Is $g$'s order $(r\cdot s - 1)/k$? I think g's real order to be divided $\phi...
RFC 5869: Thus, the goal of the "extract" stage is to "concentrate" the possibly dispersed entropy of the input keying material into a short, but cryptographically strong, pseudorandom key. The implementation: HKDF-Extract(salt, IKM) -> PRK PRK = HMAC-Hash(salt, IKM) Here salt may be 0. In this case, it feeds IKM i...
Assume I have a password with sufficient entropy but may not be uniformly distributed, how can I turn the password into a key that can be used for symmetric encryption? I think there is surely such a method because when you type gpg -c it asks for a passphrase (more or less a password) not a key. Ideally this method do...
I only understand assurance of integrity using a hash function. How to use cryptograpy to assure data integrity?
Suppose we have an almost shared secret. For example if we have a noisy connection to a shared secret source of randomness. So Alice has $k_1$ and Bob has $k_2$ similar but not necessarily identical to $k_1$. One formalization could be: $\operatorname{hammingDistance}(k_1,k_2) << \operatorname{length}(k_1)=\operatornam...
Let $F:\{ 0,1 \}^n \times \{ 0,1 \}^ n \rightarrow Z^*_q $ is a PRF, and $H:\{ 0,1 \}^{2n} \rightarrow \{ 0,1\}^n$ is a secure hash function. Is the following construction $\Pi=(Gen,Mac,Vrfy)$ is a secure MAC? (Note that we redefined the condition of the attacker's success for pair $(m=a_1|a_2,~T)$, so that $Vrfy_K(m,T...
As I understand it, if you have a Bloom filter that was generated from the members of a specific set, you can test whether a given bit string is in the set (with some given false positive rate). The idea I had would be to run more complicated predicates on the set, like being able to query whether "there exists a membe...