#include "pch.h" #include "AipApiManager.h" #include "TWinCryptF.h" #include #include #include #include #include #include #include #include #include #include #include using namespace std; extern "C" { // SHA-256 ÇØ½Ã¸¦ »ý¼ºÇÏ´Â ÇÔ¼ö AIPAPIMANAGER_API std::string __stdcall AipApiEncrpyt(const char* AEncMessage) { try { TWinCrypt crypt; std::string sEncrypted = crypt.EncryptStrToHex(AEncMessage); return sEncrypted; } catch (const std::exception& ex) { std::string errorMessage = ex.what(); return ""; } } AIPAPIMANAGER_API int __stdcall AipApiDecrypt(const char* ADecMessage, char* AEncMessage) { try { TWinCrypt crypt; //std::cout << "ADecMessage message: " << ADecMessage << std::endl; std::string sDecrypted = crypt.DecryptStrFromHex(ADecMessage); //std::cout << "sDecrypted message: " << sDecrypted << std::endl; strcpy(AEncMessage, sDecrypted.c_str()); return 0; } catch (const std::exception& ex) { std::string errorMessage = ex.what(); return -1; } } AIPAPIMANAGER_API std::string __stdcall AipApiDecrypt2(const char* ADecMessage) { try { TWinCrypt crypt; std::string sDecrypted = crypt.DecryptStrFromHex(ADecMessage); return sDecrypted; } catch (const std::exception& ex) { std::string errorMessage = ex.what(); return ""; } } }