search for: blobstart

Displaying 2 results from an estimated 2 matches for "blobstart".

2024 Jan 23
2
How to determine which cipher was used to encrypt OpenSSH private keys
...You could use something like the attached python script if you don't want to stare at hexdumps :) -------------- next part -------------- #!/usr/bin/env python3 import sys import base64 BEGIN="-----BEGIN OPENSSH PRIVATE KEY-----\n" END="\n-----END OPENSSH PRIVATE KEY-----" BLOBSTART=b"openssh-key-v1\x00" for f in sys.argv[1:]: d64 = open(f, "rt").read() o = d64.find(BEGIN) if o == -1: raise ValueError("{} missing begin marker".format(f)) d64 = d64[o + len(BEGIN):] o = d64.find(END) if o == -1: raise ValueError("{} missing end marke...
2024 Jan 22
1
How to determine which cipher was used to encrypt OpenSSH private keys
Hi, looking through the key specification, you can see that its the second field in the key file: https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.key#L11 It looks like there is no convenient way to get this information with openssh cli, but given that the file format is just base64 encoded, you can read it out with something like this: $ cat /tmp/rsa | head -n -1 | tail -n +2 |