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
CryptEncrypt
..msdn    Add comment     W32 Constants      Translate this page
Encrypts data. The algorithm used to encrypt the data is designated by the key held by the CSP module and is referenced by the hKey parameter.
Code examples:
A class that encrypts and decrypts files using Cryptography API Functions
Declaration:
BOOL WINAPI CryptEncrypt(
    HCRYPTKEY hKey,
    HCRYPTHASH hHash,
    BOOL Final,
    DWORD dwFlags,
    BYTE* pbData,
    DWORD* pdwDataLen,
    DWORD dwBufLen
);
FoxPro declaration:
DECLARE INTEGER CryptEncrypt IN advapi32;
    INTEGER hKey,;
    INTEGER hHash,;
    INTEGER Final,;
    LONG dwFlags,;
    STRING @pbData,;
    LONG @pdwDataLen,;
    LONG dwBufLen

Parameters:
hKey
[in] The handle to the encryption key. An application obtains this handle by using either the CryptGenKey or the CryptImportKey function.

hHash
[in] The handle to a hash object.

Final
[in] A Boolean value that specifies whether this is the last section in a series being encrypted.

dwFlags
[in] Predefined value, can be zero.

pbData
[in, out] A pointer to a buffer that contains the plaintext to be encrypted. The plaintext in this buffer is overwritten with the ciphertext created by this function.

pdwDataLen
[in, out] A pointer to a DWORD value that , on entry, contains the length, in bytes, of the plaintext in the pbData buffer. On exit, this DWORD contains the length, in bytes, of the ciphertext written to the pbData buffer.

dwBufLen
[in] Specifies the total size, in bytes, of the input pbData buffer.
Return value:
If the function succeeds, the function returns TRUE.
My comment:
If a large amount of data is to be encrypted, it can be done in sections by calling CryptEncrypt repeatedly. The Final parameter is set to TRUE on the last call to CryptEncrypt so that the encryption engine can properly finish the encryption process.
Word Index links for the CryptEncrypt :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2006-04-21 18:17:03
Modified: 2006-04-21 18:20:44
Visited in last 7 days: 14
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.37), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.225.47.94)
7 sec.Function: 'GetPrivateProfileString'
14 sec.Function: 'CopyIcon'
20 sec.Function: 'GetOpenFileName'
27 sec.Function: 'SetErrorMode'
33 sec.Function: 'GetRgnBox'
39 sec.Function: 'WSAEnumProtocols'
46 sec.Function: 'CreateRectRgn'
53 sec.
Function group: 'Internet Functions (WinInet)'
1.02 min.Function: 'SQLConnect'
1.13 min.Function: 'MoveFileTransacted'
Google
Advertise here!