Git Product home page Git Product logo

Comments (7)

rakshasa avatar rakshasa commented on May 25, 2024
download->initialize(infoHash, PEER_NAME + rak::generate_random<std::string>(20 - std::string(PEER_NAME).size()));

It seems to be doing everything correctly, and this code hasn't been touched in years. Is this something you see from one user, or does it happen with multiple users?

from libtorrent.

OlafvdSpek avatar OlafvdSpek commented on May 25, 2024

Haven't checked yet. How is the generator being initialized / seeded?

from libtorrent.

rakshasa avatar rakshasa commented on May 25, 2024
    cachedTime = rak::timer::current();

    srandom(cachedTime.usec());
    srand48(cachedTime.usec());

The generate_random method uses 'random()', so without any more informatino it's difficult to figure out what's going on.

from libtorrent.

OlafvdSpek avatar OlafvdSpek commented on May 25, 2024

About 20 bits of entropy, that's not a lot.
And what if two processes hit that line at the same microsecond?

from libtorrent.

rakshasa avatar rakshasa commented on May 25, 2024

6697806

Added xor of the pid and ppid.

from libtorrent.

OlafvdSpek avatar OlafvdSpek commented on May 25, 2024

That's still just 20 bits, isn't it?

from libtorrent.

OlafvdSpek avatar OlafvdSpek commented on May 25, 2024

Same thing again..
A user running rtorrent on multiple systems has the same peer ID & key for both..

from libtorrent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.