Código PHP:
<?
function generateKey($webroot,$shortname,$version){
$webroot = strtolower(trim($webroot));
for($i=0;$i<strlen($webroot);$i++){
$alpha = substr($webroot,$i,+1);
$key1 = $key1 + $this->getValue($alpha);
}
$shortname = strtolower(trim($shortname));
for($i=0;$i<strlen($shortname);$i++){
$alpha = substr($shortname,$i,1);
$key3 = $key3 + $this->getValue($alpha);
}
$version = strtolower(trim($version));
for($i=0;$i<strlen($version);$i++){
$alpha = substr($version,$i,1);
$key4 = $key4 + $this->getValue($alpha);
}
$hkey1 = ($key1 + $key3 * $key4) * 9;
$hkey2 = ($key1 * $key3 - $key4) * 2;
$hkey3 = ($key1 - $key3 * $key4) * 3;
$hkey4 = ($key1 - $key3 - $key4) * 5;
$ckey1 = substr(strtoupper(crypt($hkey1,$key1)),3,6);
$ckey1 = str_replace(".","A",$ckey1);
$ckey1 = str_replace("/","Z",$ckey1);
$ckey2 = substr(strtoupper(crypt($hkey2,$key1)),3,6);
$ckey2 = str_replace(".","G",$ckey2);
$ckey2 = str_replace("/","3",$ckey2);
$ckey3 = substr(strtoupper(crypt($hkey3,$key3)),3,6);
$ckey3 = str_replace(".","6",$ckey3);
$ckey3 = str_replace("/","D",$ckey3);
$ckey4 = substr(strtoupper(crypt($hkey4,$key4)),3,6);
$ckey4 = str_replace(".","K",$ckey4);
$ckey4 = str_replace("/","W",$ckey4);
return $ckey1."-".$ckey2."-".$ckey3."-".$ckey4;
}
function getValue($alpha){
switch($alpha){
case 'a': return 6678 ; break;
case 'b': return 1712 ; break;
case 'c': return 5513 ; break;
case 'd': return 6648 ; break;
case 'e': return 7626 ; break;
case 'f': return 4581 ; break;
case 'g': return 7221 ; break;
case 'h': return 4891 ; break;
case 'i': return 4441 ; break;
case 'j': return 8503 ; break;
case 'k': return 7567 ; break;
case 'l': return 8028 ; break;
case 'm': return 2074 ; break;
case 'n': return 1770 ; break;
case 'o': return 2442 ; break;
case 'p': return 3321 ; break;
case 'q': return 3899 ; break;
case 'r': return 2474 ; break;
case 's': return 5313 ; break;
case 't': return 7505 ; break;
case 'u': return 9808 ; break;
case 'v': return 3571 ; break;
case 'w': return 3352 ; break;
case 'x': return 3410 ; break;
case 'y': return 7058 ; break;
case 'z': return 5847 ; break;
case '0': return 15058 ; break;
case '1': return 89739 ; break;
case '2': return 27663 ; break;
case '3': return 53044 ; break;
case '4': return 74136 ; break;
case '5': return 89338 ; break;
case '6': return 17816 ; break;
case '7': return 93186 ; break;
case '8': return 84464 ; break;
case '9': return 58450 ; break;
default: return 1419 ; break;
}
}
$webroot = "http://usuarios.lycos.es/";
$shortname = "gvenegas";
$version = "3.0";
echo generateKey($webroot,$shortname,$version);
?>
Espero puedan ayudarme