Click here to Skip to main content

C / C++ / MFC

    RSS: RSS Feed

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page  Show 
  Refresh
GeneralRe: covert to upper Pinmemberjonig1920:20 2 Dec '08  
GeneralRe: covert to upper Pinmemberenhzflep20:38 2 Dec '08  
GeneralRe: covert to upper PinmemberJijo raj8:12 3 Dec '08  
AnswerRe: covert to upper PinmemberStuart Dootson22:05 2 Dec '08  
AnswerRe: covert to upper PinmvpDavidCrow6:01 3 Dec '08  
Questionsystem in windows ce Pinmemberarifliminto8616:58 2 Dec '08  
QuestionHow does this translate to c++ Pinmembermonsieur_jj16:40 2 Dec '08  
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++ PinmemberStuart Dootson22:01 2 Dec '08  
QuestionWhich is the best C++ ERP development toolkit ? Pinmembersumeet12310:02 2 Dec '08  
AnswerRe: Which is the best C++ ERP development toolkit ? Pinmvptoxcct10:11 2 Dec '08  
JokeRe: Which is the best C++ ERP development toolkit PinmvpCPallini10:17 2 Dec '08  
AnswerRe: Which is the best C++ ERP development toolkit ? PinmvpCedric Moonen21:08 2 Dec '08  
AnswerRe: Which is the best C++ ERP development toolkit ? PinmemberStuart Dootson21:56 2 Dec '08  
GeneralRe: Which is the best C++ ERP development toolkit ? Pinmvptoxcct22:17 2 Dec '08  
GeneralRe: Which is the best C++ ERP development toolkit ? PinmemberStuart Dootson22:59 2 Dec '08  
GeneralRe: Which is the best C++ ERP development toolkit ? Pinmvptoxcct23:07 2 Dec '08  
GeneralRe: Which is the best C++ ERP development toolkit ? PinmemberStuart Dootson23:36 2 Dec '08  
GeneralRe: Which is the best C++ ERP development toolkit ? Pinmvptoxcct23:37 2 Dec '08  
AnswerRe: Which is the best C++ ERP development toolkit ? Pinmembersumeet1232:27 3 Nov '09  
QuestionDifference between MFC and windows form application Pinmemberfrankis789:10 2 Dec '08  
AnswerRe: Difference between MFC and windows form application Pinmvptoxcct9:29 2 Dec '08  
GeneralRe: Difference between MFC and windows form application Pinmemberfrankis7811:28 2 Dec '08  
GeneralRe: Difference between MFC and windows form application PinmvpRajesh R Subramanian21:33 2 Dec '08  
GeneralRe: Difference between MFC and windows form application Pinmemberfrankis7821:50 2 Dec '08  
AnswerRe: Difference between MFC and windows form application Pinmvpled mike9:44 2 Dec '08  

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

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


Advertise | Privacy | Mobile
Web01 | 2.5.120210.1 | Last Updated 11 Feb 2012
Copyright © CodeProject, 1999-2012
All Rights Reserved. Terms of Use
Layout: fixed | fluid