func: static void goodG2B() wchar_t * cryptoKey ; wchar_t cryptoKeyBuffer [ 100 ] = L "" cryptoKey = cryptoKeyBuffer; size_t cryptoKeyLen = wcslen ( cryptoKey ) ; if ( 100 - cryptoKeyLen > 1 )  if ( fgetws ( cryptoKey + cryptoKeyLen , ( int ) ( 100 - cryptoKeyLen ) , stdin ) == NULL )  cryptoKey [ cryptoKeyLen ] = L '\0' cryptoKeyLen = wcslen ( cryptoKey ); if ( cryptoKeyLen > 0 )  cryptoKey [ cryptoKeyLen - 1 ] = L '\0' CWE321_Hard_Coded_Cryptographic_Key__w32_wchar_t_82_base * baseObject = new CWE321_Hard_Coded_Cryptographic_Key__w32_wchar_t_82_goodG2B baseObject -> action ( cryptoKey ); void CWE321_Hard_Coded_Cryptographic_Key__w32_wchar_t_82_goodG2B::action(wchar_t * cryptoKey) wchar_t toBeEncrypted [ ] = L "String to be encrypted" DWORD encryptedLen = wcslen ( toBeEncrypted ) * sizeof ( wchar_t ) ; memcpy ( encrypted , toBeEncrypted , encryptedLen ); if ( ! CryptEncrypt ( hKey , ( HCRYPTHASH ) NULL , 1 , 0 , encrypted , & encryptedLen , sizeof ( encrypted ) ) )  printBytesLine ( encrypted , encryptedLen ); void printBytesLine(const unsigned char * bytes, size_t numBytes) for (i = 0; i < numBytes; ++i) printf ( "%02x" , bytes [ i ] ); 