mwarning / KadNode

P2P DNS with content key, crypto key and PKI support. DynDNS alternative.
MIT License
409 stars 74 forks source link

various questions, no issue #35

Closed maboiteaspam closed 9 years ago

maboiteaspam commented 9 years ago

Hello mwarning,

/mylife/ First of all thank you to have make it !

This said, i m very interested in re implementing part of your software in nodejs. Partly because i don't understand very well C and i can t write it. Also because i have good platform to make this kind of software fit in (ie maboiteaspam/cozy-light). More surely because DHT and DNS implementation both are existing right now in NodeJS. Thus, i think i probably only have to realize the job to glue everything all together to make it workable. /mylife/

Here are some questions i m trying to solve, but maybe you have time and wheeling to help me to answer.

int dns_lookup_addr( const char hostname[], IP addr[], size_t addr_num ) {
    /* Start lookup for one address */
    if( kad_lookup_value( hostname, addr, &addr_num ) >= 0 && addr_num > 0 ) {
        return addr_num;
    } else {
        return 0;
    }
}

Then after this part totally loose me (...). kad.c : kad_lookup_value https://github.com/mwarning/KadNode/blob/master/src/kad.c#L427

Again, thank you very much for this work !

mwarning commented 9 years ago

Hi maboiteaspam,

the dht.c is is unmodified, I have just put some text at the top of the file.

As for kad_lookup_value, let me give you a rundown of the processing this function does: kad_lookup_value()

I do not have any running nodes right now. But I tend to test KadNode from time to time. :-)

Good luck with your project, we need more of those. Nohing has really catched on yet.

maboiteaspam commented 9 years ago

Thanks ! yes it is difficult thing to provide the good software and spread it outside IRL. It needs to fit many requirements very well, especially when the classical way is working so well. Convincing the people to change won t be that easy, but let s see first if i ll be able to find you on the network : D

Somehow, it opens my eyes on stuff i already read in README, but missed, pbbly read too quickly.

My next step is to figure out how is implemented the challenge stuff. https://github.com/mwarning/KadNode/blob/473a149b5f78a5064fc84739a619caffaa9428ce/src/ext-auth.c#L324

Does it work like this : 1/ as a searcher, i cipher a random string using the public key i ve been provided IRL. 2/ once i found a node that pretend to answer my query, send him the ciphered string 3/ announcer decodes the challenge using it s private keys, responds an unciphered string 4/ searcher can compare the two string and confirm the result is correct.

Not sure, i ll get myself a README about asymetric key exchange.

mwarning commented 9 years ago

Yes, that is basicly correct. Here is a wiki page about this procedure: https://github.com/mwarning/KadNode/wiki/Cryptography-Details Keep in mind that this feature is more of a proof of concept. I plan to separate the authentication stuff from KadNode my some api, so KadNode will be just a packaged DHT with interfaces that ships with a crypto module.

melroy89 commented 9 years ago

I think a good thing to do, is document some important lines better in the code. Like line 427: https://github.com/mwarning/KadNode/blob/master/src/kad.c#L427

mwarning commented 9 years ago

Agreed :-)

maboiteaspam commented 9 years ago

Thanks again. I saw the problems you rise at bottom of your link. In first attempt i d sign http via SSL certificate. So that if ip change, it could probably be identified, then, user notified. Anyway i need more reading.

This said, for the moment i ve spent time to build my playground https://github.com/maboiteaspam/cozy-dns Hope anyone will find any interest into that for its own test&tries purpose !

Happy coding!

maboiteaspam commented 9 years ago

HI,

In the overall,i finished this playground, on localhost it works. Some erratic behaviors occurs, but it passes through the dhtable to find a peer announcing such dns. From information, it picks the ip to answer the initial dns query.

Now i want to remark that i face a very unexpected problem (ahah). On my system, fedora21, it is not possible to register a dns server on non standard port, nor to listen port 53 with userland capabilities.

In fact, even the famous BIND server seems hardcoded on that matter according to some readings@stackoverflow.

The satisfying thing is that dig was working with option -p.

So i guess that the idea for me now, is to work around this issue using an httproxy instead of a dns server. This is more easy to configure for the end user, and more close to the final service i attempt to reach.

Have you faced that problem too ?

mwarning commented 9 years ago

KadNode supports the Name Sevice Switch facility. The DNS interface is more of an alternative for systems that do not support it (OpenWrt/Windows/MacOSX).

maboiteaspam commented 9 years ago

It makes sense now i ve checked about NSS :s thanks again for remind!