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

# CryptEncrypt(3w)

## NAME

**CryptEncrypt** (ADVAPI32.@)

## SYNOPSIS

BOOL CryptEncrypt\
  (\
   HCRYPTKEY  *hKey*,\
   HCRYPTHASH *hHash*,\
   BOOL       *Final*,\
   DWORD      *dwFlags*,\
   BYTE\*      *pbData*,\
   DWORD\*     *pdwDataLen*,\
   DWORD      *dwBufLen*\
  )

## DESCRIPTION

Encrypts data.

## PARAMS

*hKey* **\[In\]**  Handle to the encryption key.

*hHash* **\[In\]**  Handle to a hash object.

*Final* **\[In\]**  **TRUE** if this is the last section to encrypt.

*dwFlags* **\[In\]**  Can be **CRYPT\_OAEP**.

*pbData* **\[In/Out\]**  Data to be encrypted. Contains encrypted data after call.

*pdwDataLen* **\[In/Out\]**  Length of the data to encrypt. Contains the length of the encrypted data after call.

*dwBufLen* **\[In\]**  Length of the input *pbData* buffer.

## RETURNS

**Success:** **TRUE**

**Failure:** **FALSE**.

## NOTES

If *pbData* is **NULL**, CryptEncrypt determines stores the number of bytes required for the returned data in *pdwDataLen*.

## IMPLEMENTATION

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

Implemented in **"dlls/advapi32/crypt.c"**.

Debug channel **"crypt"**.
