ThingWorx C SDK
Functions
crypto_wrapper.h File Reference

Wrapper for libtomcrypt DES encryption functions. More...

Go to the source code of this file.

Functions

int EncryptDES (const unsigned char *key, unsigned char *ct, const unsigned char *pt)
 Encrypts an 8-byte array using DES. More...
 
int DecryptDES (const unsigned char *key, const unsigned char *ct, unsigned char *pt)
 Encrypts an 8-byte array using DES. More...
 
void createDESKey (const uint8_t *bytes, uint8_t *key)
 Creates an 8-byte DES key. More...
 
int MD4Hash (const unsigned char *buf, int length, unsigned char *hash)
 Generates a MD4 Message-Digest Algorithm. More...
 

Detailed Description

Wrapper for libtomcrypt DES encryption functions.

Function Documentation

void createDESKey ( const uint8_t *  bytes,
uint8_t *  key 
)

Creates an 8-byte DES key.

Parameters
[in]bytesTBD
[out]keyA pointer which will store the 8-byte key.
Returns
Nothing.
int DecryptDES ( const unsigned char *  key,
const unsigned char *  ct,
unsigned char *  pt 
)

Encrypts an 8-byte array using DES.

Parameters
[in]keyA pointer to the 8-byte key. [in] ct A pointer to the 8-byte array to be decrypted.
[out]ptA pointer which will store the decrypted data.
Returns
#TW_OK if successful, positive integral on error code (see twErrors.h) if an error was encountered.
int EncryptDES ( const unsigned char *  key,
unsigned char *  ct,
const unsigned char *  pt 
)

Encrypts an 8-byte array using DES.

Parameters
[in]keyA pointer to the 8-byte key. [out] ct A pointer which will store the encrypted data.
[in]ptA pointer to the 8-byte array to be encrypted.
Returns
#TW_OK if successful, positive integral on error code (see twErrors.h) if an error was encountered.
int MD4Hash ( const unsigned char *  buf,
int  length,
unsigned char *  hash 
)

Generates a MD4 Message-Digest Algorithm.

Parameters
[in]bufA buffer containing the hash message.
[in]lengthThe length of
[out]hashA pointer which will store the generated MD4 hash.
Returns
Always returns 0.