<?php
 class vB_Utility_Password_Algorithm_Legacy extends vB_Utility_Password_Algorithm { public function generateToken($password) { $salt = $this->generateSalt(); $hash = md5($password . $salt); return ("$hash $salt"); } public function verifyPassword($password, $token) { [$hash, $salt] = explode(' ', $token); return ($hash == md5($password . $salt)); } protected function generateSalt() { $length = 30; $salt = ''; for ($i = 0; $i < $length; $i++) { $salt .= chr(rand(33, 126)); } return $salt; } } 