Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I've created a SSH authentication key (with ssh-keygen) in two different servers, both with a useful comment, but the public key of one server has == between the key and the comment, while the other has no separator at all.

Is this right?

share|improve this question
add comment

1 Answer

up vote 6 down vote accepted

You SSH key is encoded in Base 64. This format is commonly used in cryptography (and beyond) to store binary information in ASCII format.

And, in base64, the '=' sign is a padding character, with a very specific meaning:

The '==' sequence indicates that the last group contained only 1 byte, and '=' indicates that it contained 2 bytes. The example below illustrates how truncating the input of the whole of the above quote changes the output padding

source: http://en.wikipedia.org/wiki/Base64#Padding

In fact, there is no separator between the key and the comment. SSH know that the public key is composed of 3 things:

<key-type>[space]<public-key>[space]<comment>

The presence of a space at the end of the public key is the separator between the key and the comment. The equal '=' sign you are seeing simply indicates a padding at the end of the public key.

share|improve this answer
    
Thank you for your answer. I didn't know that the separators were just blank spaces. –  nozimica Oct 30 '11 at 23:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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