{"action":"closed","issue":{"url":"https://api.github.com/repos/gchq/CyberChef/issues/293","repository_url":"https://api.github.com/repos/gchq/CyberChef","labels_url":"https://api.github.com/repos/gchq/CyberChef/issues/293/labels{/name}","comments_url":"https://api.github.com/repos/gchq/CyberChef/issues/293/comments","events_url":"https://api.github.com/repos/gchq/CyberChef/issues/293/events","html_url":"https://github.com/gchq/CyberChef/issues/293","id":316973302,"number":293,"title":"Bug Report: CRC-32 Checksum Broken for Non-String Data","user":{"login":"proud2bgeeky","id":31557171,"avatar_url":"https://avatars2.githubusercontent.com/u/31557171?v=4","gravatar_id":"","url":"https://api.github.com/users/proud2bgeeky","html_url":"https://github.com/proud2bgeeky","followers_url":"https://api.github.com/users/proud2bgeeky/followers","following_url":"https://api.github.com/users/proud2bgeeky/following{/other_user}","gists_url":"https://api.github.com/users/proud2bgeeky/gists{/gist_id}","starred_url":"https://api.github.com/users/proud2bgeeky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/proud2bgeeky/subscriptions","organizations_url":"https://api.github.com/users/proud2bgeeky/orgs","repos_url":"https://api.github.com/users/proud2bgeeky/repos","events_url":"https://api.github.com/users/proud2bgeeky/events{/privacy}","received_events_url":"https://api.github.com/users/proud2bgeeky/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-04-23T20:36:00Z","updated_at":"2018-04-29T20:45:15Z","closed_at":"2018-04-29T20:45:15Z","author_association":"NONE","body":"### CRC Checksum Issues with Non-String Data\r\n\r\nIssue: The *CRC-32 Checksum* operation does not work correctly if you pass it binary data instead of an ASCII string. I haven't confirmed this behavior on *CRC-16 Checksum* but based on a review of the code it likely also has the same issue.\r\n\r\nPossible Root Cause: Based on my research the module currently being used by Cyberchef for CRC checksums, JS-CRC version 0.2.0, calculates inputs as strings by default and has internal checks that allow for input as byte `Array`, `Uint8Array`, and `ArrayBuffer`. However, Cyberchef currently passes all input to the CRC function/module as strings.\r\n\r\nExtract from JS-CRC readme:\r\n\r\n`// It also supports byte `Array`, `Uint8Array`, `ArrayBuffer` input:\r\ncrc32([0]); // d202ef8d\r\ncrc32(new Uint8Array([0])); // d202ef8d`\r\n\r\n### Example\r\n\r\nIf you input a hex byte string and use the *From Hex* operation to convert it to raw, then use the *CRC-32 Checksum* operation to obtain the CRC hash for the binary the results are incorrect. \r\n\r\nPassing string data does work correctly.\r\n"}}
{"actor":{"display_login":"n1474335"}}