Skip to content

Instantly share code, notes, and snippets.

@rfl890
Last active August 22, 2025 18:56
Show Gist options
  • Save rfl890/d21bab897c29f17e3b94c4e7f0f45915 to your computer and use it in GitHub Desktop.
Save rfl890/d21bab897c29f17e3b94c4e7f0f45915 to your computer and use it in GitHub Desktop.
Prints the cipher suites available on a Windows machine
#include <stdio.h>
#include <Windows.h>
#include <bcrypt.h>
#include <ntstatus.h>
int main() {
ULONG pcbBuffer = 0;
CRYPT_CONTEXT_FUNCTIONS *pBuffer = NULL;
NTSTATUS status = BCryptEnumContextFunctions(CRYPT_LOCAL, L"SSL", NCRYPT_SCHANNEL_INTERFACE, &pcbBuffer, &pBuffer);
if (status != STATUS_SUCCESS) {
exit(EXIT_FAILURE);
}
for (int i = 0; i < pBuffer->cFunctions; i++) {
int cbMultiByte = WideCharToMultiByte(GetConsoleOutputCP(), 0, pBuffer->rgpszFunctions[i], -1, NULL, 0, NULL, NULL);
char *pszMultiByte = malloc(cbMultiByte);
WideCharToMultiByte(GetConsoleOutputCP(), 0, pBuffer->rgpszFunctions[i], -1, pszMultiByte, cbMultiByte, NULL, NULL);
printf("%s\n", pszMultiByte);
free(pszMultiByte);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment