I'm actually stuck with a idea. So what I want to create is the following:
1) Create a array of hash algorithms like:
$methods = array('md5()', 'base64_encode()', 'hex2bin()');
2) Loop through the algorithm permutations and generate a output like:
Method: md5 > md5 > md5 > base64_encode > md5 = Output the hash of md5(md5(md5(base64_encode(hex2bin(md5($value))))));
The amount of the used array positions should be randomized and the order also.
For example:
Output 1: md5(md5($value));
Output 2: md5(base64_encode(md5($value)));
And so on...
My problem is the following: I've been trying to put the amount of items to the end of each array position as u can see in the code. But somehow this is the result: http://pr0b.com/sqlx/documents/list/hashr.php
It puts the braces to each item sadly. The code looks like:
<?php
$pass = 'test';
$array_elems_to_combine = array('md5(', 'base64_encode(', 'hex2bin(');
$size = rand(0,10);
$current_set = array('');
for ($i = 0; $i < $size; $i++) {
$tmp_set = array();
foreach ($current_set as $curr_elem) {
foreach ($array_elems_to_combine as $new_elem) {
$tmp_set[] = $curr_elem . $new_elem . $pass . str_repeat(')', $size);
}
}
$current_set = $tmp_set;
}
foreach ($current_set as $key) {
echo($key) . '</br>';
}
?>
md5is a hashing function. The other two just encode data. Also, why on earth are you doing something like this? I hope it is not for hashing passwords...