Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Index of Coincidence #1907

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

BitsOfBinary
Copy link
Contributor

The index of coincidence "provides a measure of how likely it is to draw two matching letters by randomly selecting two letters from a given text" (reference: https://en.wikipedia.org/wiki/Index_of_coincidence).

As we know this index will be around 0.067 for English text, this may be a useful indicator for plaintext strings. An example usage can be seen here: https://gchq.github.io/CyberChef/#recipe=Index_of_Coincidence()&input=VGhpcyBhIHRlc3QgZm9yIHRoZSBpbmRpY2F0b3Igb2YgY29pbmNpZGVuY2U

I've added this function for both data offsets/string values to the math module. I've also added documentation and tests for it.

@BitsOfBinary
Copy link
Contributor Author

Updated for compatibility with YARA v4.3.2; tests passing as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant