Click here to Skip to main content
15,888,293 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: covert to upper Pin
Manish K. Agarwal2-Dec-08 18:01
Manish K. Agarwal2-Dec-08 18:01 
GeneralRe: covert to upper Pin
jonig192-Dec-08 19:20
jonig192-Dec-08 19:20 
GeneralRe: covert to upper Pin
enhzflep2-Dec-08 19:38
enhzflep2-Dec-08 19:38 
GeneralRe: covert to upper Pin
Jijo.Raj3-Dec-08 7:12
Jijo.Raj3-Dec-08 7:12 
AnswerRe: covert to upper Pin
Stuart Dootson2-Dec-08 21:05
professionalStuart Dootson2-Dec-08 21:05 
AnswerRe: covert to upper Pin
David Crow3-Dec-08 5:01
David Crow3-Dec-08 5:01 
Questionsystem in windows ce Pin
Arif Liminto2-Dec-08 15:58
professionalArif Liminto2-Dec-08 15:58 
QuestionHow does this translate to c++ Pin
monsieur_jj2-Dec-08 15:40
monsieur_jj2-Dec-08 15:40 
Hi all,

How does this translate to c++:

string key = (string)settingsReader.GetValue("SecurityKey", typeof(String));
HashAlgorithm XHash = HashAlgorithm.Create("MD5");
byte[] keyArray = XHash.ComputeHash(UTF8Encoding.UTF8.GetBytes(key));
XHash.Clear();
TripleDESCryptoServiceProvider tdes = new TripleDESCryptoServiceProvider();
tdes.Key = keyArray;
tdes.Mode = CipherMode.ECB;
tdes.Padding = PaddingMode.PKCS7;


This is what I did but i am not sure if its correct because I didnt do the UTF8Encoding part.

TCHAR szKey[] = _T("Key");
DWORD pwlen = _tcslen(szKey);
result = CryptCreateHash(hProv,CALG_MD5,0,0,&hHash);
result = CryptHashData(hHash,(BYTE *)szKey,pwlen,0);
result = CryptDeriveKey(hProv,CALG_3DES,hHash,0,&hKey);
BYTE PadMode = CRYPT_MODE_ECB;
result = CryptSetKeyParam(hKey, PKCS5_PADDING, &PadMode, 0);


Please help me clarify things.

Thanks,
Jayjay
AnswerRe: How does this translate to c++ Pin
Stuart Dootson2-Dec-08 21:01
professionalStuart Dootson2-Dec-08 21:01 
QuestionWhich is the best C++ ERP development toolkit ? Pin
sumeet1232-Dec-08 9:02
sumeet1232-Dec-08 9:02 
AnswerRe: Which is the best C++ ERP development toolkit ? Pin
toxcct2-Dec-08 9:11
toxcct2-Dec-08 9:11 
JokeRe: Which is the best C++ ERP development toolkit Pin
CPallini2-Dec-08 9:17
mveCPallini2-Dec-08 9:17 
AnswerRe: Which is the best C++ ERP development toolkit ? Pin
Cedric Moonen2-Dec-08 20:08
Cedric Moonen2-Dec-08 20:08 
AnswerRe: Which is the best C++ ERP development toolkit ? Pin
Stuart Dootson2-Dec-08 20:56
professionalStuart Dootson2-Dec-08 20:56 
GeneralRe: Which is the best C++ ERP development toolkit ? Pin
toxcct2-Dec-08 21:17
toxcct2-Dec-08 21:17 
GeneralRe: Which is the best C++ ERP development toolkit ? Pin
Stuart Dootson2-Dec-08 21:59
professionalStuart Dootson2-Dec-08 21:59 
GeneralRe: Which is the best C++ ERP development toolkit ? Pin
toxcct2-Dec-08 22:07
toxcct2-Dec-08 22:07 
GeneralRe: Which is the best C++ ERP development toolkit ? Pin
Stuart Dootson2-Dec-08 22:36
professionalStuart Dootson2-Dec-08 22:36 
GeneralRe: Which is the best C++ ERP development toolkit ? Pin
toxcct2-Dec-08 22:37
toxcct2-Dec-08 22:37 
AnswerRe: Which is the best C++ ERP development toolkit ? Pin
sumeet1233-Nov-09 1:27
sumeet1233-Nov-09 1:27 
QuestionDifference between MFC and windows form application Pin
frankis782-Dec-08 8:10
frankis782-Dec-08 8:10 
AnswerRe: Difference between MFC and windows form application Pin
toxcct2-Dec-08 8:29
toxcct2-Dec-08 8:29 
GeneralRe: Difference between MFC and windows form application Pin
frankis782-Dec-08 10:28
frankis782-Dec-08 10:28 
GeneralRe: Difference between MFC and windows form application Pin
Rajesh R Subramanian2-Dec-08 20:33
professionalRajesh R Subramanian2-Dec-08 20:33 
GeneralRe: Difference between MFC and windows form application Pin
frankis782-Dec-08 20:50
frankis782-Dec-08 20:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.