Added as_plaintext flag to Encode

This will enable API compatibility