kwonalbert / riffle

MIT License
219 stars 34 forks source link

1)cannot find afs/client and 2)g.Secret undefined #2

Open omac777 opened 8 years ago

omac777 commented 8 years ago

go get github.com/dedis/crypto go get golang.org/x/crypto/nacl/secretbox go get golang.org/x/crypto/sha3 go get github.com/dedis/crypto/random

cd riffle go build test.go:9:2: cannot find package "afs/client" in any of: from $GOROOT from $GOPATH

cd server go build server.go ./utils.go:96: g.Secret undefined (type abstract.Group has no field or method Secret) ./utils.go:114: g.Secret undefined (type abstract.Group has no field or method Secret) ./utils.go:129: g.Secret undefined (type abstract.Group has no field or method Secret) ./utils.go:136: undefined: abstract.Secret

kwonalbert commented 8 years ago

The first problem should be easy to fix. It seems like I forgot to update a test file when I migrated the repo to riffle. Sorry for this careless mistake; I thought I tested after moving repos..

The other is a more time consuming problem and is a symptom of a larger problem. This code was written against a much older version of dedis crypto library. Quite a few things changed, and I'll need to dig through to figure out what must be changed in my code. I guess you could probably find a commit far enough back for dedis crypto library to make it work, but I think it would be better for me to fix the code for real.

On Jul 23, 2016 13:30, "David Marceau" notifications@github.com wrote:

go get github.com/dedis/crypto go get golang.org/x/crypto/nacl/secretbox go get golang.org/x/crypto/sha3 go get github.com/dedis/crypto/random

cd riffle go build test.go:9:2: cannot find package "afs/client" in any of: from $GOROOT from $GOPATH

cd server go build server.go ./utils.go:96: g.Secret undefined (type abstract.Group has no field or method Secret) ./utils.go:114: g.Secret undefined (type abstract.Group has no field or method Secret) ./utils.go:129: g.Secret undefined (type abstract.Group has no field or method Secret) ./utils.go:136: undefined: abstract.Secret

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/kwonalbert/riffle/issues/2, or mute the thread https://github.com/notifications/unsubscribe-auth/AB2KIjxFQwUGknfOVOrbOuPhlPmyXIkzks5qYglMgaJpZM4JTWWB .

seancomeau commented 8 years ago

Looks like abstract.Secret is now called abstract.Scalar: https://github.com/dedis/crypto/commit/1b6c6962d3ba4b412fc09c2af34968ca616a0d5e

Correcting that in various places of lib/utils.go, client/client.go, and server/server.go gets the client to build. Building the server now fails with a single error:

./server.go:478: undefined: shuffle.Shuffle2

kwonalbert commented 8 years ago

Secret moving to Scalar was known, but I'm a bit surprised that was the only problem, other than Shuffle2. If that's the only problem, I can fix and commit the solution to problem once I have a stable connection (early next week).

On Jul 24, 2016 11:45, "Sean Comeau" notifications@github.com wrote:

Looks like abstract.Secret is now called abstract.Scalar: dedis/crypto@ 1b6c696 https://github.com/dedis/crypto/commit/1b6c6962d3ba4b412fc09c2af34968ca616a0d5e

Correcting that in various places of lib/utils.go, client/client.go, and server/server.go gets the client to build. Building the server now fails with a single error:

./server.go:478: undefined: shuffle.Shuffle2

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kwonalbert/riffle/issues/2#issuecomment-234770310, or mute the thread https://github.com/notifications/unsubscribe-auth/AB2KIux5kMlOHn7rJpG-_iOiQ3Fr4Mxiks5qY0JLgaJpZM4JTWWB .

seancomeau commented 8 years ago

Do you happen to remember where Shuffle2 used to be defined?

kwonalbert commented 8 years ago

IIRC that was on a different branch that's not around anymore. The function is very simple though; it's the same as the Shuffle function, except that pi is passed as parameter instead of being generated inside the func.

On Jul 24, 2016 15:09, "Sean Comeau" notifications@github.com wrote:

Do you happen to remember where Shuffle2 used to be defined?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kwonalbert/riffle/issues/2#issuecomment-234779395, or mute the thread https://github.com/notifications/unsubscribe-auth/AB2KIn9NftxOV-Y8TbSs1D5apPzru8SVks5qY3IsgaJpZM4JTWWB .

seancomeau commented 8 years ago

Okay, it compiles when I just call Shuffle without that parameter. Is it an optimization to pass the value as a parameter? In other words, do you expect it will still run properly with this workaround?

(Here's what worked for me, if anyone else wants to give it a go: https://github.com/seancomeau/riffle/commit/0aeac521ea5f5a5ba5461337199f9fe9a6158d87)

kwonalbert commented 8 years ago

No, I do not expect it to work actually, because the same pi needs to be used across rounds. I think the better solution is to pull a copy of shuffle (i.e., old shuffle2) into this code base, which I'll try to do asap.

seancomeau commented 8 years ago

I've added a Shuffle2 which takes s.pi instead of generating pi internally. Now I'm trying to see if it works. If I use an empty server file I get this:

$ ./server -i 1 -n 3 -s srvfile -m m
2016/07/31 00:58:33 method Keys has wrong number of ins: 1
2016/07/31 00:58:33 method MainLoop has wrong number of ins: 1
2016/07/31 00:58:33 method Masks has wrong number of ins: 1
2016/07/31 00:58:33 method Secrets has wrong number of ins: 1
2016/07/31 00:58:33 method Keys has wrong number of ins: 1
2016/07/31 00:58:33 method MainLoop has wrong number of ins: 1
2016/07/31 00:58:33 method Masks has wrong number of ins: 1
2016/07/31 00:58:33 method Secrets has wrong number of ins: 1
Starting server 1

If I throw a list of hosts in there I get the same thing, except without "Starting server [id]". Can you provide some examples of how to run/test riffle? Or check in the "servers2" and "spawn_clients.sh" files that "spawn_remote.py" depends on?

kwonalbert commented 8 years ago

I've added a new readme, along with a local test. Please try it out, and let me know if it doesn't work.

omac777 commented 8 years ago

OK so the install process is complete: go get github.com/kwonalbert/riffle cd $GOPATH/src/github.com/kwonalbert/riffle go install ./client ./server

Perhaps more verbosity as to what happened when it installed would to understand what directories hold the configuration files, the shared files and the blogging files. Some default directories would be nice.

If I understood correctly both documented python scripts are only to: 1)generate some test files for a local test: python2 ./scripts/gen_file.py mkdir -p ./files/ python2 ./scripts/gen_file.py 5 5 5 ./files/ block size: 5 I examined the gen_file.py more closely in order understand what files are created and what data is moving. I noticed you are creating a file based on the block size passed in as a parameter. You write random data of that block size into a file you named "file"+ counter. ie. file0 to file4. At the very same time you create another file containing the hash and calling it a ".torrent". I can assure you that is not the standard .torrent file format. Please do not call it a ".torrent" file in your tests when it does not conform to ".torrent" format. I recommend you call it ".riffle" instead.

and 2)run the local test: python2 ./scripts/test_local.py python2 ./scripts/test_local.py 5 5 f ./files/ Starting server 4 Starting server 3 Starting server 1 Starting server 0 Starting server 2 Registered 0 Registered 1 Registered 2 Registered 3 0 Register done Handler running 0 0 running 1 Register done Handler running 1 1 running 2 Register done Handler running 2 2 running 3 Register done Handler running 3 3 running 4 Register done Handler running 4 4 running Registered 4 Started client 4 Started client 1 sharing keys took 9.06231352s Started client 0 Started client 3 Started client 2 Round 1: 337ns Round 6: 237ns Round 3: 108ns Round 4: 148ns Round 5: 273ns Round 7: 155ns Round 2: 109ns Round 9: 328ns Round 8: 146ns Round 0: 92ns total time: took 23.748312ms Killed Killed Killed Killed Killed client: no process found

Please provide a concrete example of a real world usage for: 1)starting a server sharing some files to the world 2)starting a server sharing some blogging to the world 3)using a client to fetch some files from the rest of the world 4)using a client to fetch some blogging from the rest of the world Here is a reference point: https://web.archive.org/web/20090106131429/http://wiki.anomos.info/wiki/Testing "runtracker.sh port=5555 python $HOME/anomos/anomos.git/bttrack.py --port $port --dfile $HOME/anomos/anomos.git/dstate --logfile $HOME/anomos/anomos.git/tracker.log --data_dir $HOME/anomos/anomos.git/ Starting the runtracker will create the tracker.log file, dstate file and the crypto directory. The crypto director contains the following files: randpool.dat tracker-pvt.pem tracker-pub.pem 3)Reconfigure the firewall to open the ports 5555 and the port range 6881:6889 at the UDP and TCP level. 4)Restart the firewall. python $HOME/anomos/anomos.git/btmaketorrent.py http://localhost:5555/announce $HOME/anomos/crypto/tracker-pub.pem ./seeder.sh torrentfile identity ./peer.sh torrentfile identity https://github.com/Miserlou/Anomos python anondownloadheadless.py torrentfilename.atorrent --save_as outputfliename --identity your_identity_name You will also need to have the appropriate port range (5061-5069 by default) forwarded to your machine. "

What are the best configurations to both support file-sharing/blogging simultaneously? Here are some good reference points: https://github.com/Miserlou/Anomos/blob/testing/anomos.nsi https://anomos.info/doc/Anomos.defaultargs-pysrc.html

What ports should be opened for the riffle server part on the firewall/router? What ports should be opened for the riffle client part on the firewall/router? Possibly you might want to register the service name and request some port numbers be assigned to it: https://www.iana.org/form/ports-services http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.txt How about these? 4194-4198 Unassigned 4363-4365 Unassigned 4380-4388 Unassigned They are low 4-digit numbers.

Having a tool to convert torrent files into riffle files would be good. What's the riffle file extension? http://anomos.info/wp/category/anomos/ python anomosify.py --path /path/to/torrent/directory/

Having a tool to convert an html directory into riffle blog entries would be good.

Another tool to convert tor nodes and hidden services into riffle nodes and services would be good.

omac777 commented 8 years ago

Riffle seems purposed for file sharing essentially like anomos or gnunet with a PQcrypto twist while Tor is purposed as a relayer of multiple protocols sitting on top of it including http, chat, web dav, torrents whatever.

I didn't see anything in riffle's local_test.py demonstrating proxying multiple protocols. Is that the end goal or is it truly solely purposed for file-sharing?