Tag: freebsd

将PHP crypt()函数移植到C#的问题

我正在努力将一些旧的ALP用户帐户移植到新的ASP.Net解决方案,我希望用户能够使用他们的旧密码。 但是,为了使其工作,我需要能够根据新键入的密码将旧哈希值与新计算的哈希值进行比较。 我四处搜索,发现这是由PHP调用的crypt()的实现: char * crypt_md5(const char *pw, const char *salt) { MD5_CTX ctx,ctx1; unsigned long l; int sl, pl; u_int i; u_char final[MD5_SIZE]; static const char *sp, *ep; static char passwd[120], *p; static const char *magic = “$1$”; /* Refine the Salt first */ sp = salt; /* If it starts with the magic […]