Reverse Engineering Cyclic Redundancy Codes
hackaday.com
hackaday.com
This is how you figure out which CRC to use in order to "simply" recalculate it.
Usually you are doing this because you want to interface with a closed-source device where only the messages are known, or if you want to check a closed-source device for vulnerabilities.
That is what I am confused on. Why would you need a desired CRC value?
Another reason might be for QA testing, or for fuzzing purposes.
You don't always know the implementation details, but this type of control allows one to get more understanding of those details, by seeing how the software under test reacts. This stuff is not wildly uncommon in low-grade IoT devices, or high-end devices with a low level of security maturity.
Somewhat relatedly, I have an article talking about modifying a file to generate a particular CRC, assuming that the parameters are known. https://www.nayuki.io/page/forcing-a-files-crc-to-any-value
http://reveng.sourceforge.net/readme.htm
PDF of the paper is here: https://sar.informatik.hu-berlin.de/research/publications/SA...
So you are given a dividend (the message) and a remainder (the CRC). What is the divisor (the CRC polynomial)? From one example dividend/remainder you can come up with several possible divisors, but you have already greatly narrowed the field. With more examples you can eliminate the false positives.