- Data protection API
DPAPI (Data Protection Application Programming Interface) is a simple cryptographic
application programming interface available as a built-in component inWindows 2000 and later versions ofMicrosoft Windows operating system s. 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.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 ad infinitum. 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 "%USERPROFILE%Application DataMicrosoftProtect{SID}", 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 40 bytes of random data.
ecurity properties
DPAPI doesn't store any persistent data for itself; instead, it simply receives plaintext and returns cryptext (or vice-versa).
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. Particular databinary large object s 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 IISweb servers to use DPAPI.Use of DPAPI by Microsoft Products
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 roll their own protection approach or have only recently switched to use DPAPI. For example,
Internet Explorer versions 4.0-6.0,Outlook Express andMSN 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. [cite web
url=http://www.securityfocus.com/infocus/1882/2
title=Password Management Concerns with IE and Firefox, part one
author=Mikhael Felker
date=December 8 2006
accessdate=2007-06-02
publisher=SecurityFocus.com ]*
Encrypting File System in Windows 2000 and later
*Internet Explorer 7 , both in the standalone version available forWindows XP and in the integrated versions available inWindows Vista andWindows Server 2008
*Windows Mail andWindows Live Mail
* Outlook forS/MIME
*Internet Information Services for SSL/TLS
* WindowsRights 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 [http://technet.microsoft.com/en-us/library/bb457059.aspx Stored User Names and Passwords] (aka Credential Manager)
*.NET Framework 2.0 and later for [http://msdn2.microsoft.com/en-us/library/system.security.cryptography.protecteddata.aspx System.Security.Cryptography.ProtectedData]References
External links
* [http://go.microsoft.com/fwlink/?LinkId=89993 Windows Data Protection API (DPAPI) white paper by NAI Labs]
* [http://www.codeproject.com/KB/system/protected_data.aspx Data encryption with DPAPI]
* [http://www.obviex.com/samples/dpapi.aspx Use DPAPI to encrypt and decrypt data]
* [http://msdn.microsoft.com/library/aa302404.aspx How To: Use DPAPI (User Store) from ASP.NET 1.1 with Enterprise Services]
* [http://msdn.microsoft.com/library/system.security.cryptography.protecteddata.aspx System.Security.Cryptography.ProtectedData in .NET Framework 2.0 and later]
* [http://msdn.microsoft.com/library/cc201324.aspx Discussion of the use of MS BackupKey Remote Protocol by DPAPI to protect user secrets]
* [http://msdn.microsoft.com/library/bb432403.aspx The Windows PStore]
Wikimedia Foundation. 2010.