Data Protection API

Short description: Windows API for cryptography

Data Protection Application Programming Interface (DPAPI) is a simple cryptographic application programming interface available as a built-in component in Windows 2000 and later versions of Microsoft Windows operating systems. In theory, the Data Protection API can enable symmetric encryption of any kind of data; in practice, its primary use in the Windows operating system is to perform symmetric encryption of asymmetric private keys, using a user or system secret as a significant contribution of entropy. A detailed analysis of DPAPI inner-workings was published in 2011 by Bursztein et al.[1]

For nearly all cryptosystems, one of the most difficult challenges is "key management" - in part, how to securely store the decryption key. If the key is stored in plain text, then any user that can access the key can access the encrypted data. If the key is to be encrypted, another key is needed, and so on. DPAPI allows developers to encrypt keys using a symmetric key derived from the user's logon secrets, or in the case of system encryption, using the system's domain authentication secrets.

The DPAPI keys used for encrypting the user's RSA keys are stored under `%APPDATA%\Microsoft\Protect\{SID}` directory, where {SID} is the Security Identifier of that user. The DPAPI key is stored in the same file as the master key that protects the users private keys. It usually is 64 bytes of random data.

## Contents

* 1 Security properties
* 2 Active Directory backup keys
* 3 Use of DPAPI by Microsoft software
* 4 References
* 5 External links

## Security properties

DPAPI doesn't store any persistent data for itself; instead, it simply receives plaintext and returns ciphertext (or conversely).

DPAPI security relies upon the Windows operating system's ability to protect the master key and RSA private keys from compromise, which in most attack scenarios is most highly reliant on the security of the end user's credentials. A main encryption/decryption key is derived from user's password by PBKDF2 function.[2] Particular data binary large objects can be encrypted in a way that salt is added and/or an external user-prompted password (aka "Strong Key Protection") is required. The use of a salt is a per-implementation option - i.e. under the control of the application developer - and is not controllable by the end user or system administrator.

Delegated access can be given to keys through the use of a COM+ object. This enables IIS web servers to use DPAPI.

## Active Directory backup keys

When a computer is a member of a domain, DPAPI has a backup mechanism to allow data deprotection in case the user's password is lost, which is named "Credential Roaming". When installing a new domain on a domain controller, a public and private key pair is generated, associated with DPAPI. When a master key is generated on a client workstation, the client communicates through an authenticated RPC call with a domain controller to retrieve a copy of the domain's public key. The client encrypts the master key with the domain controller's public key. Finally, it stores this new backup master key in its AppData directory, just like traditional master key storage.

## Use of DPAPI by Microsoft software

While not universally implemented in all Microsoft products, the use of DPAPI by Microsoft products has increased with each successive version of Windows. However, many applications from Microsoft and third-party developers still prefer to use their own protection approach or have only recently switched to use DPAPI. For example, Internet Explorer versions 4.0–6.0, Outlook Express and MSN Explorer used the older Protected Storage (PStore) API to store saved credentials such as passwords etc. Internet Explorer 7 now protects stored user credentials using DPAPI.[3]

* Picture password, PIN and fingerprint in Windows 8
* Encrypting File System in Windows 2000 and later
* SQL Server Transparent Data Encryption (TDE) Service Master Key encryption[4]
* Internet Explorer 7, both in the standalone version available for Windows XP and in the integrated versions available in Windows Vista and Windows Server 2008
* Microsoft Edge
* Windows Mail and Windows Live Mail
* Outlook for S/MIME
* Internet Information Services for SSL/TLS
* Windows Rights Management Services client v1.1 and later
* Windows 2000 and later for EAP/TLS (VPN authentication) and 802.1x (WiFi authentication)
* Windows XP and later for stored user names and passwords[5] (aka Credential Manager)
* .NET Framework 2.0 and later for System.Security.Cryptography.ProtectedData[6]
* Microsoft.Owin (Katana) authentication by default when self-hosting (including cookie authentication and OAuth tokens)[7][8]

## References

1. ↑ Bursztein, Elie; Picod, Jean Michel (2010). "Recovering Windows secrets and EFS certificates offline". Usenix. https://elie.net/publication/recovering-windows-secrets-and-efs-certificates-offline/.
2. ↑ "Windows Password Recovery – DPAPI Master Key analysis". http://www.passcape.com/windows_password_recovery_dpapi_master_key.
3. ↑ Mikhael Felker (December 8, 2006). "Password Management Concerns with IE and Firefox, part one". SecurityFocus.com, Symantec.com. https://community.broadcom.com/symantecenterprise/communities/community-home/librarydocuments/viewdocument?DocumentKey=cd572045-0dfe-4b49-9df6-578cbc441ce5&CommunityKey=1ecf5f55-9545-44d6-b0f4-4e4a7f5f5e68&tab=librarydocuments.
4. ↑ "Encryption Hierarchy". April 2012. https://msdn.microsoft.com/en-us/library/ms189586(v=sql.110).aspx.
5. ↑ "What's New in Security for Windows XP Professional and Windows XP Home Edition". 11 September 2009. https://technet.microsoft.com/en-us/library/bb457059.aspx.
6. ↑ "ProtectedData Class (System.Security.Cryptography)". http://msdn2.microsoft.com/en-us/library/system.security.cryptography.protecteddata.aspx.
7. ↑ "CookieAuthenticationOptions.TicketDataFormat Property (Microsoft.Owin.Security.Cookies)". http://msdn.microsoft.com/en-us/library/microsoft.owin.security.cookies.cookieauthenticationoptions.ticketdataformat(v=vs.113).aspx.
8. ↑ "OAuthAuthorizationServerOptions.AccessTokenFormat Property (Microsoft.Owin.Security.OAuth)". 27 October 2015. http://msdn.microsoft.com/en-us/library/microsoft.owin.security.oauth.oauthauthorizationserveroptions.accesstokenformat(v=vs.113).aspx.

## External links

* "Le fonctionnement de DPAPI par Processus Thief". 2022-10-20. https://lestutosdeprocessus.fr/dechiffrement-dpapi.html.
* Windows Data Protection API (DPAPI) white paper by NAI Labs
* Data encryption with DPAPI
* How To: Use DPAPI (User Store) from ASP.NET 1.1 with Enterprise Services
* System.Security.Cryptography.ProtectedData in .NET Framework 2.0 and later
* Discussion of the use of MS BackupKey Remote Protocol by DPAPI to protect user secrets
* The Windows PStore

* v
* t
* e

Microsoft APIs and frameworks

Graphics|

* Desktop Window Manager
* Direct2D
* Direct3D
* D3D (extensions)
* GDI / GDI+
* WPF
* Silverlight
* WinRT XAML
* Windows Color System
* Windows Image Acquisition
* Windows Imaging Component
* DirectX Graphics Infrastructure (DXGI)
* Windows Advanced Rasterization Platform
* WinG

Audio|

* DirectMusic
* DirectSound
* DirectX plugin
* XACT
* Speech API
* XAudio2

Multimedia|

* DirectX
* Media Objects
* Video Acceleration
* Xinput
* DirectInput
* DirectShow
* Image Mastering API
* Managed DirectX
* Media Foundation
* XNA
* Windows Media
* Video for Windows

Web|

* MSHTML
* RSS Platform
* JScript
* VBScript
* BHO
* XDR
* SideBar Gadgets
* TypeScript

Data access|

* Data Access Components (MDAC)
* ADO
* ADO.NET
* ODBC
* OLE DB
* Extensible Storage Engine
* Entity Framework
* Sync Framework
* Jet Engine
* MSXML
* OPC

Networking|

* Winsock
* LSP
* Winsock Kernel
* Filtering Platform
* NDIS
* Windows Rally
* BITS
* P2P API
* MSMQ
* MS MPI
* DirectPlay

Communication|

* Messaging API
* Telephony API
* WCF

Administration and
management|

* Win32 console
* Windows Script Host
* WMI (extensions)
* PowerShell
* Task Scheduler
* Offline Files
* Shadow Copy
* Windows Installer
* Error Reporting
* Event Log
* Common Log File System

Component model|

* COM
* COM+
* ActiveX
* Distributed Component Object Model
* .NET Framework

Libraries|

* Framework Class Library
* Microsoft Foundation Classes (MFC)
* Active Template Library (ATL)
* Windows Template Library (WTL)

Device drivers|

* WDM
* WDF
* KMDF
* UMDF
* WDDM
* NDIS
* UAA
* BDA
* VxD

Security|

* Crypto API
* CAPICOM
* Windows CardSpace
* Data Protection API
* Security Support Provider Interface (SSPI)

.NET|

* ASP.NET
* ADO.NET
* Remoting
* Silverlight
* TPL
* WCF
* WCS
* WPF
* WF

Software factories|

* EFx Factory
* Enterprise Library
* Composite UI
* CCF
* CSF

IPC|

* MSRPC
* Dynamic Data Exchange (DDE)
* Remoting
* WCF

Accessibility|

* Active Accessibility
* UI Automation

Text and multilingual
support|

* DirectWrite
* Text Services Framework
* Text Object Model
* Input method editor
* Language Interface Pack
* Multilingual User Interface
* Uniscribe

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Data Protection API. Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Software:Data_Protection_API&oldid=3951620"
*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template