Hashing and encryption with PHP and Python