Click here to Skip to main content
15,922,007 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: DES Encryption Pin
Richard MacCutchan15-Dec-11 23:40
mveRichard MacCutchan15-Dec-11 23:40 
AnswerRe: DES Encryption Pin
Richard MacCutchan16-Dec-11 1:16
mveRichard MacCutchan16-Dec-11 1:16 
GeneralRe: DES Encryption Pin
jkirkerx16-Dec-11 7:19
professionaljkirkerx16-Dec-11 7:19 
GeneralRe: DES Encryption Pin
Richard MacCutchan16-Dec-11 7:40
mveRichard MacCutchan16-Dec-11 7:40 
GeneralRe: DES Encryption Pin
Randor 16-Dec-11 7:59
professional Randor 16-Dec-11 7:59 
GeneralRe: DES Encryption Pin
jkirkerx16-Dec-11 8:12
professionaljkirkerx16-Dec-11 8:12 
GeneralRe: DES Encryption Pin
jkirkerx16-Dec-11 9:00
professionaljkirkerx16-Dec-11 9:00 
GeneralRe: DES Encryption Pin
Randor 16-Dec-11 9:41
professional Randor 16-Dec-11 9:41 
GeneralRe: DES Encryption Pin
jkirkerx16-Dec-11 10:31
professionaljkirkerx16-Dec-11 10:31 
GeneralRe: DES Encryption Pin
Randor 16-Dec-11 11:04
professional Randor 16-Dec-11 11:04 
GeneralRe: DES Encryption Pin
jkirkerx16-Dec-11 12:06
professionaljkirkerx16-Dec-11 12:06 
GeneralRe: DES Encryption Pin
Randor 16-Dec-11 13:25
professional Randor 16-Dec-11 13:25 
GeneralRe: DES Encryption Pin
jkirkerx17-Dec-11 8:05
professionaljkirkerx17-Dec-11 8:05 
GeneralRe: DES Encryption Pin
Randor 17-Dec-11 9:47
professional Randor 17-Dec-11 9:47 
GeneralRe: DES Encryption Pin
jkirkerx17-Dec-11 20:49
professionaljkirkerx17-Dec-11 20:49 
GeneralRe: DES Encryption Pin
Randor 18-Dec-11 3:55
professional Randor 18-Dec-11 3:55 
GeneralRe: DES Encryption Pin
jkirkerx18-Dec-11 8:32
professionaljkirkerx18-Dec-11 8:32 
GeneralRe: DES Encryption Pin
Randor 18-Dec-11 11:29
professional Randor 18-Dec-11 11:29 
GeneralRe: DES Encryption Pin
jkirkerx18-Dec-11 14:18
professionaljkirkerx18-Dec-11 14:18 
GeneralRe: DES Encryption Pin
Randor 19-Dec-11 6:19
professional Randor 19-Dec-11 6:19 
GeneralRe: DES Encryption Pin
jkirkerx19-Dec-11 8:06
professionaljkirkerx19-Dec-11 8:06 
GeneralRe: DES Encryption Pin
Randor 19-Dec-11 8:29
professional Randor 19-Dec-11 8:29 
GeneralRe: DES Encryption Pin
jkirkerx19-Dec-11 8:47
professionaljkirkerx19-Dec-11 8:47 
GeneralRe: DES Encryption Pin
jkirkerx19-Dec-11 9:30
professionaljkirkerx19-Dec-11 9:30 
This was my interpretation of the advice. I'll take it for a test run, if good, I need to figure out how to code the key.

CSS
BYTE DesKeyBlob_64[] = {
0x08,0x02,0x00,0x00,0x01,0x66,0x00,0x00, // BLOB header
0x08,0x00,0x00,0x00,                     // key length, in bytes
0xf1,0x0e,0x25,0x7c,0x6b,0xce,0x0d,0x34  // DES key with parity
};

// My Keys
BYTE    KEY_64[8]   = {42, 16, 93, 156, 78, 4, 218, 32};
BYTE    IV_64[8]    = {55, 103, 246, 79, 36, 99, 167, 3};

<pre>
// Aquire a handle to the Encryption provider
bResult = CryptAcquireContextW( &hProv, 0, MS_ENHANCED_PROV, PROV_RSA_FULL, 0);
	
// hProv - Set the Key
bResult = CryptImportKey(hProv, DesKeyBlob_64, sizeof(DesKeyBlob_64), 0, CRYPT_EXPORTABLE, &hKey);

// hProv - Set the Algorithm
bResult = CryptSetKeyParam(hKey, KP_ALGID, (BYTE*)CALG_DES, 0);
			
// hProv - IV
bResult = CryptSetKeyParam(hKey, KP_IV, IV_64, 0);




GeneralRe: DES Encryption Pin
Randor 19-Dec-11 10:36
professional Randor 19-Dec-11 10:36 

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.