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

# CryptDeriveKey(3w)

## NAME

**CryptDeriveKey** (ADVAPI32.@)

## SYNOPSIS

BOOL CryptDeriveKey\
  (\
   HCRYPTPROV *hProv*,\
   ALG\_ID     *Algid*,\
   HCRYPTHASH *hBaseData*,\
   DWORD      *dwFlags*,\
   HCRYPTKEY\* *phKey*\
  )

## DESCRIPTION

Generates session keys derived from a base data value.

## PARAMS

*hProv* **\[In\]**  Handle to a **CSP**.

*Algid* **\[In\]**  Identifies the symmetric encryption algorithm to use.

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

*dwFlags* **\[In\]**  Type of key to generate.

*phKey* **\[In/Out\]**  Address of the newly generated key.

## RETURNS

**Success:** **TRUE**

**Failure:** **FALSE**

## IMPLEMENTATION

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

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

Debug channel **"crypt"**.
