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

C / C++ / MFC

 
AnswerRe: CryptBuffertoString returning invalid characters Pin
Mark Salsbery22-Jan-07 7:33
Mark Salsbery22-Jan-07 7:33 
GeneralRe: CryptBuffertoString returning invalid characters Pin
vgandhi22-Jan-07 7:38
vgandhi22-Jan-07 7:38 
GeneralRe: CryptBuffertoString returning invalid characters Pin
Mark Salsbery22-Jan-07 8:02
Mark Salsbery22-Jan-07 8:02 
GeneralRe: CryptBuffertoString returning invalid characters Pin
vgandhi22-Jan-07 8:18
vgandhi22-Jan-07 8:18 
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 
This code works for me:
int main()
{
LPCSTR data = "Some encrypted data goes here...";
LPTSTR pszBase64 = NULL;
DWORD cchString = 0;
 
  CryptBinaryToString ( (const BYTE*) data, strlen(data), CRYPT_STRING_BASE64, NULL, &cchString );
  pszBase64 = (LPTSTR) _alloca ( cchString * sizeof(TCHAR) );
  CryptBinaryToString ( (const BYTE*) data, strlen(data), CRYPT_STRING_BASE64, pszBase64, &cchString );
  wcout << pszBase64 << endl;
  return 0;
}
I get the output:
U29tZSBlbmNyeXB0ZWQgZGF0YSBnb2VzIGhlcmUuLi4=


--Mike--
Visual C++ MVP Cool | :cool:
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ");

Ford, what's this fish doing in my ear?

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 
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 

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.