public static function generateKeys($password, $nonce) { $array = array("key", "key", "key", "key"); $array2 = array(1, 2, 3, 4); $nonce .= '0'; for ($j = 0; $j < count($array); $j++) { $nonce[strlen($nonce) - 1] = chr($array2[$j]); $foo = Cryptography::waPbkdf2("sha1", $password, $nonce, 2, 20, true); $array[$j] = $foo; } return $array; }