mhmmm, prova così, ma come sicurezza non do darti molte garanzie:

codice:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Random code</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<script language="JavaScript">

var alfabeto="qwertyuiopasdfghjklzxcvbnm";

function casuale() {
 var stringacasuale="";
 var indice=0;
 for (var i=0; i<8; i++) {
  indice=Math.floor(Math.random()*alfabeto.length);
  stringacasuale+=alfabeto.charAt(indice);
 }
 alert(stringacasuale);
}

</script>

</head>

<body onload="casuale();">
</body>
</html>
ciao