The problem I'd like to solve looks like this:
There are two plaintexts which differ in length and letters, but contain a few common strings. The first few words and the last few words are the same, and there are some common words in the middle as well (sometimes in the same order). The two texts have pretty much the opposite meaning.
The goal is to modify these syntactically but not semantically, and achieve the variants' MD5 hash (or at least the hash values' first 4 bytes) to be the same. I know, that MD5 hash collisions can occur, but how could I implement it in a programming language (e.g. Python) which is not brute force? Is there any way to check which letters to change?