cryptsetup API
Public cryptsetup API
|
Data Structures | |
struct | crypt_pbkdf_type |
Macros | |
#define | CRYPT_RNG_URANDOM 0 |
#define | CRYPT_RNG_RANDOM 1 |
#define | CRYPT_PBKDF_ITER_TIME_SET (UINT32_C(1) << 0) |
#define | CRYPT_PBKDF_NO_BENCHMARK (UINT32_C(1) << 1) |
#define | CRYPT_KDF_PBKDF2 "pbkdf2" |
#define | CRYPT_KDF_ARGON2I "argon2i" |
#define | CRYPT_KDF_ARGON2ID "argon2id" |
Functions | |
void | crypt_set_rng_type (struct crypt_device *cd, int rng_type) |
int | crypt_get_rng_type (struct crypt_device *cd) |
int | crypt_set_pbkdf_type (struct crypt_device *cd, const struct crypt_pbkdf_type *pbkdf) |
const struct crypt_pbkdf_type * | crypt_get_pbkdf_type_params (const char *pbkdf_type) |
const struct crypt_pbkdf_type * | crypt_get_pbkdf_default (const char *type) |
const struct crypt_pbkdf_type * | crypt_get_pbkdf_type (struct crypt_device *cd) |
void | crypt_set_iteration_time (struct crypt_device *cd, uint64_t iteration_time_ms) |
int | crypt_memory_lock (struct crypt_device *cd, int lock) __attribute__((deprecated)) |
int | crypt_metadata_locking (struct crypt_device *cd, int enable) |
int | crypt_set_metadata_size (struct crypt_device *cd, uint64_t metadata_size, uint64_t keyslots_size) |
int | crypt_get_metadata_size (struct crypt_device *cd, uint64_t *metadata_size, uint64_t *keyslots_size) |
#define CRYPT_KDF_ARGON2I "argon2i" |
Argon2i according to RFC
#define CRYPT_KDF_ARGON2ID "argon2id" |
Argon2id according to RFC
#define CRYPT_KDF_PBKDF2 "pbkdf2" |
PBKDF2 according to RFC2898, LUKS1 legacy
#define CRYPT_PBKDF_ITER_TIME_SET (UINT32_C(1) << 0) |
Iteration time set by crypt_set_iteration_time(), for compatibility only.
#define CRYPT_PBKDF_NO_BENCHMARK (UINT32_C(1) << 1) |
Never run benchmarks or limit by system resources, use pre-set values or defaults.
#define CRYPT_RNG_RANDOM 1 |
CRYPT_RNG_RANDOM - use /dev/random (waits if no entropy in system)
#define CRYPT_RNG_URANDOM 0 |
CRYPT_RNG_URANDOM - use /dev/urandom
int crypt_get_metadata_size | ( | struct crypt_device * | cd, |
uint64_t * | metadata_size, | ||
uint64_t * | keyslots_size | ||
) |
Get metadata header area sizes. This applies only to LUKS2. These values limit amount of metadata anf number of supportable keyslots.
cd | crypt device handle |
metadata_size | size in bytes of JSON area + 4k binary header |
keyslots_size | size in bytes of binary keyslots area |
const struct crypt_pbkdf_type * crypt_get_pbkdf_default | ( | const char * | type | ) |
Get default PBKDF (Password-Based Key Derivation Algorithm) settings for keyslots. Works only with LUKS device handles (both versions).
type | type of device (see crypt-type) |
const struct crypt_pbkdf_type * crypt_get_pbkdf_type | ( | struct crypt_device * | cd | ) |
Get current PBKDF (Password-Based Key Derivation Algorithm) settings for keyslots. Works only with LUKS device handles (both versions).
cd | crypt device handle |
const struct crypt_pbkdf_type * crypt_get_pbkdf_type_params | ( | const char * | pbkdf_type | ) |
Get PBKDF (Password-Based Key Derivation Algorithm) parameters.
pbkdf_type | type of PBKDF |
int crypt_get_rng_type | ( | struct crypt_device * | cd | ) |
Get which RNG (random number generator) is used for generating long term key.
cd | crypt device handle |
int crypt_memory_lock | ( | struct crypt_device * | cd, |
int | lock | ||
) |
Helper to lock/unlock memory to avoid swap sensitive data to disk. Deprecated, only for backward compatibility. Memory with keys are locked automatically.
cd | crypt device handle, can be NULL |
lock | 0 to unlock otherwise lock memory |
int crypt_metadata_locking | ( | struct crypt_device * | cd, |
int | enable | ||
) |
Set global lock protection for on-disk metadata (file-based locking).
cd | crypt device handle, can be NULL |
enable | 0 to disable locking otherwise enable it (default) |
void crypt_set_iteration_time | ( | struct crypt_device * | cd, |
uint64_t | iteration_time_ms | ||
) |
Set how long should cryptsetup iterate in PBKDF2 function. Default value heads towards the iterations which takes around 1 second. Deprecated, only for backward compatibility. Use crypt_set_pbkdf_type.
cd | crypt device handle |
iteration_time_ms | the time in ms |
int crypt_set_metadata_size | ( | struct crypt_device * | cd, |
uint64_t | metadata_size, | ||
uint64_t | keyslots_size | ||
) |
Set metadata header area sizes. This applies only to LUKS2. These values limit amount of metadata anf number of supportable keyslots.
cd | crypt device handle, can be NULL |
metadata_size | size in bytes of JSON area + 4k binary header |
keyslots_size | size in bytes of binary keyslots area |
int crypt_set_pbkdf_type | ( | struct crypt_device * | cd, |
const struct crypt_pbkdf_type * | pbkdf | ||
) |
Set default PBKDF (Password-Based Key Derivation Algorithm) for next keyslot about to get created with any crypt_keyslot_add_*() call.
cd | crypt device handle |
pbkdf | PBKDF parameters |
void crypt_set_rng_type | ( | struct crypt_device * | cd, |
int | rng_type | ||
) |
Set which RNG (random number generator) is used for generating long term key
cd | crypt device handle |
rng_type | kernel random number generator to use |