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. For questions about IBM Rational Software Architect, use the rational-rsa tag.

RSA is a public key cryptography algorithm. It is used in many Internet protocols that use cryptography, including /-based protocols (, etc.), , , 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 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 key) and encrypts this key with RSA. Instead of signing a message with RSA, one usually generates a cryptographic digest of the message (, , , …) 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 .

For IBM Rational Software Architect, use .

6847 questions
1068
votes
16 answers

Calculate RSA key fingerprint

I need to do the SSH key audit for GitHub, but I am not sure how do find my RSA key fingerprint. I originally followed a guide to generate an SSH key on Linux. What is the command I need to enter to find my current RSA key fingerprint?
Zakoff
  • 12,665
  • 5
  • 22
  • 35
901
votes
24 answers

How do I access my SSH public key?

I've just generated my RSA key pair, and I wanted to add that key to GitHub. I tried cd id_rsa.pub and id_rsa.pub, but no luck. How can I access my SSH public key?
sscirrus
  • 55,407
  • 41
  • 135
  • 228
552
votes
10 answers

Use RSA private key to generate public key?

I don't really understand this one: According to https://www.madboa.com/geek/openssl/#key-rsa, you can generate a public key from a private key. openssl genrsa -out mykey.pem 1024 openssl rsa -in mykey.pem -pubout > mykey.pub My initial thinking…
c2h2
  • 11,911
  • 13
  • 48
  • 60
413
votes
12 answers

What is the difference between encrypting and signing in asymmetric encryption?

What is the difference between encrypting some data vs signing some data (using RSA)? Does it simply reverse the role of the public-private keys? For example, I want to use my private key to generate messages so only I can possibly be the…
mmcdole
  • 91,488
  • 60
  • 186
  • 222
257
votes
2 answers

Differences between "BEGIN RSA PRIVATE KEY" and "BEGIN PRIVATE KEY"

Hi I was writing a program that imports private keys from a .pem file and create a private key object to use it later.. the problem I have faced is that some pem files header begin with -----BEGIN PRIVATE KEY----- while others begin…
monim
  • 3,427
  • 3
  • 23
  • 36
211
votes
17 answers

Git error no matching host key type found. Their offer: ssh-rsa

I get the following error when using git: $ git pull Unable to negotiate with 172.16.42.42 port 22: no matching host key type found. Their offer: ssh-rsa fatal: Could not read from remote repository. Please make sure you have the correct access…
Jaroslav Bezděk
  • 6,967
  • 6
  • 29
  • 46
174
votes
3 answers

RSA Public Key format

Where can i find some documentation on the format of an RSA public key? An RSA public key formatted by OpenSSH: ssh-rsa…
Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
154
votes
2 answers

What are the differences between .pem, .cer and .der?

What are the differences between .pem, .cer and .der? As far as I know, .cer contains public key. Are there any open frameworks that I can use to encrypt my data using this public key?
LiangWang
  • 8,038
  • 8
  • 41
  • 54
140
votes
6 answers

How do you use an identity file with rsync?

How do you use an identity file with rsync? This is the syntax I think I should be using with rsync to use an identity file to connect: rsync -avz -e 'ssh -p1234 -i ~/.ssh/1234-identity' \ "/local/dir/" remoteUser@22.33.44.55:"/remote/dir/" But…
cwd
  • 53,018
  • 53
  • 161
  • 198
140
votes
5 answers

Openssh Private Key to RSA Private Key

(I am using MAC) My id_rsa starts with -----BEGIN OPENSSH PRIVATE KEY----- but I expect it to starts with -----BEGIN RSA PRIVATE KEY----- I have send my id_rsa.pub to server administrator to get the access to server, so I don't want to generate a…
Eleanor
  • 2,647
  • 5
  • 18
  • 30
138
votes
5 answers

Load RSA public key from file

I've generated a private key with: openssl genrsa [-out file] –des3 After this I've generated a public key with: openssl rsa –pubout -in private.key [-out file] I want to sign some messages with my private key, and verify some other messages with…
alexey_efimov
  • 1,541
  • 2
  • 12
  • 16
116
votes
5 answers

What is the difference between DSA and RSA?

It appears they are both encryption algorithms that require public and private keys. Why would I pick one versus the other to provide encryption in my client server application?
WilliamKF
  • 41,123
  • 68
  • 193
  • 295
111
votes
3 answers

Algid parse error, not a sequence

When trying to read a RSA private key from a file using the method public PrivateKey getPrivateKey() throws NoSuchAlgorithmException, InvalidKeySpecException, IOException { final InputStream inputStream =…
Glory to Russia
  • 17,289
  • 56
  • 182
  • 325
108
votes
8 answers

What RSA key length should I use for my SSL certificates?

I'm in the process of creating a CSR, and I wonder which is arguably the best length for my RSA key. Of course, 384 is probably too weak, and 16384 is probably too slow. Is there a consensus on the key length one should use, depending on the…
Brann
  • 31,689
  • 32
  • 113
  • 162
107
votes
5 answers

What's the difference between id_rsa.pub and id_dsa.pub?

Is one more secure than the other?
Andrew
  • 1,071
  • 2
  • 8
  • 3
1
2 3
99 100