Coder Social home page Coder Social logo

Comments (3)

aussiehash avatar aussiehash commented on May 29, 2024

I've modified lines
85
trezor_entropy = client.get_entropy(32).encode('hex')
86
urandom_entropy = os.urandom(32).encode('hex')
110
print passw.encode('hex')

Although perhaps only the 3rd edit is required.

Please confirm action on your device. 28bee36480aaf1dec7137fbdc0b0e5d0cfde58295f1f47cdc63dfa8af695fbbb

Edit : base64 encoding is probably a better choice
print passw.encode('base64')

from python-trezor.

ddworken avatar ddworken commented on May 29, 2024

This is not actually a vulnerability. Rather than looking at the output, look at the code to determine if this is secure.

trezor_entropy = client.get_entropy(32)
urandom_entropy = os.urandom(32)
passw = hashlib.sha256(trezor_entropy + urandom_entropy).digest()

So the fact that passw is often short, does not affect the security of this. By examining the code one can see that this is made up of combining two sources of entropy, both 32 bytes of randomness, and hashing them. The length of the output is irrelevant. There is plenty of randomness in this case.

The perceived vulnerability is due to the output of passw not being stored as as base64 encoded string. It is not actually made up of question marks, those are due to your computer not understanding how to interpret the data as a string.

Encoding passw in base64 or hex does not improve the security of anything. Instead it improves the perceived security of it if you look at the output. But for anyone trying to brute force it, this will not change anything. It would just forced them to generate random values that are base64 encoded instead.

from python-trezor.

prusnak avatar prusnak commented on May 29, 2024

Right. Autogenerated password is binary.

from python-trezor.

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.