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.

743 questions
32
votes
1 answer

What are the odds of an RSA private key collision?

Given the various lengths of RSA key pairs (1024, 2048, 4096) what are the odds of two users having generated the exact same private key?
Naftuli Kay
  • 6,763
  • 11
  • 49
  • 78
29
votes
1 answer

What is RSA OAEP & RSA PSS in simple terms

After googling or youtubing, i still cant find any information on RSA OAEP & RSA PSS. Can someone explain it in simple terms to me? I understand RSA is public key and private key. Why is there so many variant like OAEP and PSS?
Killney
  • 403
  • 1
  • 4
  • 5
11
votes
3 answers

How long is a 2048-bit RSA key?

On stackoverflow: '2048 bits, or 1400 decimal digits' https://stackoverflow.com/questions/11832022/why-are-large-prime-numbers-used-in-rsa-encryption On Wikipedia: 'RSA-2048 has 617 decimal digits (2,048…
user27296
  • 191
  • 1
  • 1
  • 7
9
votes
1 answer

Is the standard scheme of RSA CCA and CPA secure?

I'm looking through old tests in an information security course - and there's a question about CCA and CPA security of RSA. I can't seem to grasp how I'd either show insecurity or prove the security for this. (This is not a homework question, it is…
Arnon
  • 208
  • 2
  • 5
5
votes
2 answers

Secret, Public, and Private Keys?

...and nonces. Can someone show an example of how this actually works using small intelligible numbers? For example: secret key: "100" public key: "10" private key: "1000" I am just trying to better understand the concept of "signing" and how…
Ronnie Royston
  • 219
  • 1
  • 3
  • 9
5
votes
1 answer

Most popular RSA key format

We are trying to decide on which RSA key format our application should use. The ideal format would be widely used and supported in most of the popular platforms/frameworks. This would make it easy for 3rd parties to integrate with our system. So…
SoftwareFactor
  • 151
  • 1
  • 3
4
votes
3 answers

When generating a 4096 bit RSA key pair, do both the private and the public key always have exactly 4096 bits?

When generating a 4096 bit RSA key pair, do both the private and the public key always have exactly 4096 bits, thus do not start with a 0 in binary representation?
Ben Richard
  • 3,646
  • 5
  • 19
  • 18
4
votes
1 answer

Choose your own exponents in RSA?

In another interesting post, one of the developers/security researchers behind Phuctor suggests that using different exponents with RSA keys will "[increase] the costs of attacking your setup astronomically." While the author does state that "it is…
Naftuli Kay
  • 6,763
  • 11
  • 49
  • 78
4
votes
1 answer

Why not just pad RSA with random bytes

So, i understand that we should always use padding on RSA so that if we send the same message with different keys, the Chinese Remainder theorem can not be used to decrypt it. When looking at the padding schemes (OAEP) I do not get however why to…
Joran
  • 41
  • 1
3
votes
1 answer

Why is it difficult to break RSA?

Given that an attacker only knows the public key and cipher text, why is it difficult to decrpyt the message ? If the knows the N value will he be able to decrypt it ?
Cemre
  • 315
  • 1
  • 5
  • 9
3
votes
0 answers

Naked RSA decryption

I'm working with some legacy code that uses naked RSA encryption with variable length packets. I've only found example code on how to handle this when the length of the packet is the correct length for the key, but nothing if, say, the data is…
user189325
  • 31
  • 2
2
votes
1 answer

RSA private/public keys

Is it possible to recover a private key, given a public key and a substring/a part of the corresponding private key?
Evgeny
  • 185
  • 3
2
votes
0 answers

How to import key BLOB generated from Microsoft CryptExportKey from Linux

I have a private/public key pair saved as key BLOBs which were in fact exported with the Microsoft "CryptExportKey" API. Now I need to use the same key pair (specially the public key) under Linux environment. Is there anyway to import the public key…
McGayan
  • 21
  • 1
2
votes
1 answer

Why does an RSA key (256 bits) have more than 256 bits of ascii characters?

As an example, I generated a 256 bit key pair. The private key (when saved to a file by puttygen) is: AAAAIGZcM73lV3Uk/psErZAYA0F+4xK78FtFoVi2fdypv92tAAAAEQDdOhyFJ6iV FSKDgjpj8+bRAAAAEQC2nAZD6DurGlj+DlPuB7tNAAAAEQCbHQFLFNR/URs4eu0o ZfPE This is 132…
perpetual
  • 123
  • 3
2
votes
1 answer

RSA Possible Vulnerability?

Given c1 = cipher text of m encrypted with n1 and e Given c2 = cipher text of the same m encrypted with n2 and the same e, Is it possible to figure out either of the n's or m? I can't seem to solve for it myself, but I know that doesn't mean it…
1
2 3