Click here to Skip to main content
15,899,025 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: OT: Re: YARP parser Pin
Randor 24-Nov-08 3:48
professional Randor 24-Nov-08 3:48 
AnswerRe: xml parsing in MFC Pin
adam george16-Feb-09 23:52
adam george16-Feb-09 23:52 
QuestionElevating the process to create the file at ACCESS_DENIED Position Pin
VCProgrammer19-Nov-08 19:52
VCProgrammer19-Nov-08 19:52 
AnswerRe: Elevating the process to create the file at ACCESS_DENIED Position Pin
SandipG 19-Nov-08 20:04
SandipG 19-Nov-08 20:04 
Questionhow to change panes in status bar of a dialog box application Pin
puppya19-Nov-08 19:44
puppya19-Nov-08 19:44 
AnswerRe: how to change panes in status bar of a dialog box application Pin
Iain Clarke, Warrior Programmer19-Nov-08 21:54
Iain Clarke, Warrior Programmer19-Nov-08 21:54 
Questiondecrypting a string question [modified] Pin
monsieur_jj19-Nov-08 19:42
monsieur_jj19-Nov-08 19:42 
AnswerRe: decrypting a string question Pin
Randor 19-Nov-08 21:52
professional Randor 19-Nov-08 21:52 
Bonjour JayJay,

Yes that function can be implemented in C++ using Microsoft Cryptographic Service Providers.[^] From looking at the source code you have provided it appears that the function works as follows:

1.) Function is passed a base64 encoded bytes and a boolean.
2.) Decode base64 encoded bytes to a byte array.
3.) Open a "settings reader" and retrieve a key/pair value from key 'SecurityKey'.
4.) if useHashing boolean is true then create a MD5 hash from the "SecurityKey"value.
5.) if useHashing boolean is false then cast the "SecurityKey"value to a UTF8 encoded unicode string.
6.) Decrypt the byte array using the 'Security' key with TripleDES algorithm.

You should research the following funtions from the Microsoft Cryptographic Service.

For Initializing Microsoft Cryptographic Service Providers:
CryptAcquireContext Function[^]

For base64 decoding:
CryptBinaryToString Function
[^]

For computing MD5 hash:
CryptCreateHash Function[^]
CryptDestroyHash Function[^]

For TripleDES:
CryptDeriveKey Function[^]
CryptDecrypt Function[^]
CryptDestroyKey Function[^]

For Releasing Microsoft Cryptographic Service Providers:
CryptReleaseContext Function[^]


Here are some samples:
Encoding and Decoding a Hashed Message[^]
Example C Program: Encoding and Decoding Data[^]

Some sample code from CodeGuru:
http://www.codeguru.com/forum/showthread.php?threadid=464785[^]

Hope it helps!
-David Delaune
GeneralRe: decrypting a string question Pin
monsieur_jj19-Nov-08 22:09
monsieur_jj19-Nov-08 22:09 
GeneralRe: decrypting a string question Pin
CPallini19-Nov-08 22:16
mveCPallini19-Nov-08 22:16 
GeneralRe: decrypting a string question Pin
monsieur_jj20-Nov-08 15:34
monsieur_jj20-Nov-08 15:34 
GeneralRe: decrypting a string question Pin
Randor 20-Nov-08 21:58
professional Randor 20-Nov-08 21:58 
GeneralRe: decrypting a string question [modified] Pin
monsieur_jj20-Nov-08 22:09
monsieur_jj20-Nov-08 22:09 
AnswerRe: decrypting a string question Pin
CPallini19-Nov-08 21:59
mveCPallini19-Nov-08 21:59 
GeneralRe: decrypting a string question Pin
monsieur_jj20-Nov-08 22:05
monsieur_jj20-Nov-08 22:05 
QuestionModifying one cell in a CListCtrl Pin
sunny_vc19-Nov-08 18:58
sunny_vc19-Nov-08 18:58 
AnswerRe: Modifying one cell in a CListCtrl Pin
Hamid_RT19-Nov-08 20:28
Hamid_RT19-Nov-08 20:28 
AnswerRe: Modifying one cell in a CListCtrl Pin
Prasann Mayekar19-Nov-08 20:32
Prasann Mayekar19-Nov-08 20:32 
AnswerRe: Modifying one cell in a CListCtrl Pin
Nishad S19-Nov-08 20:41
Nishad S19-Nov-08 20:41 
GeneralRe: Modifying one cell in a CListCtrl Pin
sunny_vc19-Nov-08 21:37
sunny_vc19-Nov-08 21:37 
GeneralRe: Modifying one cell in a CListCtrl Pin
Nishad S19-Nov-08 22:00
Nishad S19-Nov-08 22:00 
GeneralRe: Modifying one cell in a CListCtrl Pin
sunny_vc19-Nov-08 22:40
sunny_vc19-Nov-08 22:40 
GeneralRe: Modifying one cell in a CListCtrl Pin
Nishad S19-Nov-08 23:06
Nishad S19-Nov-08 23:06 
GeneralRe: Modifying one cell in a CListCtrl Pin
sunny_vc20-Nov-08 22:02
sunny_vc20-Nov-08 22:02 
GeneralRe: Modifying one cell in a CListCtrl Pin
Nishad S20-Nov-08 22:13
Nishad S20-Nov-08 22:13 

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.