2

I am using the tor-request node module and am having problems. I have followed all steps and directions I could find, Ive searched every site online and I've restarted my computer. I cant finish my project and really am struggling. I keep getting Double Quote Error. Id appreciate any help.

//started tor

tor &

I generated the password with tor --hash-password "myPasswordHere" | tail -n 1

//I also tried
tor --hash-password myPasswordHereWithOutQuotes

//torr file

ControlPort 9051

HashedControlPassword 16:7{{numbers that ^^ returned}}786C1

//index.js / tor-request

var TorControlPort = {
  password: "myPasswordHere", 
  host: 'localhost',
  port: 9051,
  ...

ERROR Uncaught Error: Error communicating with Tor ControlPort 551 Invalid quoted string. You need to put the password in double quotes.

N. Howey
  • 119
  • 7

2 Answers2

2

This looks like a bug in the library.

I checked out the source here and it doesn't look like the library is quoting the password as it should.

Relevant code:

var commands = [
  'authenticate '+ password +'', // authenticate the connection

As you can see the password is not quoted.

A temporary workaround you should be able to use would be to convert your ascii password to hex which Tor will allow without quotes. e.g password = 70617373776f7264.

drew010
  • 68,777
  • 11
  • 134
  • 162
  • Thank you, For anyone who this may help. I used this to convert password. This solved the quote error but caused another with verifying new tor session. http://www.dirtymonday.net/key_convert.html – N. Howey Jul 21 '16 at 06:10
  • I filed a bug report on github with the developer so we'll see what they have to say. Glad that worked for the initial problem at least. – drew010 Jul 21 '16 at 06:34
1

drew010 is correct. I've responded to the github issue and pushed a fix and updated the README to be more helpful.

Sadly I can't upvote or comment on drew010's reply since I don't have required reputation.

[EDIT]: (I'm the author of the tor-request module)

talmobi
  • 111
  • 2
  • 5