start porting Crypto.php