N. Howey N. Howey - 4 months ago 11
Node.js Question

Generating tor controlport password

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.

Answer

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.