Stack Exchange Network

Stack Exchange network consists of 174 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.

1
vote
1answer
64 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, ...
0
votes
1answer
56 views

Binary representation of the inverse of a big number [closed]

In one of the first FHE schemes by Gentry, the KeyGen algorithm is defined as follow: For a security parameter $\lambda$, set $N = \lambda ^ 2, P = \lambda ^ 2, Q = \lambda ^ 5$. KeyGen$(\lambda)$: ...
2
votes
0answers
47 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/...
1
vote
0answers
69 views

How to generate a distributed private key?

Shamir's Secret Sharing scheme is really interesting but the pain point is that the secret is generated by one trusted party, then the shares are distributed to other peoples. Is there any scheme ...
2
votes
0answers
25 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
2answers
82 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
2answers
114 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}, ...
0
votes
0answers
34 views

Distributed key generation Algorithms

I am looking for the best algorithm for DKG, since I am not an expert I only know about the famous Joint-Feldman but it looks a bit old. Nowadys there are better solutions? What are the actual "best" ...
0
votes
1answer
180 views

Diffie Hellman vs Three Pass Exchange

Given an insecure channel, what are the pros and cons of using Diffie Hellman to generate a symmetric shared key and then send encrypted data with this key, or simply use Shamir's three-pass protocol ...
3
votes
1answer
741 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 ...
2
votes
0answers
31 views

How is a Private Key Generator (PKG) better than a Certificate Authority (CA) in Mobile Ad-Hoc Networks (MANETs)?

I am doing research in Key Management solutions for a Mobile Ad-Hoc Network (MANET) and from reading papers, I found that traditional certificate-based cryptography (which use CAs for Public Key ...
3
votes
1answer
119 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 ...
4
votes
3answers
321 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 ...
0
votes
2answers
254 views

Algorithm to generate ECDSA keys with random number generator

I have a certified random number generator (TRNG, it does not matter what it is for the question). I would like to use it as a source to generate secp384r1 ECDSA keys. What is the algorithm I should ...
1
vote
1answer
105 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 ...
0
votes
2answers
132 views

Are cryptographies based on bitwise operations considered secure?

I have recently been reading (and writing) a lot off ECC on top of TCP via pythons sockets. I've stubbled across a couple of things mentioning how elliptical curves are more secure with the same key ...
36
votes
1answer
3k 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 ...
0
votes
1answer
170 views

SHA2 Certificate generating (create Signed Certificate) [closed]

i was requested to write a programmer that can generate A SHA2 certificate. So i wrote a tester class to try and mimic Keytool process of generating One (referencing base of this: url https://www....
2
votes
0answers
106 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 ...
0
votes
2answers
401 views

How should one create an ephemeral Diffie-Hellman private key?

When picking an ephemeral Diffie-Hellman private key (little a or little b), can I reasonably just pick 32 random bytes? I am specifically interested in use within SRPv6. RFC5054 says that these ...
5
votes
2answers
3k 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. ...
1
vote
1answer
128 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 ...
0
votes
1answer
1k views

How to Check Strength of RSA Public Private Key

How to measure strength of RSA public private key pair. is it enough to only measure the length of primes used to generate N? how to check that primes p,q used to make N were selected truly randomly ...
1
vote
1answer
89 views

McEliece parameter tuple (n, k, t) through BouncyCastles (m, t, poly) [closed]

I am using BouncyCastles Java API and want to use McEliece encryption. After browsing through various paper for finding good parameters (e.g. How to choose McEliece's parameters?) I am now having the ...
5
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 ...
1
vote
1answer
418 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 ...
0
votes
3answers
182 views

How to combine pepper in random string generation

I am writing a key generator program. Indeed it generates a key in the form of a random text string (not binary), with its characters chosen randomly from a set of defined characters, with a ...
2
votes
0answers
207 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 ...
1
vote
0answers
104 views

Time taken to break cryptographic key

Assume it takes 512 clock cycles to check if a 64 cryptographic bit key is correct. Given a 64 bit plain text and its ciphertext, how long does it take to check all keys using a single core of a 4 GHz ...
0
votes
1answer
68 views

Are there any downsides to key stretching an already high quality entropic key?

For example, if we grab 50 bytes from a high quality source and run them through a key stretching function like Argon2 and have it generate a 32 byte secret for AES. Is there any downside to this? Do ...
4
votes
1answer
104 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 ...
1
vote
1answer
156 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 ...
0
votes
0answers
61 views

Role of samplable probability distribution in keypair generator

Please help me to understand the following definition : Keypair Generator: Let $PK$ and $SK$ sets be such that $PK_{\ell}$ are all disjoint and assume that the parameter $\ell$ can be derived from $...
3
votes
1answer
95 views

Why isn't ElGamal symmentric-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 symmentric-key scheme? Because wikipedia ...
1
vote
1answer
319 views

CP-ABE Key generation random parameters

In the key generation algorithm of cp-abe there are attributes: $x_1, x_2,...x_n \in \{0,1\}^*$ $r, r_{x_1}, r_{x_2},...r_{x_n} \xleftarrow{R} Z_p$ are chosen randomly to generate the private key $...
1
vote
2answers
421 views

Guidelines for cryptographic key generation

I was wondering whether you know can point me to some general (basic) principles/guidelines one should follow for generating cryptographic keys? I have looked at NIST 800-133, but was hoping for some ...
3
votes
2answers
202 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 ...
1
vote
1answer
90 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 ...
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 ...
2
votes
1answer
79 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 ...
3
votes
2answers
83 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 ...
11
votes
2answers
1k 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 ...
53
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 ...
1
vote
1answer
111 views

Building multiple keys from the same input using a KDF [duplicate]

Let's say I have a single secret with high entropy, S, for the entire application. I want to generate keys K1, K2 for 2 ...
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
85 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 ...
0
votes
1answer
154 views

Why is it that in DSA, the order of the subgroup, $q$, is chosen such that it divides $p - 1$?

Consider the DSA key generation: A large prime $p$ is chosen; A smaller modulus $q$ is chosen such that $p - 1$ is a multiple of $q$; A generator $g$ s.t. $\operatorname{ord}_p(g) = q$ is chosen. My ...
4
votes
1answer
428 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 ...
0
votes
0answers
20 views

How to generate a bilinear group of prime order p [duplicate]

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 ...
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 ...