Added as_plaintext flag into Encode for API compatibility