gwenhywfar
4.6.0beta
|
#include <gwenhywfar/gwenhywfarapi.h>
#include <gwenhywfar/buffer.h>
Go to the source code of this file.
Functions | |
GWENHYWFAR_API int | GWEN_SmallTresor_Decrypt (const uint8_t *p, uint32_t len, const char *password, GWEN_BUFFER *dst, int passwordIterations, int cryptIterations) |
GWENHYWFAR_API int | GWEN_SmallTresor_Encrypt (const uint8_t *src, uint32_t slen, const char *password, GWEN_BUFFER *dst, int passwordIterations, int cryptIterations) |
GWENHYWFAR_API int GWEN_SmallTresor_Decrypt | ( | const uint8_t * | p, |
uint32_t | len, | ||
const char * | password, | ||
GWEN_BUFFER * | dst, | ||
int | passwordIterations, | ||
int | cryptIterations | ||
) |
Definition at line 340 of file smalltresor.c.
References _decode(), _decodeData(), BLOWFISH_KEYSIZE, DBG_ERROR, DBG_INFO, GWEN_Buffer_AdjustUsedBytes(), GWEN_Buffer_AllocRoom(), GWEN_Buffer_AppendBytes(), GWEN_Buffer_free(), GWEN_Buffer_GetPosPointer(), GWEN_Buffer_GetStart(), GWEN_Buffer_GetUsedBytes(), GWEN_Buffer_IncrementPos(), GWEN_Buffer_new(), GWEN_ERROR_BAD_DATA, GWEN_ERROR_INVALID, GWEN_LOGDOMAIN, GWEN_MDigest_free(), GWEN_MDigest_PBKDF2(), GWEN_MDigest_Sha256_new(), and GWEN_Padd_UnpaddWithIso9796_2().
Referenced by GWEN_PasswordStore_ReadDecryptFile().
GWENHYWFAR_API int GWEN_SmallTresor_Encrypt | ( | const uint8_t * | src, |
uint32_t | slen, | ||
const char * | password, | ||
GWEN_BUFFER * | dst, | ||
int | passwordIterations, | ||
int | cryptIterations | ||
) |
This function encrypts the given data using the given password. The key for encryption is derived from the given password using the function GWEN_MDigest_PKPDF2.
Definition at line 234 of file smalltresor.c.
References _addRandomBytes(), _encode(), _encodeData(), BLOWFISH_KEYSIZE, DBG_ERROR, GWEN_Buffer_AdjustUsedBytes(), GWEN_Buffer_AllocRoom(), GWEN_Buffer_AppendByte(), GWEN_Buffer_AppendBytes(), GWEN_Buffer_free(), GWEN_Buffer_GetPosPointer(), GWEN_Buffer_GetStart(), GWEN_Buffer_GetUsedBytes(), GWEN_Buffer_IncrementPos(), GWEN_Buffer_new(), GWEN_Crypt_Random(), GWEN_LOGDOMAIN, GWEN_MDigest_free(), GWEN_MDigest_PBKDF2(), GWEN_MDigest_Sha256_new(), and GWEN_Padd_PaddWithIso9796_2().
Referenced by GWEN_PasswordStore_EncryptWriteFile().