Questions tagged [rsa]

RSA is a common public key algorithm, which can be used for encryption and signature. It is a core component of most the security protocols used on the Internet, including the SSL/TLS protocol suite.

RSA is a public key cryptography algorithm. It is used in many Internet protocols that use cryptography, including SSL/TLS-based protocols (HTTPS, etc.), IPSEC, DNSSEC, and more. The name RSA comes from its inventors: Rivest, Shamir and Adleman.

RSA Security, Inc. is also the name of a security firm. Among other things, RSA publishes a series of standards related to public-key cryptography known as PKCS. The PKCS#1 standard defines RSA.

RSA can be used for both encryption and signature. It is an asymmetric algorithm. A public key consists of two numbers: the modulus n, which is a large integer and determines the key size (1024 bits, 2048 bits and 4096 bits are common key sizes), and the public exponent e, which can be any odd integer between 3 and n but is often 3 or 65537. A private key consists of n and the private exponent d, which is generally almost as large as n. A private key may contain other fields to speed up computations.

The raw RSA operation is a mathematically simple operation: exponentiation modulo n. The exponent is the private exponent for encryption and signature, and the public exponent for decryption and verification. Only numbers up to n can be encrypted or signed. Therefore, instead of encrypting a whole message for RSA, one usually generates a session key (a symmetric key, for example an AES key) and encrypts this key with RSA. Instead of signing a message with RSA, one usually generates a cryptographic digest of the message (MD5, SHA-1, SHA-2, …) and signs this digest.

The raw RSA operation is not secure. RSA requires a padding scheme. Common padding scheme include OAEP for encryption and PSS for signing, as well as other algorithms defined by PKCS#1.

722 questions
130
votes
4 answers

Is there any particular reason to use Diffie-Hellman over RSA for key exchange?

I often see RSA being recommended as a method of key exchange. However, the Diffie-Hellman key exchange method appears to be secure as well. Is there any considerations one should take into account that would lead to using one algorithm over the…
user10211
118
votes
2 answers

SSH Key: Ed25519 vs RSA

A lot of people recommend using Ed25519 instead of RSA keys for SSH. The introduction page of Ed25519 (http://ed25519.cr.yp.to/) says: [..] breaking it has similar difficulty to breaking [..] RSA with ~3000-bit keys [..] So speaking only of security…
Ben Richard
  • 3,006
  • 5
  • 16
  • 18
97
votes
2 answers

Is it bad that my ed25519 key is so short compared to a RSA key?

I recently generated a new SSH key in the ed25519 format. The public key is only 69 bytes long while my old RSA key is 373 bytes. From my perception ed25519 is the more recent and secure format. So why isn't longer better here?
Alex
  • 1,207
  • 1
  • 10
  • 9
93
votes
4 answers

Will quantum computers render AES obsolete?

This is a spin off from: Use multiple computers for faster brute force Here's at least one source which says that quantum computers are on the way to being able to break RSA in the not too distant future. I am not a security expert, and don't know…
BuvinJ
  • 993
  • 1
  • 7
  • 11
88
votes
3 answers

Why OpenSSH deprecated DSA keys

There was a question RSA vs. DSA for SSH authentication keys asking which key is better. Basically all answers were more in a favour of RSA over DSA but didn't really tell that DSA would be somehow insecure. Now however DSA was deprecated by OpenSSH…
Petr
  • 990
  • 1
  • 7
  • 6
66
votes
4 answers

Can I get a public key from an RSA private key?

As far as I remember you encrypt the message using public key and decrypt it using private key. My question is whether it is possible to get a public key from an RSA private key. For example if I have a key like this: -----BEGIN RSA PRIVATE…
user162408
  • 651
  • 1
  • 5
  • 4
49
votes
4 answers

Why is key exchange necessary at all?

Let's say "Alice" and "Bob" want to communicate with each other over an insecure network. Using Diffie–Hellman key exchange, they can get the same symmetric key at last. However, as I understand, they do not have to get the same symmetric key at…
Firegun
  • 503
  • 4
  • 8
43
votes
2 answers

RSA public key and private key lengths

I'm having a problem understanding the size of an RSA public key and its private key pair. I saw different key sizes for RSA algorithm (512, 1024,... for example), but is this the length of public key or the length of private key or are both equal…
TheGoodUser
  • 799
  • 1
  • 6
  • 13
43
votes
5 answers

RSA maximum bytes to encrypt, comparison to AES in terms of security?

What is the maximum number of bytes for encrypting a plaintext message using RSA that is reasonably secure and also efficient and would AES be better for the same size in bytes? The encryption doesn't have to be public by the way, I'm just wondering…
pandoragami
  • 599
  • 1
  • 6
  • 8
42
votes
3 answers

Which host key algorithm is best to use for SSH?

When you first connect to an SSH server that is not contained inside your known_hosts file your SSH client displays the fingerprint of the public key that the server gave. I found from this question here that as a client you are able to specify…
user4191887
  • 749
  • 1
  • 6
  • 10
41
votes
5 answers

Encryption - should I be using RSA or AES?

My model is one where I have several clients which wish to speak with some (but not all) of the other clients. All messages will be sent through a server. Only the two clients communicating with each other should be able to know the message. So the…
Cheetah
  • 511
  • 1
  • 5
  • 3
36
votes
2 answers

How many qubits are needed to factor 2048-bit RSA keys on a quantum computer?

I've been reading about quantum computing and turns out that 512-bit quantum processors are already a thing. I also read about Shor's algorithm, which can break RSA and several asymmetric encryption schemas in the next upcoming years. Quantum…
Nacib Neme
  • 1,194
  • 2
  • 9
  • 11
36
votes
1 answer

How does OpenSSL generate a big prime number so fast?

In order to generate a 2048 bit RSA key pair, you need to generate two big prime numbers with 1024 bits length. As far as I know, OpenSSL chooses a random 1024 bit number and starts looking for a prime number around it. How can OpenSSL check if the…
user167246
  • 361
  • 3
  • 3
33
votes
2 answers

ssh-keygen: What is the passphrase for?

When using ssh-keygen: What is the passphrase for? Why is it optional? What are the security implications of specifying (or not specifying) one? Below is an excerpt taken from a shell session (some details may have been altered): user@localhost:~$…
voices
  • 1,649
  • 7
  • 22
  • 36
32
votes
1 answer

New PGP key: RSA/RSA or DSA/Elgamal?

I wanted to create a new PGP key using GPG Keychain Access on my Mac. One of the options was to choose keytype: RSA and RSA DSA and Elgamal RSA (Sign only) DSA (Sign only) I found this Superuser question, but it may be outdated. RSA keys seem to…
SPRBRN
  • 7,379
  • 6
  • 33
  • 37
1
2 3
48 49