Is there an easy way to encrypt a java object?

前端 未结 7 1392
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-06 18:14

I\'d like to store a serialized object to a file however I\'d like to make it encrypted. It doesn\'t need to be really strong encryption. I just want something easy (preferably

7条回答
  •  忘了有多久
    2021-02-06 18:41

    Using CipherOutPutStream (http://docs.oracle.com/javase/6/docs/api/javax/crypto/CipherOutputStream.html) to write the objects into the ObjectOutputStream might be an easy and good approach here.

提交回复
热议问题