How to use CipherOutputStream correctly to encrypt and decrypt log created with log4j (RollingFileAppender)

后端 未结 1 1193
谎友^
谎友^ 2020-12-06 06:12

I have a problem in encrypting/decrypting log file generated by log4j\'s RollingFileAppender. For the encryption I have tried to extend the RollingFileAppender, just call it

相关标签:
1条回答
  • 2020-12-06 06:58

    Looks pretty good. Are you resetting/initializing the cipher object for every message? You probably don't want to do that, but if you do then you need to think carefully about the structure of the cipher file, because the decryptor needs to know where the message boundaries are.

    0 讨论(0)
提交回复
热议问题