Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sshkey file layout #253

Closed
HansH111 opened this issue Sep 6, 2023 · 1 comment
Closed

sshkey file layout #253

HansH111 opened this issue Sep 6, 2023 · 1 comment
Labels

Comments

@HansH111
Copy link
Contributor

HansH111 commented Sep 6, 2023

Just a question;

I think the private key layout is something like
4 bytes = length data
data = type of key : ssh-rsa or ecdsa-sha2-nistpXXX or ssh-ed25519
depending on type of key repeat until EOF
4 bytes = length data
data

Is this correct ?

I was just looking in the file layout and if I can make a sshkey recognizable that it is encrypted or not.
So you could do that by making an uppercase for the 1st letter of the type of a key and only encrypt the data parts of the file.

@mkj
Copy link
Owner

mkj commented Sep 6, 2023

The private format is the specification's public key format, followed by the private key parameters. So for ed25519 as an example

https://github.com/mkj/dropbear/blob/master/src/ed25519.c#L78

From rfc8709


   string  "ssh-ed25519"
   string  pubkey
   string privkey

I'd be inclined to OpenSSH format for private keys, see #209 (comment)

If extending Dropbear's format otherwise my inclination would be to add a fixed identifer at the start (and a version field!), then encrypt the current key as-is after that.

@mkj mkj added the question label Sep 24, 2023
@mkj mkj closed this as completed Sep 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants