diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2023-03-12 20:01:21 +0100 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2023-03-12 20:01:21 +0100 |
commit | ba6815ef8fb8ae472412b5af2837a7caba2799c2 (patch) | |
tree | bc8f40525e662d5f72ec40b0c8127676150ff8cf /examples | |
parent | cc3dbf16d29bf8f74c284d94a6da10ed004cf9d3 (diff) |
Revert "AES256 support"
This reverts commit cc3dbf16d29bf8f74c284d94a6da10ed004cf9d3.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/driver-aes.bat | 27 | ||||
-rw-r--r-- | examples/driver-aes.cpp | 63 |
2 files changed, 0 insertions, 90 deletions
diff --git a/examples/driver-aes.bat b/examples/driver-aes.bat deleted file mode 100644 index a8e5c7e..0000000 --- a/examples/driver-aes.bat +++ /dev/null @@ -1,27 +0,0 @@ -@echo off -set SERVICE_NAME=ksocket -set DRIVER="%~dp0\driver-aes.sys" - -net session >nul 2>&1 -if NOT %ERRORLEVEL% EQU 0 ( - echo ERROR: This script requires Administrator privileges! - pause - exit /b 1 -) - -echo --------------------------------------- -echo -- Service Name: %SERVICE_NAME% -echo -- Driver......: %DRIVER% -echo --------------------------------------- - -sc create %SERVICE_NAME% binPath= %DRIVER% type= kernel -echo --------------------------------------- -sc start %SERVICE_NAME% -echo --------------------------------------- -sc query %SERVICE_NAME% -echo [PRESS A KEY TO STOP THE DRIVER] -pause -sc stop %SERVICE_NAME% -sc delete %SERVICE_NAME% -echo Done. -timeout /t 3 diff --git a/examples/driver-aes.cpp b/examples/driver-aes.cpp deleted file mode 100644 index 06b1dcd..0000000 --- a/examples/driver-aes.cpp +++ /dev/null @@ -1,63 +0,0 @@ -#include <aes/aes256.hpp> - -extern "C" { -#include <ksocket/berkeley.h> -#include <ksocket/ksocket.h> -#include <ksocket/wsk.h> - -DRIVER_INITIALIZE DriverEntry; -DRIVER_UNLOAD DriverUnload; - -#define DebuggerPrint(...) \ - DbgPrintEx(DPFLTR_IHVDRIVER_ID, DPFLTR_ERROR_LEVEL, __VA_ARGS__); - -NTSTATUS -NTAPI -DriverEntry(_In_ PDRIVER_OBJECT DriverObject, - _In_ PUNICODE_STRING RegistryPath) { - UNREFERENCED_PARAMETER(DriverObject); - UNREFERENCED_PARAMETER(RegistryPath); - - { - ByteArray key = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, - 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f}; - ByteArray enc, dec; - const char secret_message[] = "This is a top secret message."; - const size_t secret_message_len = strlen(secret_message); - - enc.clear(); - dec.clear(); - - { - Aes256 aes(key); - aes.encrypt_start(secret_message_len, enc); - aes.encrypt_continue((unsigned char *)secret_message, secret_message_len, - enc); - aes.encrypt_end(enc); - } - - { - Aes256 aes(key); - aes.decrypt_start(enc.size()); - aes.decrypt_continue(enc.data(), enc.size(), dec); - aes.decrypt_end(dec); - } - - if (memcmp(secret_message, dec.data(), secret_message_len) != 0) { - DebuggerPrint("%s\n", "AES secret message differs!"); - DebuggerPrint("Original.: %s\n", secret_message); - } - DebuggerPrint("Decrypted: %s\n", dec.data()); - } - - return STATUS_SUCCESS; -} - -VOID DriverUnload(_In_ struct _DRIVER_OBJECT *DriverObject) { - UNREFERENCED_PARAMETER(DriverObject); - - DebuggerPrint("Bye."); -} -} |