CryptoDataUtility
The CryptoDataUtility
allows the user to decrypt a string without specifying the keyName. To accomplish this, the cipher text, at the time of encryption, is bundled with the same meta data, of the key, which was used for encryption.
On installing CADP for C:
For Linux, the
libCryptoDataUtility.so
gets installed in the "CADP_for_C" directory.For Windows, the
CryptoDataUtility.dll
gets installed in the "C:\Program Files\CipherTrust\CADP_for_C" directory.
The user must explicitly add reference of libCryptoDataUtility.so
to the application.
Supported Platforms
The CryptoDataUtility is supported on the following platforms:
- Windows Server
Supported Algorithms
Currently, this utility supports only AES algorithm.
Supported APIs
Encrypt
keyName: name of the key
inData: input data to encrypt
datalen: length of inData
outdata: Address of unallocated buffer, please set *outdata = NULL before passing it
sess : An CAPI open session
Return: length of outdata and 0 in case of error
int Encrypt(char* keyName ,unsigned char* inData, unsigned int datalen, unsigned char**outdata ,I_O_Session sess) ;
Note
Encrypt returns the bundled cipher text (i.e. cipher text with key metadata)
Decrypt
inData: input data, this is the value filled in outdata parameter of Encrypt() API
length: Length of inData, returned by Encrypt()
outputData: Address of unallocated buffer, please set *outputData = NULL before sending it.
sess: An CAPI open session
freeIndata: set to 0 - user will free inData, set to 1 - Decrypt() will free it
Return: length of outputData and 0 in case of error