This How To describes how to create a custom code access security permission to control programmatic access to unmanaged encryption functionality that Win32 Data Protection API (DPAPI) provides. Use this custom permission with the managed DPAPI wrapper code described in "How To: Create a DPAPI Library," in "Building Secure ASP.NET Applications," in the MSDN Library.