Does serialization support encryption?

Tim Rohaly

Not directly. I/O in Java is performed through streams, and encryption is typically implemented as an algorithm operating on a stream - the input to the stream is clear text, the output is encrypted.

Serialization is stream-oriented, so any encryption that can be performed on any stream can also be applied to serialized objects.