Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs
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 ...
Herringbone Cat's 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 ...
gnasher729's user avatar
  • 1,256
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?

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 ciphers, and ...
DannyNiu's user avatar
  • 9,409
12 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 ...
Ilmari Karonen's user avatar
10 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 ...
fgrieu's user avatar
  • 142k
10 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} - 2^{224} + 2^{192} - 89188191075325690597107910205041859247,$$ whereas an X25519 secret key ...
Squeamish Ossifrage's user avatar
9 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 ...
A. Hersean's user avatar
9 votes
Accepted

What is better source of random bytes: Yubikey or /dev/random (or both)?

You should typically use the OS CSPRNG, which would be /dev/urandom or /dev/random. The reason is that the OS CSPRNG is ...
bk2204's user avatar
  • 3,466
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}$...
poncho's user avatar
  • 148k
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]: ...
fgrieu's user avatar
  • 142k
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 ...
Thomas Pornin's user avatar
8 votes

curve25519 by openSSL

Use the genpkey command: openssl genpkey -algorithm x25519 or, for edwards25519: ...
Frank Denis's user avatar
  • 2,973
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 ...
Meir Maor's user avatar
  • 11.8k
8 votes
Accepted

RSA key generation with large random numbers and no primality testing

There are two main issues with the proposal after we add that the two generated integers are odd1 We can't compute the private key for a public key that we generate, for this requires the full ...
fgrieu's user avatar
  • 142k
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 ...
tylo's user avatar
  • 12.7k
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 ...
kelalaka's user avatar
  • 48.7k
7 votes
Accepted

RSA with 3e≡1 (mod p−1) and 5e≡1 (mod q−1)

This is a very bad idea. Given a ciphertext-plaintext pair $c,m$ I compute $\mathrm{GCD}(c^3-m, N)=p$. Keeping small but secret $d_p$ and $d_q$, they'd still need to be too large to exhaust over. For ...
Daniel S's user avatar
  • 23.9k
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 ...
Yehuda Lindell's user avatar
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 ...
Matthew's user avatar
  • 201
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 ...
poncho's user avatar
  • 148k
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 ...
fgrieu's user avatar
  • 142k
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 ...
Gilles 'SO- stop being evil''s user avatar
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 ...
Daniel Wagner's user avatar
6 votes
Accepted

Generating suitable prime numbers for Paillier key pair in GG18

The difference between $2^{1024}$ and $q^4$ is over 898-bits, which leaves more than enough diversity for choosing prime numbers and protection from Fermat factoring. Simply choose a random $898$-bit ...
Daniel S's user avatar
  • 23.9k
6 votes

Key generation from partially random data

The standardised way to obtain such a key is leveraging the Left Over Hash lemma. In short it says that if you use say MD5 to hash 256 bits of entropy, you'll get a NIST approved 128 bit key with a ...
Paul Uszak's user avatar
  • 15.5k
5 votes

Why are ephemeral/session/temporary keys useful?

Why else are ephemeral keys used? Ephemeral keys are not a specific form of keys, they are just short lived keys within a key establishment protocol. Usually they are not directly trusted as they are ...
Maarten Bodewes's user avatar
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 ...
Dillinur's user avatar
  • 407
5 votes
Accepted

What is proper use of a True Random Number Generator?

I assume your TRNG has a uniform distribution and can generate all possible 32bit numbers (ie. isn't limited to a specific smaller number range, just to [0,2^32-1]). In this case, it doesn't really ...
kd903oimsdklf's user avatar
5 votes
Accepted

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

Is it mainly for validation purpose to ensure that the input key size is correct. So, for e.g. if algorithm is AES, the key length has to be 128, 256 or 192. Yes, indicating a name to an algorithm ...
Maarten Bodewes's user avatar
5 votes

AES Key vs RSA Key

AES is a symmetric key algorithm, which means there is just one key, used both to encrypt and decrypt. This is different from RSA, where you have two keys - a private one and a public one, related in ...
meshcollider's user avatar
  • 1,573

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