43 votes
Accepted

Do these new insights into prime numbers affect encryption security?

No, because these new insights only affect the discovery and patterns regarding finding new prime numbers. In order to break existing encryption algorithms that rely on primes such as RSA, you'd have ...
user avatar
21 votes

Do these new insights into prime numbers affect encryption security?

No, because that "discovery" produces nothing of value. They examined prime numbers up to one billion. In that range, about one in eight numbers ending in 1, 3, 7 or 9 are prime numbers, and which ...
user avatar
  • 1,052
21 votes
Accepted

Can we pick which key is private or public in asymmetric encryption? Do the keys actually encrypt and decrypt a cipher text?

No no no! You don't get to pick which key is private and which public. That false sense of freedom is due to people not understanding that public-key cryptography is conceptually different from ...
user avatar
  • 6,541
12 votes

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

In general, the public and private keys are computed together. For some schemes, the public key is computed from the private key. ElGamal is an example. (The system parameters include a suitable ...
user avatar
  • 4,382
12 votes
Accepted

Are all possible EC private keys valid?

I'll consider that you are using a 256-bit curve per ANS X9.62:2005. Not all 256-bit bitstrings are a formally valid private key; when using big-endian conventions, these must represent a strictly ...
user avatar
  • 122k
10 votes

Can we pick which key is private or public in asymmetric encryption? Do the keys actually encrypt and decrypt a cipher text?

After generating a key-pair can we pick which key will be private or public? No, in general we cannot. For most asymmetric cryptosystems the private and public keys are completely different kinds of ...
user avatar
9 votes

Are all possible EC private keys valid?

There are three ways to look at it: The mathematics. An elliptic curve key pair is defined as $s, s \cdot G$, where $s$ is an integer, $G$ is the base point and $\cdot$ is elliptic curve point ...
user avatar
  • 31.2k
9 votes
Accepted

State of the art RSA key generation

There is consensus that it is safe to use random primes $p$ and $q$ when generating 2048-bit (or wider) RSA public moduli which two prime factors $p$ and $q$ are about half the key size. That is ...
user avatar
  • 122k
9 votes
Accepted

Generating a NIST P-256 private key

A NIST P-256 secret key (for ECDH or ECDSA) represents any scalar modulo $\ell$ for $$\ell = 2^{256} - 432420386565659656852420866394968145599,$$ whereas an X25519 secret key represents an integer ...
user avatar
8 votes
Accepted

Generation of a cyclic group of prime order

One way to do this, if you're working with a multiplicative group $Z^*_p$, is to pick a prime $p$ so that $p-1$ has a large prime factor $q$; once you have this, then to generate a generator of order $...
user avatar
  • 131k
8 votes
Accepted

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

Well, there are indeed differences between the two standards, as you can see below: key pair generation X9.31 requires that $p-1$, $p+1$, $q-1$, $q+1$ all have prime factors between $2^{100}$...
user avatar
  • 131k
8 votes
Accepted

What is “Fast Prime”?

This is a tentative guess at answering my own question. Perhaps the "Fast Prime" method alluded to in the question's citation is that of these two papers (the second polishing the first): [JPV2000]: ...
user avatar
  • 122k
8 votes
Accepted

Is forward secrecy overhyped or necessary?

Since I am at the source of the original quote, I might as well respond... Technically, forward secrecy is overhyped because it is recommended almost everywhere. In some contexts it makes sense and is ...
user avatar
8 votes

Can we pick which key is private or public in asymmetric encryption? Do the keys actually encrypt and decrypt a cipher text?

In RSA encryption and decryption are similar. If you chose e randomly and calculate matching d you could then chose to swap their roles and pick either as the public key. Usually we don't do this, we ...
user avatar
  • 10.4k
7 votes
Accepted

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

It you need a deterministically derived key for AES, the DRBG algorithms of NIST SP 800-90A are suitable, and their output is directly usable as an AES key. An example use case is when computing an ...
user avatar
  • 122k
7 votes

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

The quoted recommendation is generally considered obsolete in the context of RSA with secure parameters, and is either disregarded, or replaced by asking that $\left|p–q\right|>2^{(n/2)–100}$ where ...
user avatar
  • 122k
7 votes
Accepted

Why isn't ElGamal a symmetric-key scheme?

g^x is the public key of Alice and x her private key, while g^y is the public key of Bob and ...
user avatar
7 votes
Accepted

Offline session key agreement protocol

Given the information in the question and in the comments, this is pretty straightforward: Online phase: Use any common key agreement protocol, e.g. Diffie-Hellmann key exchange to generate a shared ...
user avatar
  • 12.3k
7 votes

curve25519 by openSSL

Use the genpkey command: openssl genpkey -algorithm x25519 or, for edwards25519: ...
user avatar
  • 2,744
7 votes
Accepted

Recovery Passphrase Collission for BIP-39 and BIP-44

128-bit entropy simply means that we have $2^{128}$ different values to search, which is similar to 128-bit security. For a single target that is impossible since even the collaborative powers of ...
user avatar
  • 42.9k
6 votes
Accepted

Is there a correct way to generate a symmetric key?

Symmetric keys don't need to be in any particular format -- they're just a sequence of (pseudo)random bits. Most programming environments provide some sort of "secure random" mechanism (a ...
user avatar
  • 2,696
6 votes

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

The reason that one must be derived from the other is that the private and corresponding public key are strongly related: For instance, in RSA, the pair satisfies $ed\equiv 1\mod\varphi(n)$; in Diffie-...
user avatar
  • 10.9k
6 votes

Do these new insights into prime numbers affect encryption security?

Not really - the frequency of primes doesn't change, and it's not a certainty that any given prime isn't followed by another with the same final digit. You'd still have to check all possible primes in ...
user avatar
  • 201
6 votes

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

If you choose $p$ and $q$ at random of the same length, then they will be far away from each other with extraordinarily high probability. Thus, this is not an issue. In the past, there were those ...
user avatar
6 votes

RSA key generation gives d=1

No, your values for $e$ and primes are fine (well, at least for a toy example); $e$ is relatively prime to both $p-1$ and $q-1$, and that's the only hard requirement (not counting the security related ...
user avatar
  • 131k
6 votes

Where do key generation algorithms take the randomness from?

Applications that generate key get the randomness (entropy) from the operating system. The operating system, in turn, gets the randomness where it can find it. Ideally the OS gets randomness from a ...
user avatar
6 votes
Accepted

How to Check Strength of RSA Public Private Key

RSA public/private key pairs are no exception: there is no way to assess that a cryptographic key is strong by looking at its value; only ways to assess that it is weak. And lack of signs that it is ...
user avatar
  • 122k
6 votes

Can we pick which key is private or public in asymmetric encryption? Do the keys actually encrypt and decrypt a cipher text?

The existing answers from DannyNiu and Meir Maor answer well the confusion about whether private and public keys are interchangeable. But it is also worthwhile, I think, to address this snippet from ...
user avatar
5 votes
Accepted

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

No, it's not a problem. What you've found is known as the square computational diffie-hellman problem(SCDH) and it can be shown that this is equivalent to the computational diffie-hellman problem(CDH)...
user avatar
  • 44.5k
5 votes
Accepted

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

Even with perfectly random input, if your final key size is 32 bytes, you cannot have more than 32 bytes of entropy in it. But it seems pretty useless to use key stretching if you already have more ...
user avatar
  • 407

Only top scored, non community-wiki answers of a minimum length are eligible