instruction
stringlengths
15
30k
I am right now studying Pseudo Random Functions. I have a couple of constructions made of a safe PRF F:{0,1}^l x {0,1}^l -> {0,1}^l. I am unsure of wether these are safe ( in terms pseudorandomness ) or not. I will try and reason. Correct me if I am wrong. 1.) F1 = F(k,x)||k F1 is not safe, since the concatenati...
Passkey is nice. The math is nice. The tech is nice. https://security.googleblog.com/2023/05/so-long-passwords-thanks-for-all-phish.html What I still dont see after sooo many hours: what software creates the passkey. User autonomy is important and it is a (private) key question (pun intended). I do not really see th...
who creates the passkey (and how many will be created)?
Passkey is nice. The math is nice. The tech is nice. https://security.googleblog.com/2023/05/so-long-passwords-thanks-for-all-phish.html What I still dont see after sooo many hours: what software creates the passkey. User autonomy is important and it is a (private) key question (pun intended). I do not really see th...
Do $\exists $ keys $k_1, k_2$ which given any (128-bit) message $m$ are related to each other by being * commutative to each other with $AES(AES(m,k1),k2)=AES(AES(m,k2),k1)$ $\forall m$ and generally $AES(m,k1) \not= AES(m,k2)$ * or $k_2$ is equal to applying $n$-times $k_1$ with $AES^n(m,k_1)=AES(m,k_2)$ with $AES^n...
Has AES some keys which are related to each other? e.g. $\forall m: AES(AES(m,k1),k2)=AES(AES(m,k2),k1)$ or $AES^n(m,k1)=AES(m,k2)$. How to find them?
Do $\exists $ keys $k_1, k_2$ which given any (128-bit) message $m$ are related to each other by being * commutative to each other with $AES(AES(m,k1),k2)=AES(AES(m,k2),k1)$ $\forall m$ and generally $AES(m,k1) \not= AES(m,k2)$ * or $k_2$ is equal to applying $n$-times $k_1$ with $AES^n(m,k_1)=AES(m,k_2)$ with $AES^n...
Do $\exists $ keys $k_1, k_2$ which given any (128-bit) message $m$ are related to each other by being * commutative to each other with $AES(AES(m,k_1),k_2)=AES(AES(m,k_2),k_1)$ $\forall m$ and generally $AES(m,k_1) \not= AES(m,k_2)$ * or $k_2$ is equal to applying $n$-times $k_1$ with $AES^n(m,k_1)=AES(m,k_2)$ with ...
Do $\exists $ keys $k_1, k_2$ which given any (128-bit) message $m$ are related to each other by being * commutative to each other with $AES(AES(m,k_1),k_2)=AES(AES(m,k_2),k_1)$ $\forall m$ and generally $AES(m,k_1) \not= AES(m,k_2)$ * or $k_2$ is equal to applying $n$-times $k_1$ with $AES^n(m,k_1)=AES(m,k_2)$ with ...
Do $\exists $ keys $k_1, k_2$ which given any (128-bit) message $m$ are related to each other by being * commutative to each other with $AES(AES(m,k_1),k_2)=AES(AES(m,k_2),k_1)$ $\forall m$ and generally $AES(m,k_1) \not= AES(m,k_2)$ * or $k_2$ is equal to applying $n$-times $k_1$ with $AES^n(m,k_1)=AES(m,k_2)$ with ...
Do $\exists $ keys $k_1, k_2$ which given any (128-bit) message $m$ are related to each other by being * commutative to each other with $AES(AES(m,k_1),k_2)=AES(AES(m,k_2),k_1)$ $\forall m$ and generally $AES(m,k_1) \not= AES(m,k_2)$ * or $k_2$ is equal to applying $n$-times $k_1$ with $AES^n(m,k_1)=AES(m,k_2)$ with ...
1. $F_1(k,x):=F(k,x)\mathbin\|k$ Beside the valid reason cited, another (rather worse) reason why that's not a PRF is that one example reveals $k$, which then allows to compute $F_1(k,x)$ for any $x$ given the (assumed public) definition of $F$. 2. $F_2(k,x):=F(k,x)\oplus y$ for some $y$ As long as $y$ is fixe...
1. $F_1(k,x):=F(k,x)\mathbin\|k$ Beside the valid reason cited, another (rather worse) reason why that's not a PRF is that one example reveals $k$, which then allows to compute $F_1(k,x)$ for any $x$ given the (assumed public) definition of $F$. 2. $F_2(k,x):=F(k,x)\oplus y$ for some $y$ As long as $y$ is fixe...
1. $F_1(k,x):=F(k,x)\mathbin\|k$ Beside the valid reason cited, another (rather worse) reason why that's not a PRF is that one example reveals $k$, which then allows to compute $F_1(k,x)$ for any $x$ given the (assumed public) definition of $F$. 2. $F_2(k,x):=F(k,x)\oplus y$ for some $y$ As long as $y$ is fixe...
1. $F_1(k,x):=F(k,x)\mathbin\|k$ Beside the valid reason cited, another (rather worse) reason why that's not a PRF is that one example outputs reveals $k$, which then allows to compute $F_1(k,x)$ for any $x$ given the (assumed public) definition of $F$. 2. $F_2(k,x):=F(k,x)\oplus y$ for some $y$ As long as $y$...
1. $F_1(k,x):=F(k,x)\mathbin\|k$ Beside the valid reason cited, another (rather worse) reason why that's not a PRF is that one example outputs reveals $k$, which then allows to compute $F_1(k,x)$ for any $x$ given the (assumed public) definition of $F$. 2. $F_2(k,x):=F(k,x)\oplus y$ for some $y$ As long as $y$...
1. $F_1(k,x):=F(k,x)\mathbin\|k$ Beside the valid reason cited, another (rather worse) reason why that's not a PRF is that one example outputs reveals $k$, which then allows to compute $F_1(k,x)$ for any $x$ given the (assumed public) definition of $F$. 2. $F_2(k,x):=F(k,x)\oplus y$ for some $y$ As long as $y$...
It seems like every CCA-secure PKE scheme<sup>1</sup> has some sort of _check_ that the decryptor performs. Sometimes failure will result in rejection ("explicit rejection") or the decryptor will simply return a random value ("implicit rejection", like in [Fujisaki-Okamoto without aborts](https://eprint.iacr.org/2017/6...
Does CCA security require rejection?
It seems like every CCA-secure KEM<sup>1</sup> has some sort of _check_ that the decapsulator performs. Sometimes failure will result in rejection ("explicit rejection") or the decapsulator will simply return a random value ("implicit rejection", like in [Fujisaki-Okamoto without aborts](https://eprint.iacr.org/2017/60...
The Python [secrets module][1] claims to produce cryptographically secure random numbers. I did some research on which random number generator is used when you call the secrets module on Windows. I found the following: ->`secrets` uses `random` ->`random` uses `os.urandom` ->`os.urandom` uses `_PyOS_URandom()`...
Is Python secrets module using a unsafe RNG on Windows?
Thank you very much for taking the time to read my post. I am taking a course on blockchain technology and cryptocurrencies. Yesterday, we had a multiple choice quiz that was worth 15% of the course mark. I and several of my fellow students disagreed with an answer to a question that the course coordinator had provided...
No. `CryptGenRandom` on Windows is deprecated as an API, but not for security reasons, rather because the whole cryptography API has been redesigned. The 2007 Dorrendorf *et al.* paper is about a weakness in the implementation of `CryptGenRandom` at the time. As any serious provider of cryptography implementations w...
If both communicating sides end up with the same secret 3000-bit key, is it enough to XOR each byte of the messages with each byte of the secret key to make it secure? Wikipedia says it is, but I wanted to ask if this is still the case nowadays. That would mean each message can be up to 375 bytes in size, so that...
There is this cool paper https://eprint.iacr.org/2017/395.pdf exposing a side channel protected implementation of keccak, in particular Domain Oriented Masking for the Chi function. The Chi function is a 5bit S-Box, so can also be seen as a lookup table of 32 5bit values. My question is, in an hardware implementation...
In hardware, why using an algebraic implementation of a (small) S-Box instead of a LUT?
Assuming I have single-key Even-Mansour with single $2n$-bit permutation in wide-pipe Merkle-Damgård specifically with Matyas-Meyer-Oseas mode outputting $n$-bit hash. What security can I expect against collisions and preimages? Am I wrong to expect $2^\frac{n}{2}$ for both?
What would be recommended way to make deterministic password based file encryption? I can use SIV mode, but KDF (like Argon) takes salt for which I could use SIV tag, but I cannot make it because I need key first. I could use hash of file contents as salt, but that would make it 3-pass. If I would use some other ...
If we talk about the security of public key encryption in Regev's lwe system, if attacker would have knowledge of `(u,u')[u=Ar, u'=b^tr + µ q/2, r={0,1}^m]` and `b`, then value of `r in u'` can be guessed easily by the knowledge of `u` and `A` and so the value of `message(µ)` from `u'`, so how is this system considered...
What would be recommended way to make deterministic password based file encryption? I can use SIV mode, but KDF (like Argon) takes salt for which I could use SIV tag, but I cannot make it because I need key first. I could use hash of file contents as salt, but that would make it 3-pass. If I would use some other ...
Is there any (k,n)-threshold encryption scheme, such that the decryption process is non-interactive, i.e., the decryption can be processed "in a line" where each party "in the middle of the line" receives a partially decrypted ciphertext, perform partially decryption itself, and then pass it on to some other party? ...
I am trying to implement the Schnorr’s identification protocol in C. I need a safe prime in order to be able to find a generator of the cyclic group efficiently. The problem is that my program takes too much time to find the safe prime. I am using Libsodium for generating random numbers and GMP for arbitrary precision ...
If we talk about the security of public key encryption in Regev's lwe system, if attacker would have knowledge of $(u,u'):[\mathbf u=A\mathbf r, \mathbf u'=\mathbf b^t\mathbf r + \mu q/2, \mathbf r\in\{0,1\}^m]$ and $\mathbf b$, then value of $\mathbf r$ in $\mathbf u'$ can be guessed easily by the knowledge of $\mathb...
It seems like every CCA-secure KEM<sup>1</sup> has some sort of _check_ that the decapsulator performs. Sometimes failure will result in rejection ("explicit rejection") or the decapsulator will simply return a random value ("implicit rejection", like in [Fujisaki-Okamoto without aborts](https://eprint.iacr.org/2017/60...
I wrote a command line application for encrypting/decrypting files to your local machine. The idea is you have an asymmetric key pair where the private key is stored encrypted and the public key is stored in plain text. This way you can encrypt data without having to "unlock" the application (decrypt your private key),...
Can someone give a comprehensive guide on how to run NIST SP 800 90B entropy assessment c code in windows?
Hey there guys and gals, so I am right now studying topics regarding pseudorandomness. 1. I was wondering why, for example with CBC-MAC oder a regular CBC blockcipher, we use padding instead of a PRG. If the block size is not a whole multiple of the clear text m, we could just use a PRG with the seed as the last...
any paper mentioning the performance decreases with N? why when N is increasing, the performance decreases? any papers? BR
Say we have an element $g$ in a group (this element may or may not be a generator of the group). Are there signature schemes that enable to sign this element, and then to be able to derive a signature of $g^a$ for a chosen $a$ without the presence of the signer? Thank you for your help.
Militaries use their own cryptographic algorithms, those of a private third party, or ones that are openly available. However, fear of a backdoor having been planted in publicly-available encryption protocols scares them even though it is technically possible to analyze cryptographic primitives and establish whether or...
> Are there signature schemes that enable to sign this element, and then to be able to derive a signature of $g^a$ for a chosen $a$ without the presence of the signer? If you mean "without access to the private key", and you prohibit $a \equiv 1 \pmod q$ (where $q$ is the group order), no, there's not such standard ...
It's difficult to succinctly answer this, as understanding this question is the bulk of research into Fully Homomorphic Encryption (i.e. there are many papers). Still, the following is the beginning of an answer. At a high level, fully homomorphic encryption starts with a "cryptosystem with linear decryption". Thi...
Say we have an element $g=H(m)$ in a group (this element may or may not be a generator of the group). Are there signature schemes that enable to sign this element, and then to be able to derive a signature of $g^a$ for a chosen $a$ without the presence of the signer? Thank you for your help.
I'm trying to design a zero-knowledge protocol for the creation of a shuffled deck of cards for use by two players. Naturally this requires that neither player knows the order of the cards after the shuffle, nor what card was drawn by the other during play, but I'd also like to be able to do this without needing a trus...
I'm trying to design a zero-knowledge protocol for the creation of a shuffled deck of cards for use by two players. Naturally this requires that neither player knows the order of the cards after the shuffle, nor what card was drawn by the other during play, but I'd also like to be able to do this without needing a trus...
From what I have understood of naive RSA (without padding) so far, it seems that A and B must first decide on the prime factors in order for B to generate its private key to decrypt A's message. I do understand that the RSA system helps in the establishment of a secure "channel", rather than having to rely on creating...
Is private key generation without prior communication possible in naive RSA?
Do we always require to be sure that the inputs of the parties in a secure multi-party computation are independent? i.e., one party's inputs do not have dependency on the other parties inputs? ([this paper][1] claims that the inputs must be independent) If this is the case, isn't it in contrast with the power of *ma...
Do we always require to be sure that the inputs of the parties in a secure multi-party computation are independent? i.e., one party's inputs do not have dependency on the other parties inputs? ([this paper][1] claims that the inputs must be independent) If this is the case, isn't it in contrast with the power of *ma...
I'm trying to design a zero-knowledge protocol for the creation of a shuffled deck of cards for use by two players. Naturally this requires that neither player knows the order of the cards after the shuffle, nor what card was drawn by the other during play, but I'd also like to be able to do this without needing a trus...
I have a file with an EC Public Private Key Pair and curve parameters: openssl ec -in keyfile.pem -noout -text read EC key Private-Key: (256 bit) priv: aa:bb:cc:aa:bb:ccaa:bb:ccaa:bb:ccaa:bb:cc:aa: aa:bb:cc:aa:bb:ccaa:bb:ccaa:bb:ccaa:bb:cc:aa: pub: aa:bb:cc:aa:bb:cc...
We all know that [block Korkine-Zolotarev][1] (BKZ) algorithm is essentially a deterministic [lattice reduction][2] algorithm. However, in the actual implementation, the [BKZ][1] algorithm contains some randomization, For example, the actual algorithm will do some random unimodular transformations on the lattice basis...
Does randomization make a big difference in the output of the BKZ algorithm?
Do we always require to be sure that the inputs of the parties in a secure multi-party computation are independent? i.e., one party's inputs do not have dependency on the other parties inputs? ([this paper][1] claims that the inputs must be independent) If this is the case, isn't it in contrast with the power of *ma...
In LWE, the error term $e$ is "classically" obtained from the discrete normal distribution. Why is it so often found that this distribution is used? Are there other possibilities for distributions? The secret $s$ is often uniformly distributed, this makes sense, if one wants to "hide" just the secret in the (uniform...
Do we always require to be sure that the inputs of the parties in a secure multi-party computation are independent? i.e., one party's inputs do not have dependency on the other parties inputs? ([this paper][1] claims that the inputs must be independent) If this is the case, isn't it in contrast with the power of *ma...
Do we always require to be sure that the **inputs of the parties** in a secure multi-party computation are **independent**? i.e., one party's inputs do not have dependency on the other parties inputs? ([this paper][1] claims that the inputs must be independent) If this is the case, isn't it in contrast with the powe...
I'm working on a project that involves broadcast (uni-directional) streaming and requires non-repudiation. Essentially, a device broadcasts a data stream over the air, and any receiving station needs to be confident that the data was actually transmitted by the claimed device. My initial thought is that the broadcas...
**My Main Question:** Do we always require to be sure that the **inputs of the parties** in a secure multi-party computation are **independent**? i.e., one party's inputs do not have dependency on the other parties inputs? ([this paper][1] claims that the inputs must be independent) ___________________________...
If we're talking about standard secure function evaluation, then the adversary's inputs are independent of the honest parties'. It's easy to see this from the ideal functionality: it doesn't give out any information until collecting inputs from everyone. In the ideal world, the adversary has no information about honest...
> How would I create a PKCS12 file from this? `openssl pkcs12 -export -inkey keyfile.pem -nocerts -out p12file [-passout ...]` will create _A_ PKCS12 file -- i.e. a file complying with the PKCS12 document. However, you will probably be unable to use this PKCS12 file for anything expect maybe printing it out and a...
I referred to the explanation of encryption mode from Wikipedia, but I'm confused now, and I went to find some books about Cryptography, but it didn't solve my confusion. The CTR mode uses Counter to participate in encryption. But in Wikipedia, the encryption process is as follows: ![](https://upload.wikimedia.o...
How CTR mode is encrypted?
I want to generate some tokens for client as http cookie can I md5 them with salt and then use ```"<random token>"+"<md5>"``` as the token for they can be verified in a cheap way is it safe?
I didn't understand how ECDH actually works. Disclaimer: I know very little about elliptic curves. Here is how DH works: 1. Alice and Bob agree on a prime number $P$ and a generator $G$. (They use one from [RFC 3526][1]) 2. Alice generates a long-enough (how long?) secret $S$ and calculates $R = G^S \pmod{P}$ a...
Kerberos (and I assume other Trusted Third Party protocols) use (hash) an existing shared secret key to create a session key used for authentication. I read that this authentication secret key can then be used to create another secret key to be used as the session key for authentication. "If a message integrity o...
Kerberos (and I assume other Trusted Third Party protocols) use (hash) an existing shared secret key to create a session key used for authentication. I read that this authentication secret key can then be used to create another secret key to be used as the session key for message encryption. "If a message integri...
Are there any cryptographic proof systems that rewind the prover to argue soundness but are not proofs of knowledge? In particular, I would be very curious to see examples of proof systems where rewinding is useful for arguing soundness but does not seem to suffice for witness extraction. To give some nonexamples, [...
A cryptographic proof system which uses rewinding to argue soundness but is not a proof of knowledge?
The terms "average-case", "worst-case" hardness are quite confusing. 1. What do they mean when they say certain problems (like lattices) have an average-case to worst-case relationship? Do they mean there is a polynomial reduction between two case of the problem? Because polynomial reductions are of ou...
I'm considering some non-cryptographic PRNG which uses multiplication of two 64-bit or 128-bit random numbers at some point. __uint128_t a; __uint128_t b; __uint128_t result; result = a * b; Is this constant time? I don't think so, especially since it takes less time to multiply two...
> Is this constant time? The answre to that would be quite compiler and CPU dependent. > Is there any way to implement this in constant time? Given a reasonable set of constant time operations (such as additions, logical operations, shifts by constant amounts), yes, however such a construction would likely be ...
I am currently analyzing the communication protocol of HomeKey. Here are two traces between the lock (reader) and the device (card). First set: ``` r2c > 80 80 01 01 6B 5C 02 02 00 87 41 04 34 BC DE 44 04 90 01 8D 24 02 18 2B 80 46 2A D6 25 7D 52 03 64 10 5D 9C 66 5D 20 9A 51 BC 18 DF 23 4A A2 C2 2B 01 2F EC FF ...
Can we recovery public key from DSA signatures as we can from ECDSA?
Can we recover public key from DSA signatures as we can from ECDSA?
I have come across the term "seed" many times and, each time, it confuses me more and more. I think it has a well-known meaning in cryptography, but what is it? From an article I was reading: > They can usually use the limited number of results stemming from a limited number of **seed** values to defeat security...
I would love clarification on the matter. I saw theorems stating that RSA-OAEP (or the similar variant OAEP+) is CCA-secure in the *random oracle model*.\ I wonder about the following: * Is RSA-OAEP (or even OAEP+) CPA-secure in the plain model? If so, what properties does the hash functions need to hold? * Are t...
I saw theorems stating that RSA-OAEP (or the similar variant OAEP+) is CCA-secure in the *random* oracle model. I wonder about the following: * Is RSA-OAEP (or even OAEP+) CPA-secure in the plain model? If so, what properties does the hash functions need to hold? * Are there any lower bounds for the padding leng...
We are given some distinct DSA signatures $(r_i,s_i)$ and the distinct hashes $H_i$ of the corresponding messages. The signatures and messages are non-maliciously made per the same known group parameters $(p,q,g)$ (say the [2048-bit MODP group with 256-bit prime order subgroup of RFC&nbsp;5114][1]), using either one of...
In DSA, can we tell if signatures are for the same key pair?
We are given some distinct [DSA][1] signatures $(r_i,s_i)$ and the distinct hashes $H_i$ of the corresponding messages. The signatures and messages are non-maliciously made per the same known group parameters $(p,q,g)$ (say the [2048-bit MODP group with 256-bit prime order subgroup of RFC&nbsp;5114][2]), using either o...
- Could you clarify where the stack object is typically generated? Is it created on the sender's device or the recipient's device? - If I send funds to a multipay stack that was created on another device currently offline, what would happen? Would the payments defined by the stack be delayed until the offline device...
We know that for each point $P$ on curve $E$ there exists a minimum scalar $k$ such that $kP$ equals the point at infinity. And the book [Cryptography Theory and Practice][1] by Douglas R. Stinson only mentions that adding $P_1=(x,y)$ and $P_2=(x,-y)$ equals point at infinity $O$. But in terms of coordinates, how does ...
In elliptic curve, what does the point at infinity look like?
Given a safe elliptic curve with generator $g_1$. Is there a symmetric function $f:(g_1^a,g_1,a)\leftrightarrow g_2$? random $g_3,g_4$ -> $a$ unknown
Given a safe elliptic curve with generator $g_1$. Is there a function $f:(g_1^a,g_1,a)\leftrightarrow g_2$? For random $g_3,g_4$ -> $a$ unknown
I took a look at the Kyber and Frodo procedures and found that the ciphertext consists of two components. In [Kyber][1] these are the lines 5-7 in algorithm 2 $c := (\mathbf{u},v)$ and in [Frodo][2] line 8 of algorithm 10 $c \leftarrow (C_1,C_2)$. One part of the ciphertext pair contains the message to be encrypted...
I know that compressing data before encrypting it can cause a [compression oracle][1] attack such as in the [CRIME][2] and [BREACH][3] attacks, but if only part of the data is compressed, e.g. non-user controlled and/or non-sensitive data, and the user controlled/sensitive data is not compressed, but they are then encr...
Does compressed expose information about non-compressed data when encrypted together?
Does compressed data expose information about non-compressed data when encrypted together?
According to the ZKP MOOC lecture by Dan Boneh, it is possible to batch proofs from different polynomials and different points into a single group element: [![Slide from ZKP MOOC lecture][1]][1] Nonetheless, I haven't been able to find any protocol that provides this functionality since most of them batch proofs of...
Is it possible to batch ZKP proofs from different polynomials but same point?
> Wouldn't it be sufficient to work with only one, which "hides" the message, that is in Kyber $v$ and in Frodo $C_2$? Actually, they are both taking a similar approach to El Gamal. With El Gamal, you have a generator $g$ and a public key $pub$; to generate a ciphertext for a message $m$, you pick a random value ...
> Wouldn't it be sufficient to work with only one, which "hides" the message, that is in Kyber $v$ and in Frodo $C_2$? Actually, they are both taking a similar approach to El Gamal. With El Gamal, you have a generator $g$ and a public key $pub$; to generate a ciphertext for a message $m$, you pick a random value ...
> Wouldn't it be sufficient to work with only one, which "hides" the message, that is in Kyber $v$ and in Frodo $C_2$? Actually, they are both taking a similar approach to El Gamal. With El Gamal, you have a generator $g$ and a public key $pub$; to generate a ciphertext for a message $m$, you pick a random value ...
I'm trying to implement HMAC SHA256 (I've implemented SHA256 successfully). I am trying to find examples where they show the results after each stage (after the XOR stages etc). I found this: https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-and-Guidelines/documents/examples/HMAC_SHA256.pdf ...
I'm trying to implement HMAC SHA256 (I've implemented SHA256 successfully). I am trying to find examples where they show the results after each stage (XOR, append etc). I found this: https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-and-Guidelines/documents/examples/HMAC_SHA256.pdf But it's...
I'm trying to implement HMAC SHA256 (I've implemented SHA256 successfully). I am trying to find examples where they show the results after each HMAC stage (XOR, append, H etc). I found this: https://csrc.nist.gov/CSRC/media/Projects/Cryptographic-Standards-and-Guidelines/documents/examples/HMAC_SHA256.pdf ...
Do any parallelizable cryptographic hash algorithms which that allow for quick—preferably constant-time—recalculation of a hash result upon updating a portion of the data input exist? I know that BLAKE3 is called "paralallizable", but a Merkle tree doesn't seem like it's what I'm looking for when the time taken to reca...