Algorithm 5. Serialization of encrypted vector.