3

I have been given a private key to use in signature. The private key is not very secret, only used locally. The problem is, that I don't know that in which format it is.

It doesn't have separate begin and end rows. It's in one line, base64 encoded, 2284 letters long (longer than regular x.509 that I have seen before). I got it with some other variables as well including:

  • seed
  • id
  • compatibility

In the beginning of the id, there's urn:uuid:, before the key value.

Any clues what it could be?

I tried to use the key with node module xmlCrypto, but got some errors:

Error: error:0D0680A8:asn1 encoding routines:ASN1_CHECK_TLEN:wrong tag

Artjom B.
  • 61,146
  • 24
  • 125
  • 222
Ville Miekk-oja
  • 18,749
  • 32
  • 70
  • 106
  • That lenth is probably RSA. I don't know if xmlCrypto (or your use) knows to de-b64 before ASN.1, but to be sure try `openssl base64 -d -A – dave_thompson_085 Aug 16 '16 at 11:37
  • I would need to convert that key to a pem format. Any clue how I could do it? – Ville Miekk-oja Aug 16 '16 at 12:01
  • Where did you get the file from (ask the one)? Is it used by any software (reverse engineer the loading mechanism)? – Robert Aug 16 '16 at 18:10
  • 1
    *If* the data encoded by the base64 is one of the privatekey formats for which a PEM type is defined (TTBOMK PKCS1, PKCS8, OpenSSH-new, or PGP), you can convert it by breaking the base64 into lines of length 64 and adding BEGIN and END lines with the correct type, and maybe (for PGP) a few other things. But first **you have to know what format it is**. I gave you suggestions for the few easiest ones; try those first. Or post the first 40 chars, which encodes the first 30 bytes which should be enough to identify the likely formats I can think of. – dave_thompson_085 Aug 17 '16 at 01:20

0 Answers0