Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [key-generation]

Key generation is the process of generating keys for cryptographic purposes.

54
votes
3answers
1k views

Do these new insights into prime numbers affect encryption security?

Quanta Magazine reports: Two mathematicians have uncovered a simple, previously unnoticed property of prime numbers [...]. Prime numbers, it seems, have decided preferences about the final digits ...
38
votes
1answer
4k views

What is “Fast Prime”?

In this note, the manufacturer of a RSA key generation gizmo vulnerable to the new ROCA attack (see second section) explains that it is common practice to employ acceleration algorithms in order to ...
11
votes
2answers
2k views

Should RSA primes p and q differ in length by “a few digits”?

When generating RSA keys in the original RSA paper it is stated: to gain additional protection against sophisticated factoring algorithms, p and q should differ in length by a few digits Why is ...
9
votes
2answers
3k views

Are all possible EC private keys valid?

I usually generate a key pair using OpenSSL or Bouncy Castle. I'm using curve secp256k1. The 256bit private keys look fairly random. Do all values of "private ...
9
votes
2answers
1k views

State of the art RSA key generation

I would like to know if there is an algorithm to generate a RSA key at the state of the art of the present cryptanalysis. Beside the key lenght I know there are some weakness in the choice of prime ...
6
votes
2answers
1k views

Where do key generation algorithms take the randomness from?

I was just wondering, because in many encryption tools like Veracrypt or GnuPG you have to generate pseudo randomness with your mouse movement. So, where do automatically generated keys take that ...
6
votes
1answer
1k views

What are the differences between X9.31 RSA operation and PKCS#1 RSA operation?

NIST and other - mainly older - standards often don't just mention PKCS#1 RSA algorithms but also X9.31 RSA algorithms. What are the differences between X9.31 and PKCS#1 (v2.1) with regards to key ...
5
votes
5answers
9k views

Why is the private key generated first in public key crypto?

I'm still new to public key crypto. I'm trying to understand how it is that the private key is generated first in public key crypto? I would have expected the private and public key to be generated at ...
5
votes
2answers
4k views

Why are ephemeral/session/temporary keys useful?

One reason that communication protocols use ephemeral keys is to help with implementing Perfect Forward Security. They're also used in SSL to go from using RSA to using a faster symmetric encryption. ...
5
votes
1answer
170 views

Parameter choice Supersingular Isogeny DH

In “Towards quantum-resistant cryptosystems from supersingular elliptic curve isogenies” by DeFeo, Jao and Plut (PDF), the public parameters are defined as: Supersingular curve $E$, and bases $P, Q$ ...
4
votes
3answers
449 views

What is proper use of a True Random Number Generator?

Let's say I have a true random number generator TRNG. Random numbers are generated on demand from a HW-entropy source, resulting in a 32-bit random value each time it is called. I have to fill an ...
4
votes
1answer
205 views

Is forward secrecy overhyped or necessary?

Forward Secrecy, also perfect forward secrecy, gives assurance about session keys even the private key is compromised. This is achieved by generating a random key per session without using a ...
4
votes
1answer
9k views

Is there a correct way to generate a symmetric key?

Looking in some cryptographic algorithms, I've realized that: The way the plain text is encrypted/decrypted is always specified, but what about the key? Every paper I've seen describing the algorithm ...
4
votes
1answer
105 views

Is there an asymmetric scheme where keys form a graph and a message can only be decrypted across a certain degree of separation?

Consider a network of trust, where each user u specifies some other set of users whom u "trusts". This forms a graph with users ...
4
votes
1answer
480 views

How to generate a bilinear group of prime order p for key generation

I am trying to implement an IEEE Paper In Cryptography. I read many reference regarding an RSA key generation. But i am confused with above statement. Please someone explain me What it says with ...
3
votes
3answers
8k views

RSA Key generation: How is multiplicative inverse computed?

As per Wikipedia, RSA keygen goes like this: Choose two distinct prime numbers p and q. Compute $n = pq$. Compute $\varphi(n) = (p − 1)(q − 1)$. Choose an integer e such that $1 < e < \varphi(n)...
3
votes
1answer
157 views

Why isn't ElGamal a symmetric-key scheme?

I was asked about this question by a friend. He considers that Alice and Bob share a secret key s=g^(xy). So why isn't it considered a symmentric-key scheme? ...
3
votes
2answers
229 views

Generating DH key with specific bit-length

In PKCS#3 the generation for DH secrets mandates to generate them with a minimum size if length is specified: The central authority may optionally select an integer $\ell$, the private-value ...
3
votes
1answer
1k views

Generating a NIST P-256 private key

From the Curve25519 spec I learned that it possible to take a random 32 bytes and with a few operations make it on the curve: To generate a 32-byte Curve25519 secret key, start by generating 32 ...
3
votes
2answers
84 views

How do I pick variable length passwords uniformly at random?

How do I pick passwords uniformly at random when given a min and max length? It seems that if I first pick a random length, then choose random characters, this procedure will choose shorter length ...
3
votes
1answer
599 views

Can I use an ECDH Shared Secret from the same Private / Public Key Pair?

I'd like to know if using the ECDH shared secret of a static EC Private Key with it's own corresponding static EC Public Key causes a problem / weakness. (edit) not asking if it's ok to re-use the ...
3
votes
1answer
138 views

Safety of encrypting a plaintext with its hash as the key

What are the safety issues of using the the hash of plaintext as the key to encrypt it? The first that comes to mind is that if I can guess an approximation or part of the plain text, brute force ...
3
votes
1answer
241 views

Number generation for Fujisaki-Okamoto commitment scheme parameters

I need to implement the Fujisaki-Okamoto commitment scheme for a project such that I can demonstrate performance of various zero-knowledge proofs in relation to one another, for example Boudot's "...
3
votes
1answer
1k views

RSA public key exponent generation confusion

Quote from Wiki: $e$ having a short bit-length and small Hamming weight results in more efficient encryption — most commonly $2^{16} + 1 = 65537$. However, much smaller values of $e$ (such as $3$) ...
3
votes
1answer
2k views

RSA key pair generation and FIPS 140-2, 186-4

I need to securely generate RSA key pair and I need to have access to private exponent in order to process it further. What's the difference in FIPS 140-2 and FIPS 186-4 in connection with RSA key ...
2
votes
2answers
92 views

Multiparty secret generation protocol

The goal is to create a secret S on a trusted server by having users A, B and C each send a private seed to the server, in such a way that any 2 of them can later recover S by resubmitting their ...
2
votes
1answer
76 views

Generating a key pair using a signature generated by an existing key

I’ve built an app in which each user has a private/public key pair and I want to generate a second one for them, however I cannot store the second private key anywhere. What would be the drawbacks ...
2
votes
2answers
134 views

Can the key-generation algorithm always be uniform?

Assume that the encryption uses $n$-bit keys to encrypt $l(n)$-length messages. If a symmetric key encryption scheme is defined as $\Pi_{1} = ( \mathrm{Enc}, \mathrm{Dec} )$, then for every $x_{0}, ...
2
votes
1answer
109 views

Key derivation design to avoid key leaks

I have the first function that generates keys from AES decryption (128-bit key). It takes seed as input: ...
2
votes
1answer
352 views

How exactly is the output of the XOR step in PBKDF2 used?

I'm attempting to diagram PBKDF2 for a school project and I'm not 100% sure how to represent the XOR step. Specifically, I'm confused as to whether the output of the XOR step is used in subsequent ...
2
votes
1answer
93 views

Finding $f^{-1}$ in the YASHE keygen algorithm

In the YASHE (Yet Another Somewhat Homomorphic Encryption) algorithm, the beggining of the key generation step specifies: Sample $\ f',g ← χ_{key}$ and let $\ f = [tf' + 1]_q$. If $\ f$ is not ...
2
votes
2answers
1k views

Obtaining Diffie-Hellman generator

In the Wikipedia article on Diffie-Hellman, the algorithm calls for a large prime modulus, $p$, and a generator, $g$, which is a primitive root of $p$. As far as my knowledge of number theory goes, ...
2
votes
1answer
86 views

Which algorithm would be ideal for ephermal key generation followed by DH key exchange?

Bob and Alice, both generate a temporary public key pair each using X algorithm on their individual PC. After being authenticated by a third party, they use the DHE to come to get a common symmetric ...
2
votes
0answers
61 views

Distributed key generation (for discrete-log based cryptosystems) with fake shares

Under the definition of Gennaro et al (link), a DKG protocol needs to satisfy “correctness” and “secrecy”. Correctness is divided into three sub-properties: C1. All subsets of $t+1$ shares provided ...
2
votes
0answers
56 views

General Private/Public key generation

I wanted to get an idea on how the whole cold-storage private/public key generation works for different cryptocurrencies. So I was playing around with BIP32 deriviation path on: https://iancoleman.io/...
2
votes
0answers
26 views

What are SNFS-safe limits for an RSA moduli optimized for simple modular reduction?

I consider $n$-bit RSA moduli $N$ having high-order bits starting by with $k$ bits at 1, then $k$ bits at 0, then $m-2k$ bits at ...
2
votes
0answers
111 views

RSA - find d,e with restrictions

For academic purposes, assuming $n, p, q$ with $n\approx 2^{4096}$ and $p,q\approx 2^{2048}$. I need to find ($e,d$) such that: $e$ is smaller than $2^{64}$ $d\approx 2^{4096}$ and will have as ...
2
votes
0answers
236 views

Rijndael - is there some difference in resistance between counter in generator input and in IV?

I am thinking about Rijndael implementation in order to store tokens (cannot be hashed) - one token for one user. And finally I get stuck with key/IV generation problem :( The questions are: 1) Is ...
2
votes
0answers
35 views

Are there UFDs where the factorization problem is difficult but finding irreducibles is cheap?

Factorization of integers is hard, but finding irreducibles is expensive. Is there a ring where factorization is assumed hard but finding irreducibles is much cheaper than over $\Bbb Z$? It could ...
2
votes
0answers
356 views

Proper way to generate symmetric keys [duplicate]

I'm trying to educate my self in key management, how to store them, how to generate them, how to use them properly. I've been trying to find how you would generate a key for symmetric encryption (say ...
1
vote
2answers
598 views

Can I use the output from a DRBG directly as K for AES, or do I need to use a key generator algorithm?

NIST has 3 validated "Recommendation for Random Number Generation Using Deterministic Random Bit Generators" (DRBG's) that are based on NIST SP 800-90A: Hash_DRBG (based on hash functions) ...
1
vote
2answers
214 views

Generate PGP keys very very fast

Is there a way to generate thousands of PGP keys at a very very fast rate? I am generating thousands of 3072-bit PGP keys looking like part of a personal research project. Obviously, this is a very ...
1
vote
1answer
102 views

RSA key generation gives d=1

I was reviewing RSA by hand. I picked 53 and 59 as my primes. For e I picked 5. When I solved for d using extended euclid, I got 1 which obviously doesn't decrypt anything. I checked my answers online ...
1
vote
1answer
68 views

Why do general encryption key generators also take the algorithm as input?

To my understanding the key generation logic only needs a source of randomness and the length of the key to be generated as input. However, we still provide the algorithm (names) like AES, DES, ...
1
vote
1answer
157 views

Offline session key agreement protocol

Is there any implemented solution to agree on a session key in offline way. I can exchange some keys before being offline but I need both sides to create the session key offline. I need implemented ...
1
vote
1answer
200 views

securing the keystore

When generating a public-private key pair you have the option to secure the keystore with a password. where is that password stored, is it a hashed version that is stored and if that is so which ...
1
vote
4answers
442 views

How is an epsilon of 1/1000 non-negligible?

Lately I've been studying cryptography and in the current course I'm taking we're reviewing statistical tests and how they can be used to determine if a pseudo-random generator is secure or not. ...
1
vote
1answer
583 views

Find inverse in RSA

I've been reading on RSA for a while but there's something I still can't understand. When generating the key: once you find n = pq and φ(n), you choose a number d coprime with φ(n) and then you need ...
1
vote
1answer
264 views

How to determine the exponent when using RSA

Can someone please explain to me how, when using RSA, to determine the exponent to be used in encryption and decryption? I have attempted a worked example on using RSA (shown below) but I can't ever ...
1
vote
1answer
130 views

Key expansion for cryptographic keys

I have seen some applications use key expansion when deriving AES-keys. E.g. the application will generate some random data (e.g. 128bits), then use PBKDF2 to expand it into 512bits (2x256 keys). Why ...