Closed trogau closed 8 years ago
Have you unlocked the key? Maybe post your code.
On Monday, March 21, 2016, David Harrison notifications@github.com wrote:
I'm trying to do a decrypt of some content but I'm getting an error:
Error: key not found: ["2d79418b3396f4cc"]
This key ID appears to be a subkey of the secret key:
:secret sub key packet: version 4, algo 1, created 1295399867, expires 0 skey[0]: [2048 bits] skey[1]: [17 bits] iter+salt S2K, algo: 9, SHA1 protection, hash: 2, salt: 5937b15e5e22906b protect count: 786432 (152) protect IV: 46 48 b3 07 b8 85 60 d2 9f 01 ff 13 10 c2 2e 2e encrypted stuff follows keyid: 2D79418B3396F4CC
The keyring loads OK (just doing it as per the example on the Decrypt documentation); when I issue a quick hacky "console.log(key.get_all_pgp_key_ids());" to see what IDs are present, it prints:
[ , ]
... so it looks like the key is actually present, but it's just not getting picked correctly as available for decryption by unbox?
I tested the code just with verification on a signed chunk and it worked fine - just as soon as I try to use unbox it breaks. (I've created the encrypted file with gpg v1 on Linux, gpg v2 on Windows and also through kbpgp; GPG can deal with it fine but I get the same error trying to decrypt with kbpgp in all cases.)
Been beating my head against this all day so hoping it's not something obvious I'm missing!
— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/keybase/kbpgp/issues/111
Argh!! Sorry, that was the problem. Missed the unlocking step completely. Thanks!!
I'm trying to do a decrypt of some content but I'm getting an error:
Error: key not found: ["2d79418b3396f4cc"]
This key ID appears to be a subkey of the secret key:
The keyring loads OK (just doing it as per the example on the Decrypt documentation); when I issue a quick hacky "console.log(key.get_all_pgp_key_ids());" to see what IDs are present, it prints:
... so it looks like the key is actually present, but it's just not getting picked correctly as available for decryption by unbox?
I tested the code just with verification on a signed chunk and it worked fine - just as soon as I try to use unbox it breaks. (I've created the encrypted file with gpg v1 on Linux, gpg v2 on Windows and also through kbpgp; GPG can deal with it fine but I get the same error trying to decrypt with kbpgp in all cases.)
I found a few other mentions of this error which suggested passing 'strict: false' to unbox (although it looked like a difference issue); I've tried that to no avail.
Been beating my head against this all day so hoping it's not something obvious I'm missing!
edit: I've created some test code to replicate:
https://github.com/trogau/kbpgptesting
Reproduction:
1) Run 'node test-generate.js' to generate a new key pair
2) Run 'node test-encrypt.js kbpgp-pubkey.txt' to do a test encryption (parameter is the public key generated in step 1)
3) Run 'node test-decrypt.js kbpgp-privkey.txt kbpgp-encrypted-output.txt' (parameters are private key generated in step 1 and encrypted file generated in step 2)
Output I get is: