I'm working in VC++ 6 and trying to encrypt a string using just plain old DES. The code encrypts the string ok, but its not the correct value I should be getting.

I'm using this DES calculator to check my output and it is where the correct output came from and from other sources I know it is valid. I already have some other code that works for des encryption but I wanted to see if this is possible.

http://www.adfa.oz.au/~lpb/src/DEScalc/DEScalc.html

Input: 3031323334353637 // "01234567"
Key: 74657374696E6731 // "testing1"
Correct out: e1f077a034ebdf8e
Output CryptoAPI's give: ceae0b0456d90e0d

Not sure whats going wrong. I was told by someone else it might be doing authentication and not actual encryption. Any info would be appreciated!

Code:
void crypto_wrapup() {
    if(hCryptProv) CryptReleaseContext(hCryptProv, 0);
    hCryptProv = 0;
}


BOOL DES_Encrypt(LPBYTE bData, LPBYTE bKey, DWORD dwKeyLen ){
	if(!CryptCreateHash(hCryptProv, CALG_MD5, 0, 0, &hHash))  // Create a hash object.
		return FALSE;
	if(!CryptHashData(hHash, bKey, dwKeyLen, 0))  // Call CryptHashData.
		return FALSE;
	if(!CryptDeriveKey(hCryptProv, CALG_DES, hHash, KEY_LENGTH, &hDESKey))
		return FALSE;
	if(!CryptEncrypt(hDESKey, 0, FALSE, 0, bData, &dwKeyLen, 8)) // correct value: e1f077a034ebdf8e
		return FALSE;
	return TRUE;
}

int main(int argc, char *argv[])
{
	printf("Crypt Test\n\n");
    
	if(crypto_startup()){
		BYTE  bKey[9] = { 0x74, 0x65, 0x73, 0x74, 0x69, 0x6E, 0x67, 0x31, 0x00 };  // Encryption/Decryption Key  ; 74657374696E6731
		BYTE bData[9] = { 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x00 };  // Data to be Encrypted       ; 3031323334353637
		DWORD dwDataLen = 8;  // Size of Key 
		DES_Encrypt(bData, bKey, dwDataLen);	
	}
	return 0;
}