I use putty gen to generate RSA key, I choose length of key is 2048 bit, it generate public key:

ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEA10prz5/FvHX7cx5aowiF+eO8uQuKTYSU0rA0x5yNPD5yTI0HGmEBTnhia4iOhOzwg0BevOZR1SClBpCRTZViym2Z+ohAGt65mWq+2LLhRf3MNpcM6Ttm8IXFxRiVR9iALk9cPsXu6zz4x7RT9vZG7rE1+KbeeSn1gacpCeudsEYCDOrgenH78hNXCLcc6TdKOWnBlASf8coj/T1czUW78S9tcqu7bFrR7N6xfj9M0d8e8oyBOqYrhv3uFmLxvVQ2yxZrJ0ILhAf8KhrflX6SytO5s/K5zTWRkjhwg83V8Qs30LWd79xJgpaUESaWFeS17x6iit8uEjMtPqBGnqLryw== rsa-key-20160620

I don't know why this key is 2048 bits?


The binary base 64 encoded blob contains a modulus which is 257 bytes in size:


The first byte is set to 00 to indicate that it is a positive number. 256 bytes equals 2048 bits, which is the size of the modulus. The modulus in turn defines the key size of RSA.

| improve this answer | |
  • $\begingroup$ Would you like to give me some scripts for demonstration? $\endgroup$ – user2693571 Jun 20 '16 at 10:40
  • $\begingroup$ Sorry, previous comments were about PGP instead of SSH (they use a binary format that has some identical features). I did not use a script for this, I just looked at the binary values. $\endgroup$ – Maarten Bodewes Jun 20 '16 at 12:37
  • $\begingroup$ @dave_thompson_085 I deleted the previous comments about PGP. I was indicating that I was wrong footed and that those should be ignored to the author. Nothing more. Yes of course big endian two complement 8 bit bytes etc etc. $\endgroup$ – Maarten Bodewes Jun 20 '16 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.