some months back, found some code that generates the WEP keys.

most ZyXEL routers are shipped with WPA-PSK on by default so this is just posted for anyone who might be interested in how they're generated.thats all

since around this time last year, the algorithms have changed.

PHP Code:
char *genKey64(char *passwordunsigned char *output)
{
        
size_t pass_len;
        
unsigned char *output;
        
unsigned int seed 0;

        
int i,j;

        if((
pass_len strlen(password)) != 0) {
            for(
0;pass_len;i++) {
                ((
unsigned char*)&seed)[4] ^= password[i];
            }
        }
        for(
0;4;i++) {
            for(
0;5;j++, += 2) {
                
seed 214013 seed 2531011;
                
sprintf(p,"%02x",(seed >> 16) & 0xff);
            }
        }
        
        return(
output);
}

char *genKey128(char *inputunsigned char *output)
{
        
size_t pass_len;
        
unsigned char wep_key[16]={0};
        
char password[64];
        
MD5_CTX ctx;

        
int i;

        if((
pass_len strlen(input)) != 0) {

            for(
0;64;i++)
                
password[i] = (input[pass_len]);
        }

        
MD5Init(&ctx);
        
MD5Update(&ctx,password,sizeof(password));
        
MD5Final(wep_key,&ctx);

        for(
0;13;i++)
            
sprintf(&output[i*2],"%02x",wep_key[i]);

        return(
output);