To break the affine cipher and determine the constants (a) and (b), you generally need at least two known plaintext-ciphertext pairs. However, without any such pairs, we can attempt to use frequency analysis or guess common words based on the structure of the cipher text. Since the ciphertext does not provide obvious hints like repeating pattern of words, we'll approach the problem assuming some common English words.
The word "RE" repeats in the cipher text, and since it is a common bigram, we might assume that it translates to "to" or "is".
Let's take "RE" to be "is" and check if we can find valid constants (a) and (b). In the affine cipher formula (c = (a \cdot p + b) \mod 26), "R" corresponds to (c = 17) and "E" to (c = 4), if "is" is the plaintext, then "i" corresponds to (p = 8) and "s" to (p = 18).
Working with these translations, we would have two equations based on the affine formula:
For "R" is "i":
(17 = (a \cdot 8 + b) \mod 26)
For "E" is "s":
(4 = (a \cdot 18 + b) \mod 26)
Now, we solve for (a) and (b). First, we need to ensure that (a) is coprime with 26 (since 26 is the size of our alphabet and for the decryption to be possible). Let's solve the system of congruences:
(17 = 8a + b \mod 26)
(4 = 18a + b \mod 26)
Subtract the second equation from the first to eliminate (b) and solve for (a):
(17 - 4 = (8a - 18a) \mod 26)
(13 = -10a \mod 26)
(13 = 16a \mod 26) (since (-10 \equiv 16 \mod 26))
Multiplying both sides by the modular inverse of 16 modulo 26 (which is 27 since (16 \cdot 27 = 432 \equiv 1 \mod 26)) gives:
(13 \cdot 27 = 16a \cdot 27 \mod 26)
(a = 351 \mod 26)
(a = 23 \mod 26) (since (351 \equiv 23 \mod 26))
Now that we have (a), substitute it back into one of the original equations:
(17 = 8 \cdot 23 + b \mod 26)
(17 = 184 + b \mod 26)
(17 = 8 + b \mod 26)
(b = 9 \mod 26)
So our potential affine cipher key values are (a = 23) and (b = 9). Now we must verify if this actually holds true for the rest of the ciphertext or adjust our initial assumptions if necessary. Let's decrypt the first word "QJKES" with our key:
(c = 16) for "Q"
(p = (c - b) \cdot a^{-1} \mod 26)
(p = (16 - 9) \cdot 23^{-1} \mod 26)
(p = 7 \cdot 23^{-1} \mod 26)
Now, we need to find the multiplicative inverse of (a = 23) modulo 26. Since (23 \cdot 17 = 391 \equiv 1 \mod 26), (23^{-1} \equiv 17 \mod 26). So:
(p = 7 \cdot 17 \mod 26)
(p = 119 \mod 26)
(p = 15) which corresponds to the letter "p"
We would continue this process for each character of the cipher text, but if at any time we realize the key doesn't work, we may need to go back and revise our assumptions.
Assuming (a = 23) and (b = 9) are correct and continue to hold true for subsequent characters, you would go on to decrypt the entire message. If the assumption was correct, you should end up with a meaningful plaintext message; if not, you might have to try a different assumption or technique to find (a) and (b).