AipApiManager.cpp 745 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #include "pch.h"
  2. #include "AipApiManager.h"
  3. #include "TWinCryptF.h"
  4. #include <iostream>
  5. #include <string>
  6. #include <fstream>
  7. #include <sstream>
  8. #include <vector>
  9. #include <map>
  10. #include <algorithm>
  11. #include <functional>
  12. #include <cctype>
  13. #include <locale>
  14. #include <ctime>
  15. using namespace std;
  16. extern "C" {
  17. // SHA-256 ÇØ½Ã¸¦ »ý¼ºÇÏ´Â ÇÔ¼ö
  18. AIPAPIMANAGER_API std::string __stdcall AipApiEncrpyt(const char* AEncMessage)
  19. {
  20. try
  21. {
  22. TWinCrypt crypt;
  23. std::string sEncrypted = crypt.EncryptStrToHex(AEncMessage);
  24. return sEncrypted;
  25. }
  26. catch (const std::exception& ex)
  27. {
  28. std::string errorMessage = ex.what();
  29. return "";
  30. }
  31. }
  32. }