Click here to Skip to main content
15,914,416 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CryptBuffertoString returning invalid characters Pin
Mark Salsbery22-Jan-07 8:24
Mark Salsbery22-Jan-07 8:24 
AnswerRe: CryptBuffertoString returning invalid characters Pin
Michael Dunn22-Jan-07 7:41
sitebuilderMichael Dunn22-Jan-07 7:41 
GeneralRe: CryptBuffertoString returning invalid characters Pin
vgandhi22-Jan-07 7:48
vgandhi22-Jan-07 7:48 
GeneralRe: CryptBuffertoString returning invalid characters Pin
Michael Dunn22-Jan-07 8:16
sitebuilderMichael Dunn22-Jan-07 8:16 
GeneralRe: CryptBuffertoString returning invalid characters Pin
vgandhi22-Jan-07 8:55
vgandhi22-Jan-07 8:55 
GeneralRe: CryptBuffertoString returning invalid characters Pin
Mark Salsbery22-Jan-07 11:26
Mark Salsbery22-Jan-07 11:26 
GeneralRe: CryptBuffertoString returning invalid characters Pin
vgandhi22-Jan-07 19:00
vgandhi22-Jan-07 19:00 
GeneralRe: CryptBuffertoString returning invalid characters Pin
Mark Salsbery23-Jan-07 7:54
Mark Salsbery23-Jan-07 7:54 
Ok, I'm with you. I think the CryptBinaryToString(() API was meant more for converting binary
into characters that can be used in HTML/XML/etc. Not necessarily to be human-readable.

The problem is that in the encrypted data there's no 'z'. There's just bytes.

You'll need to store the length somehow. An easy way is to reserve the first BYTE/WORD/DWORD
to hold the length of the following encrypted data.

With the length, you can loop through the encrypted bytes, converting each to hex and
appending to a string.

I'm not sure about converting it back to encrypted though. If you allow the user to make
changes then the data won't be able to be unencrypted later.
It doesn't make sense really anyway - how can a user understand encrypted data?

Mark


QuestionDialogBar Pin
samira forooghi21-Jan-07 22:47
samira forooghi21-Jan-07 22:47 
QuestionRe: DialogBar Pin
prasad_som22-Jan-07 2:01
prasad_som22-Jan-07 2:01 
AnswerRe: DialogBar Pin
samira forooghi22-Jan-07 18:03
samira forooghi22-Jan-07 18:03 
QuestionRe: DialogBar Pin
prasad_som24-Jan-07 18:00
prasad_som24-Jan-07 18:00 
QuestionCMOS RAM Pin
pvn g21-Jan-07 22:43
pvn g21-Jan-07 22:43 
QuestionHow to read value in String table from dll Pin
Atul2321-Jan-07 22:35
Atul2321-Jan-07 22:35 
AnswerRe: How to read value in String table from dll Pin
Nibu babu thomas21-Jan-07 23:20
Nibu babu thomas21-Jan-07 23:20 
Questionactivex control not working in a dll Pin
aaaan21-Jan-07 22:09
aaaan21-Jan-07 22:09 
AnswerRe: activex control not working in a dll Pin
nutkase21-Jan-07 23:06
nutkase21-Jan-07 23:06 
QuestionRotation Pin
Waldermort21-Jan-07 21:45
Waldermort21-Jan-07 21:45 
AnswerRe: Rotation Pin
softwaremonkey21-Jan-07 21:54
softwaremonkey21-Jan-07 21:54 
GeneralRe: Rotation Pin
nutkase21-Jan-07 23:11
nutkase21-Jan-07 23:11 
GeneralRe: Rotation Pin
Waldermort21-Jan-07 23:34
Waldermort21-Jan-07 23:34 
GeneralRe: Rotation Pin
nutkase22-Jan-07 1:15
nutkase22-Jan-07 1:15 
GeneralRe: Rotation Pin
softwaremonkey21-Jan-07 23:48
softwaremonkey21-Jan-07 23:48 
GeneralRe: Rotation Pin
Waldermort22-Jan-07 1:24
Waldermort22-Jan-07 1:24 
AnswerRe: Rotation Pin
Waldermort22-Jan-07 1:40
Waldermort22-Jan-07 1:40 

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.