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

C / C++ / MFC

 
AnswerRe: encrypt and decrypt in UNICODE Pin
kiranin18-Jan-07 19:23
kiranin18-Jan-07 19:23 
GeneralRe: encrypt and decrypt in UNICODE Pin
Rajesh R Subramanian18-Jan-07 19:30
professionalRajesh R Subramanian18-Jan-07 19:30 
GeneralRe: encrypt and decrypt in UNICODE Pin
kiranin18-Jan-07 19:35
kiranin18-Jan-07 19:35 
GeneralRe: encrypt and decrypt in UNICODE Pin
Rajesh R Subramanian18-Jan-07 19:57
professionalRajesh R Subramanian18-Jan-07 19:57 
GeneralRe: encrypt and decrypt in UNICODE Pin
kiranin18-Jan-07 20:04
kiranin18-Jan-07 20:04 
GeneralRe: encrypt and decrypt in UNICODE Pin
Rajesh R Subramanian18-Jan-07 20:07
professionalRajesh R Subramanian18-Jan-07 20:07 
GeneralRe: encrypt and decrypt in UNICODE Pin
Mark Salsbery19-Jan-07 5:59
Mark Salsbery19-Jan-07 5:59 
GeneralRe: encrypt and decrypt in UNICODE Pin
Mark Salsbery19-Jan-07 6:06
Mark Salsbery19-Jan-07 6:06 
How is this going to work:

dwLength = sizeof(TCHAR)*_tcslen(szEncryptPwd);

If szEncryptPwd is encrypted there's not necessarily an ASCIIZ at the end so _tcslen()
won't work. You need a way to store the encrypted length somewhere or use a pre-defined length.

*EDIT* The encrypt side looks ok but the decrypt isn't going to work as coded.
Also, not all encryption algorithms produce the same number of encrypted bytes as unencrypted
source bytes, but you've assumed that in your encryption function. Be careful Smile | :)
You can check the size required with an extra call to CryptEncrypt() with the pbData param set to
NULL.

Mark

GeneralRe: encrypt and decrypt in UNICODE Pin
Mark Salsbery19-Jan-07 6:19
Mark Salsbery19-Jan-07 6:19 
QuestionUSB Drive Pin
radhika2818-Jan-07 17:57
radhika2818-Jan-07 17:57 
AnswerRe: USB Drive Pin
Michael Dunn18-Jan-07 19:47
sitebuilderMichael Dunn18-Jan-07 19:47 
Questioncmd.exe bug / GetFileType from kernel mode Pin
Mike_V18-Jan-07 16:20
Mike_V18-Jan-07 16:20 
Questionhelp returning data from DLL Pin
Calvin Streeting18-Jan-07 13:36
Calvin Streeting18-Jan-07 13:36 
QuestionRe: help returning data from DLL Pin
prasad_som18-Jan-07 17:30
prasad_som18-Jan-07 17:30 
AnswerRe: help returning data from DLL Pin
Calvin Streeting18-Jan-07 22:00
Calvin Streeting18-Jan-07 22:00 
QuestionProblem with my code - cant fine what wrong - please need help. Pin
Yanshof18-Jan-07 12:12
Yanshof18-Jan-07 12:12 
AnswerRe: Problem with my code - cant fine what wrong - please need help. Pin
Stephen Hewitt18-Jan-07 12:17
Stephen Hewitt18-Jan-07 12:17 
GeneralRe: Problem with my code - cant fine what wrong - please need help. Pin
prasad_som18-Jan-07 17:33
prasad_som18-Jan-07 17:33 
GeneralRe: Problem with my code - cant fine what wrong - please need help. Pin
Yanshof18-Jan-07 21:03
Yanshof18-Jan-07 21:03 
QuestionRe: Problem with my code - cant fine what wrong - please need help. Pin
prasad_som18-Jan-07 21:26
prasad_som18-Jan-07 21:26 
AnswerRe: Problem with my code - cant fine what wrong - please need help. Pin
Yanshof18-Jan-07 21:26
Yanshof18-Jan-07 21:26 
GeneralRe: Problem with my code - cant fine what wrong - please need help. Pin
prasad_som18-Jan-07 21:44
prasad_som18-Jan-07 21:44 
GeneralRe: Problem with my code - cant fine what wrong - please need help. Pin
Yanshof18-Jan-07 21:56
Yanshof18-Jan-07 21:56 
GeneralRe: Problem with my code - cant fine what wrong - please need help. Pin
prasad_som18-Jan-07 22:00
prasad_som18-Jan-07 22:00 
QuestionHow can I pass a pointer to a VARIANT to a function? Pin
Joan M18-Jan-07 10:35
professionalJoan M18-Jan-07 10:35 

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.