카타 7급 Password Hashes

1 C[ | ]

#include <openssl/md5.h>
#include <stdlib.h>
char *passwd_hash(const char *passwd)
{
  unsigned char d[16];
  MD5(passwd, strlen(passwd), d);
  char *res = malloc(32);
  for(int i=0; i<16; i++) sprintf(res+i*2, "%02x", d[i]);
  return res;
}

2 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}