Refactor the use of the cipher class as Tools::substr() method uses mb_substr() if it exists and that does not work for the prior use