On the Subject of Playfair Cipher

Encrypting secrets since 1854, exploding bombs since 2018.

AA = 2(B - H)

D = 2H - B

D > AA = B < H + ⅓H

Part 1
SunBECOZY
Mon*PLAY
TueHIDDEN
Wed*SECRET
ThuCIPHER
Fri*FAIL
SatPARTYHARD
Part 2
Magenta Blue Orange Yellow
SER and PARSAFEEFASMESSAGEGROOVE
S# sum > 10CODEEDOCQUIETETIUQ
D > AAGROOVEEVOORGTEIUQQUITE
elseMESSAGEEGASSEMSAFEEDOC
“SER” is a serial port. “PAR” is a parallel port.
“S# sum” is the sum of all digits in the serial number.
“D” is the # of D batteries. “AA” is the # of AA batteries.
Part 3
0 Xs
1 XsONE
2 XsTWO
3+ XsMANY

*If lit BOB exists, use the next day instead.
If no vowel in S#, swap parts 1 & 2.
Now add all parts together to make a full key.
Reverse the full key if S# sum is prime.

Primes
235711131719
2329313741434753
Result Sequence
Magenta Blue Orange Yellow
STRIKEABCDCDABBADCDABC
KXBCDADACBADCBABCD
RYKECDABACBDDCBABCDA
KXDABCCBDACBADCDAB
ZTRIKEABDCBDACBACDDACB
KXBDCADBCAACDBACBD
RYKECABDBCADCDBACBDA
KXDCABCADBDBACBDAC

For each pair in grid:
Same Row -> Shift Left   Same Column -> Shift Up
Otherwise -> Same Row, Column of Other