This script encrypt and decrypt config files for hg253sV2 routers with firmware version V100R001C202B026 and it's based on https://hg658c.wordpress.com/2015/03/17/hg658c_configtool/
Each firmware version may change the encryption keys or the cypher method, so check first your firmware version.
Huawei routers usually store the crypt and decrypt methods at /lib/libcfmapi.so
take a look at docs folder
Hardware components picture Hardware components text
Many thanks to hg658c from https://hg658c.wordpress.com/about/ and many others that had shared their knowlege and questions at the comments.