I read this article about serialization.
The first time I saw the encryption of a serialized object. I am trying to encrypt some serializable object and then save them to a file. But the example article uses ECB mode, which, as you know, reveals information about encrypted plaintext. I was wondering, how can I encrypt a serialized object using CBC instead of ECB mode?
To use CBC, you need an initial vector. This vector must be saved using a serialized object, but if the vector is encrypted, we cannot find the vector to decrypt the object.
In addition, is it possible to say that the original vector will be saved as plain text in the file where the serialiazable object is stored. But then the file will not be destroyed?
An example of using CBC mode will be very useful.
source share