Sample Header Ad - 728x90

show values of an ed22519 private key stored in OpenSSH format

2 votes
1 answer
6294 views
(note this question uses both 'openssh' and 'openssl' in the text, I am not confusing the two.) If I use openssh to general an RSA keypair (ssh-keygen) then I can use 'openssl rsa -in ...' to view the key parameters (modulus, exponents, primes etc). If I generate an RSA key but store it using the openssh format (using the -o option to ssh-keygen) I cannot directly read that file by openssl. I first use ssh-keygen -p -f and remove the password. The resulting file is an "RSA PRIVATE KEY". Then I can proceed in the usual way with openssl to view the parameters. Using openssl's 'ec' and 'ecparam' commands I can generate files and view the parameters that make up EC keys. If I generate an ed25519 keypair using ssh-keygen -t ed25519 I get a file of the format "OPENSSH PRIVATE KEY". Obviously if I use 'ssh-keygen -p ...' as above on this file I'm never going to get an 'RSA' output because its not an RSA key. So how can I get my "OPENSSH PRIVATE KEY" file generated by ssh-keygen using ed25519 into a format such that I can see the parameters? openssl EC commands produce files such as "BEGIN EC PARAMETERS" and "BEGIN EC PRIVATE KEY". So is there a method to see the ed25519 parameters in the OPENSSH PRIVATE KEY? or a method to turn that file format into one of the EC formats that openssl understands?
Asked by r.l. (101 rep)
Sep 1, 2018, 05:30 AM
Last activity: Jan 26, 2024, 06:56 PM