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:
A class that encrypts and decrypts files using Cryptography API Functions
CryptDecrypt
..msdn    Add comment     W32 Constants      Translate this page
Decrypts data previously encrypted using the CryptEncrypt function.
Code examples:
A class that encrypts and decrypts files using Cryptography API Functions
Declaration:
BOOL WINAPI CryptDecrypt(
    HCRYPTKEY hKey,
    HCRYPTHASH hHash,
    BOOL Final,
    DWORD dwFlags,
    BYTE* pbData,
    DWORD* pdwDataLen
);

FoxPro declaration:
DECLARE INTEGER CryptDecrypt IN advapi32;
    INTEGER hKey,;
    INTEGER hHash,;
    INTEGER Final,;
    LONG dwFlags,;
    STRING @pbData,;
    LONG @pdwDataLen

Parameters:
hKey
[in] Handle to the key to use for the decryption. An application obtains this handle by using either the CryptGenKey, CryptDeriveKey or CryptImportKey function.

hHash
[in] Handle to a hash object. If data is to be decrypted and hashed simultaneously, a handle to a hash object is passed in this parameter.

Final
[in] Specifies whether this is the last section in a series being decrypted. This value is TRUE if this is the last or only block.

dwFlags
[in] Currently not used.

pbData
[in, out] Buffer that holds the data to be decrypted. After the decryption has been performed, the plaintext is placed back into this same buffer.

pdwDataLen
[in, out] Pointer to a DWORD value that indicates the length of the pbData buffer. Before calling this function, the calling application sets the DWORD value to the number of bytes to be decrypted.
Return value:
If the function succeeds, the function returns nonzero (TRUE).
My comment:
If a large amount of data is to be decrypted, it can be done in sections. This is done by calling CryptDecrypt repeatedly. The Final parameter must be set to TRUE only on the last call to CryptDecrypt, so the decryption engine can properly finish the decryption process.

See also: CryptEncrypt, CryptCreateHash.
Word Index links for the CryptDecrypt :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2006-04-25 13:22:06
Modified: 2006-04-25 13:27:09
Visited in last 7 days: 13
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2017 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.6.38), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.80.132.10)
12 sec.Function: 'GdipResetWorldTransform'
6 day(s)Function: 'GdipBitmapGetPixel'
 Function: 'GlobalReAlloc'
 Function: 'SwitchDesktop'
 Function: 'ConnectToPrinterDlg'
 Function: 'GetSubMenu'
 Function: 'GetMenuItemCount'
 Function: 'GetProp'
 Function: 'TrackPopupMenuEx'
 Function: 'WinHttpQueryHeaders'
Google
Advertise here!