Obfuscator and Deobfuscator

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:

  1. It would both simplify the code where Obfuscator and Deobfuscator are used now.

  2. 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.

This seems like the better idea. Those operations certainly don’t qualify as cryptography, and there’s not much pay-off for the work of implementing the javax.crypto classes in order to be able to use the Cipher streams.

rk

Post generated using Mail2Forum (mail2forum.com)