Comments (10)
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.
Or:
abcdefabcdef
-> 2.58496
abcdefcbafed
-> 2.58496
from eslint-plugin-no-secrets.
Or:
01
-> 1
0100001011110101000000010000100100001100110101001100011101110100110101011110110111110001110111110100
-> 1
from eslint-plugin-no-secrets.
01
-> 1
00001
-> 0.72193
from eslint-plugin-no-secrets.
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.
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.
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.
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.
Closing as over a year old
from eslint-plugin-no-secrets.
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)
- [feature request] Blacklist particular statements HOT 7
- does this library support ESLint 7? HOT 3
- Unexpected token v when used with eslint-plugin-json HOT 9
- question: find secrets in comments? HOT 3
- continuous integration HOT 6
- Minimum entropy threshold HOT 3
- Support "Flat Config" (ESLint 9) HOT 7
- specify a delimiter HOT 10
- upgrading dependencies HOT 4
- is there a Changelog? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eslint-plugin-no-secrets.