Using Win32 functions in Visual FoxPro Image Gallery
Cryptography Reference
..msdn
CertCloseStore
CertFindCertificateInStore
CertFreeCertificateContext
CertOpenSystemStore
CryptAcquireContext
CryptBinaryToString
CryptCreateHash
CryptDecrypt
CryptDeriveKey
CryptDestroyHash
CryptDestroyKey
CryptEncrypt
CryptEnumProviders
CryptEnumProviderTypes
CryptExportKey
CryptGenKey
CryptGenRandom
CryptGetDefaultProvider
CryptGetHashParam
CryptGetKeyParam
CryptGetProvParam
CryptHashData
CryptImportKey
CryptProtectData
CryptReleaseContext
CryptStringToBinary
CryptUnprotectData
WinVerifyTrust
Code examples:
CryptProtectData
..msdn    Add comment     W32 Constants      Translate this page
Performs encryption on the data in a DATA_BLOB structure. Scoped to local computer, or to user credentials.
Code examples:
Declaration:
BOOL WINAPI CryptProtectData(
  __in      DATA_BLOB *pDataIn,
  __in      LPCWSTR szDataDescr,
  __in      DATA_BLOB *pOptionalEntropy,
  __in      PVOID pvReserved,
  __in_opt  CRYPTPROTECT_PROMPTSTRUCT *pPromptStruct,
  __in      DWORD dwFlags,
  __out     DATA_BLOB *pDataOut
);
FoxPro declaration:
DECLARE INTEGER CryptProtectData IN crypt32;
    INTEGER pDataIn,;
    STRING szDataDescr,;
    INTEGER pOptionalEntropy,;
    INTEGER pvReserved,;
    STRING @pPromptStruct,;
    LONG dwFlags,;
    INTEGER @pDataOut
Parameters:
pDataIn [in]
A pointer to a DATA_BLOB structure that contains the plaintext to be encrypted.

szDataDescr [in]
A string with a readable description of the data to be encrypted.

pOptionalEntropy [in]
A pointer to a DATA_BLOB structure that contains a password or other additional entropy used to encrypt the data.

pvReserved [in]
Reserved for future use and must be set to NULL.

pPromptStruct [in, optional]
A pointer to a CRYPTPROTECT_PROMPTSTRUCT structure that provides information about where and when prompts are to be displayed.

dwFlags [in]
This parameter can be one of several predefined flags.

pDataOut [out]
A pointer to a DATA_BLOB structure that receives the encrypted data.
Return value:
If the function succeeds, the function returns TRUE.
My comment:
A user with a roaming profile can decrypt the data from another computer on the network.

Otherwise, the encryption and decryption must be done on the same computer. Possibly can get even more limited, when only a user with the same logon credential as the user who encrypted the data can decrypt the data.

When no longer required, the pbData member is to be freed by calling the LocalFree function.

See also: CryptUnprotectData, CryptProtectMemory, CryptUnprotectMemory
Word Index links for the CryptProtectData :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2010-08-23 11:02:12
Modified: 2010-08-23 11:16:01
Visited in last 7 days: 13
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2014 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.1.68), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Google
Advertise here!