Current encryption method is a custom extension we developed when end-to-end specificiations were a bit sparse and experimental.
We will soon switch to the new XEP-0374 being evaluated these days by the XSF. If you'd like to help the switch, please refer to issue #633.