update serialization
compatible plaintext and ciphertext classes