Skip to content

Instantly share code, notes, and snippets.

View BloodhoundAllfather's full-sized avatar

Bloodhound BloodhoundAllfather

View GitHub Profile
@BloodhoundAllfather
BloodhoundAllfather / sha1-windows.c
Last active January 15, 2023 00:28
SHA1 hash using Windows APIs
#include <Windows.h>
#include <Wincrypt.h>
#pragma comment(lib, "advapi32.lib")
#define SHA1LEN 20
// generates SHA1 hash and returns 20-byte heap-memory if successful, otherwise NULL
unsigned char* sha1(unsigned char* data, int len)
{
HCRYPTPROV hProv = 0;