winapi - Using CryptoAPI to generate ascii cipher text -


What I am trying to do specifically generates a PassStub field for Remote Assistance Tickets. The problem is that my results look like binary data, but in some way Microsoft generates printable characters

In [MS-RAE]:. Remote Assistance Initiation Protocol Specification & lt; 16> Section 6: Microsoft says that "PassStub" field "MD5 hashing and CALG_RC4, RC4 stream PROV_RSA_FULL with the encryption algorithm is encrypted using predefined Cryptographic Provider."

A data flow is not pictured:

Pictures distributed shows the password a "RA SessionID" pieces which are being encrypted with looks like this: u0RIQibSMntm0wAHQZ2mhatI63sjMjX15kh / vnciytOix8z6w + 36B01OiJoB5uYe

When I cryptEncrypt the phone result is about binary data about the length of the SessionID. "Po ^ 1BiNrHBvHGP"

Here's the code I'm trying to use it to :: Microsoft is somehow something that looks like this

  HCRYPTPROV hCryptProv; HCRYPTKEY hKey; HCRIIPTHAHHHSH; Balls Brett = 0; Passwordlen = SysStringByteLen (L "password"); Four RASessionID [] = "u0RIQibSMntm0wAHQZ2mhatI63sjMjX15kh / vnciytOix8z6w + 36B01OiJoB5uYe"; // ------------------------------------------------ ---------------- // get handle a cryptographic provider reference if (CryptAcquireContext (& amp ;! hCryptProv, zero, MS_DEF_PROV, PROV_RSA_FULL, 0)) {return false; } // ----------------------------------------------- ----------------- // Create an empty hash object. If (! CryptCreateHash (hCryptProv, CALG_MD5, 0, 0, and HHH)) {False FALSE; } If (! CryptHashData (hHash, (BYTE *) bpassword, passwordlen, 0)) {return incorrect; } // ----------------------------------------------- ----------------- // Create a session key based on the password hash. If (! CryptDeriveKey (hCryptProv, CALG_RC4, HHH, CRYPT_EXPORTABLE, and HK)) {return incorrect; } DWORD rasessionidlen = strlen (rasessionid); Char * ProxyStub = (Four *) Molec (RegisDelen * 2); Streaky (ProxyStub, Regions); Bret = cryptEncrypt (hKey, NULL, TRUE, 0, (BYTE *) ProxyStub, and Governor Lillen, RegisDelen * 2); Returns Brett;  

"RA session ID" Seems like my guess is that the pass-stub base 64 Also encoded - apart from your example: "Po ^ 1 BNRRHBVHGP" is very small and has a ^ ^ Is this a real example?

You may also need to base-decode the RA session ID before feeding cryptEncrypt.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -