Code Monkey home page Code Monkey logo

Comments (10)

oprogramador avatar oprogramador commented on June 19, 2024

or another example - according to Shannon, the entropy of a is 0 and the entropy of aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa is 0 as well

from eslint-plugin-no-secrets.

oprogramador avatar oprogramador commented on June 19, 2024

Or:
abcdefabcdef -> 2.58496
abcdefcbafed -> 2.58496

from eslint-plugin-no-secrets.

oprogramador avatar oprogramador commented on June 19, 2024

Or:
01 -> 1
0100001011110101000000010000100100001100110101001100011101110100110101011110110111110001110111110100 -> 1

from eslint-plugin-no-secrets.

oprogramador avatar oprogramador commented on June 19, 2024

01 -> 1
00001 -> 0.72193

from eslint-plugin-no-secrets.

nickdeis avatar nickdeis commented on June 19, 2024

Hey @oprogramador,
Thank you for the compelling issue. I'm currently researching into this. I have added this plugin to a few of the larger projects I work on. I think the current problem is that the false positives tend to be actual words.
This isn't an issue until you have large inline strings with things like paragraphs (like auto-gen) docs.
I'm currently trying to think of a good solution to this. Let me know what your thoughts are.
I'm going to keep brainstorming. Maybe some NLP?
Cheers,
Nick

from eslint-plugin-no-secrets.

oprogramador avatar oprogramador commented on June 19, 2024

@nickdeis

that's my solution https://github.com/oprogramador/eslint-plugin-no-credentials/blob/master/src/calculateStrongEntropy.js

multiplying the Shannon entropy plus 1 and zipped data length minus 20 (because it's always at least 20)

from eslint-plugin-no-secrets.

oprogramador avatar oprogramador commented on June 19, 2024

you can see the results here https://github.com/oprogramador/eslint-plugin-no-credentials/blob/master/src/tests-mocha/calculateStrongEntropy.js

from eslint-plugin-no-secrets.

nickdeis avatar nickdeis commented on June 19, 2024

Super interesting. Wouldn't entropy and compression rates be colinear? I suppose this ends up being a weighted measure of entropy and string length. Any reference material used to come up with this?

from eslint-plugin-no-secrets.

nickdeis avatar nickdeis commented on June 19, 2024

Closing as over a year old

from eslint-plugin-no-secrets.

oprogramador avatar oprogramador commented on June 19, 2024

@nickdeis

I invented my own approach in my library to have a relatively good measurement of information quantity.

from eslint-plugin-no-secrets.

Related Issues (11)

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.