It occurred to me while doing I/O cleanup today that we could replace Obfuscator and Deobfuscator with javax.crypto.CipherInputStream and javax.crypto.CipherOutputStream, with the following advantages:
-
It would both simplify the code where Obfuscator and Deobfuscator are used now.
-
We could deprecate those two classes, which means a few hundred lines less code for us to maintain (though we’d have to keep them around for quite a while, I guess, because all existing saved games and logs are written with them).
Alternatively, we could get the code simplification benefit by converting them into a FilterInputStream and a FilterOutputStream, and then they could be chained directly into the I/O path like the zip streams are.