Skip to content

Instantly share code, notes, and snippets.

@fjrti
Last active August 12, 2021 02:56
Show Gist options
  • Save fjrti/2cca25c35281ccd081d6aaf2ba5d65a0 to your computer and use it in GitHub Desktop.
Save fjrti/2cca25c35281ccd081d6aaf2ba5d65a0 to your computer and use it in GitHub Desktop.
crypt加密
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#define _XOPEN_SOURCE
int main(void)
{
char *passwd;
char key[] = "123456";
passwd = crypt(key, "$6$y9cP0qlmDYgBk6OZ$");
printf("password: %s\n", passwd);
return 0;
}
/* Link with -lcrypt */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment