Etiquetas

C (31) Cpp (28) Linux (14) asm (8) Telegram (5) bot (5) libreria (5) Algoritmo (3) Errores comunes (3) python (3) Opengl (2) kali (2) Android (1) Snippet (1) nano (1) recursividad (1)

lunes, 13 de noviembre de 2023

[C] Obtener un hash md5

El código no es mi autoría, fue creado por Cervantes junto con @p0fk y publicado en HackxCrack. 7 - SEPT - 2011.

[quote]

#include <openssl/md5.h>
#include <stdio.h>
#include <string.h>
// code testing by p0fk!
 
int main(int argc, char *argv[])
{
    unsigned char buffer[1024];
    strcpy(buffer, "");
    unsigned char* hash;
    int i;
    printf("Frase : %s\n", argv[1]);
    hash = MD5(argv[1], strlen(argv[1]), NULL);

    for (i = 0;i < strlen(hash);i++)
    {
        sprintf((char*)&buffer[i*2],"%02x",hash[i]);
    }
    printf(buffer);
    printf("\n");
    return 0;
 }
 
 [/quote]

No hay comentarios.:

Publicar un comentario