BeRTOS
Functions
util.c File Reference

Generic utilities. More...

#include "util.h"
#include <sec/kdf/pbkdf2.h>
#include <sec/mac/hmac.h>
#include <sec/hash/sha1.h>

Go to the source code of this file.

Functions

void password2key (const char *pwd, size_t pwd_len, uint8_t *key, size_t key_len)
 Convert a generic "password" (low-diffused) to a generic "key" (high-diffused).

Detailed Description

Generic utilities.

Author:
Giovanni Bajo <rasky@develer.com>

Definition in file util.c.


Function Documentation

void password2key ( const char *  pwd,
size_t  pwd_len,
uint8_t *  key,
size_t  key_len 
)

Convert a generic "password" (low-diffused) to a generic "key" (high-diffused).

In common terminology, a "password" is a key with weak cryptographic characteristics, such as commonly used password input by an user, which are usually short and use only a few different characters from the 0-255 byte range.

This function derives a strong key from the password using a one-way process.

Note:
Uses PBKDF2 as key-derivation function, with a fixed salt that changes for each Bertos project.

Definition at line 48 of file util.c.