• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

cretz/tor-dht-poc: Anonymous DHT Accessible from Executable or Tor-Enabled Brows ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

cretz/tor-dht-poc

开源软件地址:

https://github.com/cretz/tor-dht-poc

开源编程语言:

Go 83.0%

开源软件介绍:

Tor DHT PoC

This is a proof of concept to show that we can advertise onion services in Go and discover them in Go or JS.

Goals

  • In Go, all network interaction over Tor
    • Use existing tested DHT code (e.g. BT mainline or IPFS)
    • Broadcast different onion addresses for a key
    • Discover different onion addresses for a key
  • In browser (all network interaction doesn't have to be in Tor since it will run in Tor Browser, so no WebRTC)
    • Use existing tested DHT code (e.g. BT mainline or IPFS)
    • Discover different onion addresses for a key

Probably choosing IPFS here due to WebTorrent's requirement on WebRTC which Tor Browser doesn't implement.

Results

Usage Quick Overview

Ok, so now that we have success in both places, we can show a quick overview of how to use it. This assumes that GOPATH is set with this repo properly checked out in it and that latest stable versions of Go, Tor, and nodejs/npm are installed and on the PATH.

In this test, we create 5 nodes, say that 2 of them provide a certain type of service, and in both the Tor browser and Go command line, we determine those 2 from the DHT starting with any of the 5 addresses. All over Tor and anonymous.

First, provide the 5 nodes. Build and run the executable to create the DHT and "provide" the services:

go build && go-tor-dht-poc provide

This will take a sec to build the DHT. The output (sans some Tor warnings):

2018/07/10 16:54:32 Created peer #1: gvumv3dlefinroaeibjlrsknedmpd73stlqey4552boeqqfrcktkdvqd:52516/QmRdDcR647RjC7UkdZXiodAQoXQuqjiiR9wXas4RBhw71x
2018/07/10 16:54:49 Created peer #2: vn5sgarqtdmzl27cnbrsfchkmrwm5erjb6jtmcwqras6qmhpmf6mahqd:52519/QmY9tHQMGUVg7xBnLiKGN81J9DCrns5KS4jK8wn8CwqHym
2018/07/10 16:55:11 Created peer #3: my4f2m3yggnnpoeacjgwie5gc5yxeshzgvu5eukx7lodwgmwf2ek52yd:52523/QmRLFFGsVv6uq1WbHhZjA2gknRUwQTyLGdiTAs344egWp8
2018/07/10 16:55:25 Created peer #4: q2fdsiu7eyoj42iii5o44rnrhxncnljexu6zncw44bpdk3udoveyi6ad:52528/QmNQanzjr862heY5ndTuMQPhbEa8GfyniVk6dhkoGXb5MS
2018/07/10 16:55:35 Created peer #5: lhcaimk5pvkj2p3ewcdrunryout2wgpjasfum45rochkxwi2y4raauyd:52535/QmSMd8DytSqkAJunHfbG4phedaDs3ugmGFMZY3e3UyePJG
2018/07/10 16:55:35 Providing key on the first one (gvumv3dlefinroaeibjlrsknedmpd73stlqey4552boeqqfrcktkdvqd:52516/QmRdDcR647RjC7UkdZXiodAQoXQuqjiiR9wXas4RBhw71x)
2018/07/10 16:55:37 Providing key on the last one (lhcaimk5pvkj2p3ewcdrunryout2wgpjasfum45rochkxwi2y4raauyd:52535/QmSMd8DytSqkAJunHfbG4phedaDs3ugmGFMZY3e3UyePJG)
2018/07/10 16:55:42 Press enter to quit...

So the 5 nodes were created and we are marking #1 and #5 as "providers". Now, we can connect to this DHT through any of the nodes and find that #1 and #5 are the providers. With this running, in a new console issue a "find" and provide, say, peer #2's address (don't need to build, already did above):

go-tor-dht-poc find vn5sgarqtdmzl27cnbrsfchkmrwm5erjb6jtmcwqras6qmhpmf6mahqd:52519/QmY9tHQMGUVg7xBnLiKGN81J9DCrns5KS4jK8wn8CwqHym

After a sec, here's the output:

2018/07/10 16:58:17 Found data ID on gvumv3dlefinroaeibjlrsknedmpd73stlqey4552boeqqfrcktkdvqd:52516/QmRdDcR647RjC7UkdZXiodAQoXQuqjiiR9wXas4RBhw71x
2018/07/10 16:58:17 Found data ID on lhcaimk5pvkj2p3ewcdrunryout2wgpjasfum45rochkxwi2y4raauyd:52535/QmSMd8DytSqkAJunHfbG4phedaDs3ugmGFMZY3e3UyePJG

Now let's connect to this DHT from the Tor browser and find them that way. With the DHT "provide" still running, navigate to js-tor-dht-poc. Run npm install to install dependencies and to prepare index.js for use at public/index.js, run npm run browserify. This makes a fairly large JS file that our page uses. Now, to start the web server, build and run the executable via:

go build && js-tor-dht-poc

The output will be something like:

Open Tor browser and navigate to http://n6ls3ltbmoyv2ucblvwz7skjg6mmajt6zfi33skwbhanomgexye6r5ad.onion
Press enter to exit

Now take that address and open it in the Tor browser (it may take a bit for the large JS file to load). Now take any peer address, say, peer #4 this time and put it in the text box and click `Find Providers. The result after a some time should be similar to:

Found 2 peers
gvumv3dlefinroaeibjlrsknedmpd73stlqey4552boeqqfrcktkdvqd.onion:52516/QmRdDcR647RjC7UkdZXiodAQoXQuqjiiR9wXas4RBhw71x
lhcaimk5pvkj2p3ewcdrunryout2wgpjasfum45rochkxwi2y4raauyd.onion:52535/QmSMd8DytSqkAJunHfbG4phedaDs3ugmGFMZY3e3UyePJG

Yay, you have an anonymous DHT that can be joined by other programs and have pieces discovered via other programs or via a Tor-enabled browser.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
amateescu/ipfs: Provides Drupal integration with IPFS发布时间:2022-06-23
下一篇:
galtproject/geesome-node: 发布时间:2022-06-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap