1

我从网上下载了以下功能。它是来自给定密码的 64 位WEP密钥生成器,我想知道这样的算法是标准算法还是开发人员发明的算法?

void wepkey64(char *passphrase, unsigned char k64[4][5])
{
    unsigned char pseed[4] = {0};
    unsigned int randNumber, tmp;
    int i, j;

    for(i = 0; i < strlen(passphrase); i++)
    {
        pseed[i%4] ^= (unsigned char) passphrase[i];
    }

    randNumber = pseed[0] | (pseed[1] << 8) | (pseed[2] << 16) | (pseed[3] << 24);

    for (i = 0; i < 4; i++)
    {
        for (j = 0; j < 5; j++)
        {
            randNumber = (randNumber * 0x343fd + 0x269ec3) & 0xffffffff;
            tmp = (randNumber >> 16) & 0xff;
            k64[i][j] = (unsigned char) tmp;
        }
    }
}
4

0 回答 0