---
name: "CryptProtectData"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/CryptProtectData"
---

# CryptProtectData(3w)

## NAME

**CryptProtectData** (CRYPT32.@)

## SYNOPSIS

BOOL CryptProtectData\
  (\
   DATA\_BLOB\*                 *pDataIn*,\
   LPCWSTR                    *szDataDescr*,\
   DATA\_BLOB\*                 *pOptionalEntropy*,\
   PVOID                      *pvReserved*,\
   CRYPTPROTECT\_PROMPTSTRUCT\* *pPromptStruct*,\
   DWORD                      *dwFlags*,\
   DATA\_BLOB\*                 *pDataOut*\
  )

## DESCRIPTION

Generate Cipher data from given Plain and Entropy data.

## PARAMS

*pDataIn* **\[In\]**  Plain data to be enciphered.

*szDataDescr* **\[In\]**  Optional Unicode string describing the Plain data.

*pOptionalEntropy* **\[In\]**  Optional entropy data to adjust cipher, can be **NULL**.

*pvReserved* **\[In\]**  Reserved, must be **NULL**.

*pPromptStruct* **\[In\]**  Structure describing if/how to prompt during ciphering.

*dwFlags* **\[In\]**  Flags describing options to the ciphering.

*pDataOut* **\[Out\]**  Resulting Cipher data, for calls to CryptUnprotectData.

## RETURNS

**TRUE** If a Cipher was generated. **FALSE** If something failed and no Cipher is available.

## FIXME

The **TRUE** Windows(tm) encryption and keying mechanisms are unknown.

*dwFlags* and *pPromptStruct* are currently ignored.

## NOTES

Memory allocated in *pDataOut* must be freed with LocalFree.

## IMPLEMENTATION

Declared in **"wincrypt.h"**.

Implemented in **"dlls/crypt32/protectdata.c"**.

Debug channel **"crypt"**.
