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

Asks for Passphrase for passphrase free key #118

Open
kenorb opened this issue Aug 10, 2020 · 12 comments
Open

Asks for Passphrase for passphrase free key #118

kenorb opened this issue Aug 10, 2020 · 12 comments

Comments

@kenorb
Copy link

kenorb commented Aug 10, 2020

$  hs-airdrop ~/.ssh/id_rsa hs1q5z7yyk8xrh4quqg3kw498ngy7hnd4sruqyxnxd
Passphrase: 

My private key doesn't have passphrase, but the tool still asks for it.

-----BEGIN OPENSSH PRIVATE KEY-----
...
-----END OPENSSH PRIVATE KEY-----
@pinheadmz
Copy link
Member

What happens if you just leave it blank and hit enter?

@kenorb
Copy link
Author

kenorb commented Aug 10, 2020

What happens if you just leave it blank and hit enter?

$  ./hs-airdrop ~/.ssh/id_rsa hs1q5z7yyk8xrh4quqg3kw498ngy7hnd4sruqyxnxd
Passphrase: <Enter>
Error: Encoding failed.
    at Object.decode (~/GitHub/handshake-org/hs-airdrop/node_modules/bcrypto/lib/native/bech32.js:52:18)
    at parseAddress (~/GitHub/handshake-org/hs-airdrop/bin/hs-airdrop:800:39)
    at parseArgs (~/GitHub/handshake-org/hs-airdrop/bin/hs-airdrop:749:37)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async main (~/GitHub/handshake-org/hs-airdrop/bin/hs-airdrop:755:19)

Same error when I've tried to drop the passphrase from the source code:

-      const passphrase = await readPassphrase();
-      const key = SSHPrivateKey.fromString(str, passphrase);
+      //const passphrase = await readPassphrase();
+      const key = SSHPrivateKey.fromString(str);

@kenorb
Copy link
Author

kenorb commented Aug 10, 2020

Same when testing with new brand key (without passphrase, original master branch code):

$  ssh-keygen -f newkey
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase): (none)
Enter same passphrase again: (none)
Your identification has been saved in newkey.
Your public key has been saved in newkey.pub.
The key fingerprint is:
...

$  ./hs-airdrop newkey hs1q5z7yyk8xrh4quqg3kw498ngy7hnd4sruqyxnxd
Passphrase: 
Error: Encoding failed.

And the same error when generated key with the passphrase (original master branch code):

$  ssh-keygen -t ed25519 -N password -f newkey2
Generating public/private ed25519 key pair.
Your identification has been saved in newkey2.
Your public key has been saved in newkey2.pub.
The key fingerprint is:
...

$  ./hs-airdrop newkey2 hs1q5z7yyk8xrh4quqg3kw498ngy7hnd4sruqyxnxd
Passphrase: password
Error: Encoding failed.

@pinheadmz
Copy link
Member

Ok so this does not look like a password issue, in fact the stack trace indicates an encoding error. I tried to reproduce your steps exactly and it failed the same way -- but it succeeded when I put in my own mainnet HNS address:

$ bin/hs-airdrop newkey hs1qde7jaw6qgzzfu83upn3twvsyhh0zrshg76qe0x
Passphrase: 
Attempting to create proof.
This may take a bit.
Decrypting nonce...
NonceError: Could not find nonce in bucket 27.
    at findNonces (/Users/matthewzipkin/Desktop/work/hs-airdrop/bin/hs-airdrop:275:17)
    at async createKeyProofs (/Users/matthewzipkin/Desktop/work/hs-airdrop/bin/hs-airdrop:328:17)
    at async main (/Users/matthewzipkin/Desktop/work/hs-airdrop/bin/hs-airdrop:761:8)

This means your key was not found in the airdrop tree.
If you registered at handshake.org, use that address.
Usage: $ hs-airdrop [addr]

So then I checked the HNS address you are using. Compare the results with my address:

$ hsd-rpc validateaddress hs1q5z7yyk8xrh4quqg3kw498ngy7hnd4sruqyxnxd
{
  "isvalid": false
}
$ hsd-rpc validateaddress hs1qde7jaw6qgzzfu83upn3twvsyhh0zrshg76qe0x
{
  "isvalid": true,
  "address": "hs1qde7jaw6qgzzfu83upn3twvsyhh0zrshg76qe0x",
  "isscript": false,
  "isspendable": true,
  "witness_version": 0,
  "witness_program": "6e7d2ebb4040849e1e3c0ce2b73204bdde21c2e8"
}

Please double check your wallet address! :-)

@babycodes
Copy link

i have same issues that need Passphrase and shown this when is enter
Error: PEM parse error (unexpected data).
at decode (/home/babycodes/Downloads/hs-airdrop-0.9.0/hs-airdrop/node_modules/bcrypto/lib/encoding/pem.js:349:13)
at decode.next ()
at PEMBlock.fromString (/home/babycodes/Downloads/hs-airdrop-0.9.0/hs-airdrop/node_modules/bcrypto/lib/encoding/pem.js:61:21)
at Function.fromString (/home/babycodes/Downloads/hs-airdrop-0.9.0/hs-airdrop/node_modules/bcrypto/lib/encoding/pem.js:134:23)
at SSHPrivateKey.fromString (/home/babycodes/Downloads/hs-airdrop-0.9.0/hs-airdrop/node_modules/bcrypto/lib/ssh.js:638:28)
at Function.fromString (/home/babycodes/Downloads/hs-airdrop-0.9.0/hs-airdrop/node_modules/bufio/lib/struct.js:159:23)
at readKey (/home/babycodes/Downloads/hs-airdrop-0.9.0/hs-airdrop/bin/hs-airdrop:545:33)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async parseArgs (/home/babycodes/Downloads/hs-airdrop-0.9.0/hs-airdrop/bin/hs-airdrop:729:21)
at async main (/home/babycodes/Downloads/hs-airdrop-0.9.0/hs-airdrop/bin/hs-airdrop:755:19)

@pinheadmz
Copy link
Member

Error: PEM parse error (unexpected data).

This is not a passphrase issue - is your key in PEM format?

@babycodes
Copy link

so how the right format is?

@pinheadmz
Copy link
Member

pinheadmz commented Aug 18, 2020

From https://github.com/handshake-org/hs-airdrop#usage:


  [key-file] can be:

    - An SSH private key file.
    - An exported PGP armor keyring (.asc).
    - An exported PGP raw keyring (.pgp/.gpg).

@babycodes
Copy link

babycodes commented Aug 18, 2020

ok i got it

@babycodes
Copy link

which key?

Attempting to create proof.
This may take a bit.
Decrypting nonce...
NonceError: Could not find nonce in bucket 255.
    at findNonces (/home/babycodes/Downloads/hs-airdrop-0.9.0/hs-airdrop/bin/hs-airdrop:275:17)
    at async createKeyProofs (/home/babycodes/Downloads/hs-airdrop-0.9.0/hs-airdrop/bin/hs-airdrop:328:17)
    at async main (/home/babycodes/Downloads/hs-airdrop-0.9.0/hs-airdrop/bin/hs-airdrop:761:8)

This means your key was not found in the airdrop tree.
If you registered at handshake.org, use that address.
Usage: $ hs-airdrop [addr]

@babycodes
Copy link

i put address from this generated syntax

./bin/hsw-cli account get default | grep receiveAddress
Error: Address is not a faucet or sponsor address.
    at readEntries (/home/babycodes/Downloads/hs-airdrop-0.9.0/hs-airdrop/bin/hs-airdrop:574:11)
    at async parseArgs (/home/babycodes/Downloads/hs-airdrop-0.9.0/hs-airdrop/bin/hs-airdrop:738:25)
    at async main (/home/babycodes/Downloads/hs-airdrop-0.9.0/hs-airdrop/bin/hs-airdrop:755:19)

@pinheadmz
Copy link
Member

This means your key was not found in the airdrop tree.

Are you sure you are using the key that was connected to your github profile in February 2019?

If you registered at handshake.org, use that address.

Did you register at Handshake.org?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants