gchq / CyberChef

The Cyber Swiss Army Knife - a web app for encryption, encoding, compression and data analysis
https://gchq.github.io/CyberChef
Apache License 2.0
28.97k stars 3.25k forks source link

Bug report: 32 and 64-bit fletcher checksums are incorrect #1377

Closed nolanhergert closed 2 years ago

nolanhergert commented 2 years ago

Describe the bug Fletcher32 and Fletcher64 algorithms use bytes for summation instead of uint16 or uint32, respectively. They don't match wikipedia: https://en.wikipedia.org/wiki/Fletcher%27s_checksum#Test_vectors

To Reproduce (https://gchq.github.io/CyberChef/#recipe=Fletcher-64_Checksum()&input=YWJjZGVmZ2g)

Expected behaviour Expected output: 0x312E2B28CCCAC8C6 Actual output: 0x00000df800000324

Additional context

Please see this issue I submitted with another repo for some refactored example code that fixes the issue. I don't know the details of your implementation. https://github.com/GRISHNOV/Fletcher_checksum/issues/2

nolanhergert commented 2 years ago

Similar issue: https://github.com/gchq/CyberChef/issues/51

n1073645 commented 2 years ago

This is further explained in #1316 . It is a known bug and hopefully will be fixed soon.

nolanhergert commented 2 years ago

Sounds good to me, closing.