Re: [tor-dev] New python Tor client implementation
Thanks James, this is awesome! Very well done. Out of curiosity why sidestep any use of Stem? It supports encoding/decoding most tor cell types... Yours: https://github.com/torpyorg/torpy/blob/master/torpy/cells.py Mine: https://gitweb.torproject.org/stem.git/tree/stem/client/cell.py If you'd care to integrate any of this functionality into Stem I'd be delighted to work with you. Cheers! -Damian On Thu, Oct 17, 2019 at 7:05 AM James Brown wrote: > > Hello all, > > Recently I finished a pure python implementation of the Tor client. It's > called torpy (https://github.com/torpyorg/torpy). > > It offers handy API, supports v2 hidden services with "basic" and "stealth" > authorization protocol. Works with python 3.6+. > It has no dependencies on the original C Tor client and Stem. For more > information please take a look at README on github. > > Here is a quick example of how to use the library: > ```python > from torpy import TorClient > > hostname = 'ifconfig.me' # or onion-services as well, for example > 'http://facebookcorewwwi.onion' > tor = TorClient() > > # Choose random guard node and create 3-hops circuit > with tor.create_circuit(3) as circuit: ># Create tor stream to host >with circuit.create_stream((hostname, 80)) as stream: ># Now we can communicate with host >stream.send(b'GET / HTTP/1.0\r\nHost: %s\r\n\r\n' % hostname.encode()) >recv = stream.recv(1024) > ``` > > Please list torpy project at > https://trac.torproject.org/projects/tor/wiki/doc/ListOfTorImplementations > > It would be nice if you try the client. I look forward to any feedback. > > Cheers. > > > ___ > tor-dev mailing list > tor-dev@lists.torproject.org > https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev ___ tor-dev mailing list tor-dev@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev
Re: [tor-dev] HSv3 descriptor work in stem
Thanks George! Yup, work on that branch is in progress: https://gitweb.torproject.org/user/atagar/stem.git/log/?h=hsv3 On Thu, Oct 17, 2019 at 8:01 AM George Kadianakis wrote: > > Damian Johnson writes: > > >>Can I use `_descriptor_content()` to do that? Or should I call > >>`_descriptor_content()` to generate the whole thing _without_ the > >>sig, and then do the signature computation on its result and > >>concatenate it after? > > > > Hi George. Yup, to create a signed descriptor we create the bulk of > > the content then append the signature. Server and extrainfo > > descriptors already do this so I suspect you can do something > > similar... > > > > https://gitweb.torproject.org/stem.git/tree/stem/descriptor/server_descriptor.py#n902 > > https://gitweb.torproject.org/stem.git/tree/stem/descriptor/__init__.py#n1388 > > > > Will this do the trick? > > > > PS. Sorry about the duplicate. Hit reply rather than reply-all > > forgetting that you included the list. > > Thanks for the reply Damian! That was super useful! > > The current state of affairs can be found here: > https://trac.torproject.org/projects/tor/ticket/31823#comment:1 > (just in case you didn't check IRC that day) > > peace ___ tor-dev mailing list tor-dev@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev
Re: [tor-dev] HSv3 descriptor work in stem
Damian Johnson writes: >>Can I use `_descriptor_content()` to do that? Or should I call >>`_descriptor_content()` to generate the whole thing _without_ the >>sig, and then do the signature computation on its result and >>concatenate it after? > > Hi George. Yup, to create a signed descriptor we create the bulk of > the content then append the signature. Server and extrainfo > descriptors already do this so I suspect you can do something > similar... > > https://gitweb.torproject.org/stem.git/tree/stem/descriptor/server_descriptor.py#n902 > https://gitweb.torproject.org/stem.git/tree/stem/descriptor/__init__.py#n1388 > > Will this do the trick? > > PS. Sorry about the duplicate. Hit reply rather than reply-all > forgetting that you included the list. Thanks for the reply Damian! That was super useful! The current state of affairs can be found here: https://trac.torproject.org/projects/tor/ticket/31823#comment:1 (just in case you didn't check IRC that day) peace ___ tor-dev mailing list tor-dev@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev
[tor-dev] New python Tor client implementation
Hello all, Recently I finished a pure python implementation of the Tor client. It's called torpy (https://github.com/torpyorg/torpy). It offers handy API, supports v2 hidden services with "basic" and "stealth" authorization protocol. Works with python 3.6+.It has no dependencies on the original C Tor client and Stem. For more information please take a look at README on github. Here is a quick example of how to use the library:```pythonfrom torpy import TorClient hostname = 'ifconfig.me' # or onion-services as well, for example 'http://facebookcorewwwi.onion'tor = TorClient() # Choose random guard node and create 3-hops circuitwith tor.create_circuit(3) as circuit: # Create tor stream to host with circuit.create_stream((hostname, 80)) as stream: # Now we can communicate with host stream.send(b'GET / HTTP/1.0\r\nHost: %s\r\n\r\n' % hostname.encode()) recv = stream.recv(1024)``` Please list torpy project at https://trac.torproject.org/projects/tor/wiki/doc/ListOfTorImplementations It would be nice if you try the client. I look forward to any feedback. Cheers. ___ tor-dev mailing list tor-dev@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev