libluksde(3)

๐Ÿ“ฆ
this version ยท 2 versions
, in debian trixie, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

๐Ÿ’– libluksde โ€” the manual page, bestie edition ๐Ÿ’–

okay so you know how some disks are like "bestie I'm encrypted, you're not getting in without a key"? That's LUKS, and this is libluksde(3), the library that lets your code peek inside the Linux Unified Key Setup (LUKS) Disk Encryption format. It's a C library, it lives in libluksde.h, and we're gonna go through the whole thing together. no skipping. grab a snack. ๐Ÿ“


๐ŸŒธ NAME ๐ŸŒธ

libluksde.h โ€” the library to access the Linux Unified Key Setup (LUKS) Disk Encryption format. that's the whole vibe. she unlocks things. ๐Ÿ’…


โœจ SYNOPSIS โœจ

first of all, you gotta pull her in:

#include <libluksde.h>

cool cool cool. now here's every single function, grouped exactly how the header groups them. no cap. ๐Ÿ‘‘

๐Ÿซถ Support functions

const char *
libluksde_get_version(void);

int
libluksde_get_access_flags_read(void);

int
libluksde_get_codepage(int *codepage, libluksde_error_t **error);

int
libluksde_set_codepage(int codepage, libluksde_error_t **error);

int
libluksde_check_volume_signature(const char *filename,
    libluksde_error_t **error);

int
libluksde_check_volume_signature_wide(const wchar_t *filename,
    libluksde_error_t **error);

๐Ÿงš Available when compiled with libbfio support:

int
libluksde_check_volume_signature_file_io_handle(libbfio_handle_t *file_io_handle,
    libluksde_error_t **error);

๐Ÿ”” Notify functions

void
libluksde_notify_set_verbose(int verbose);

int
libluksde_notify_set_stream(FILE *stream, libluksde_error_t **error);

int
libluksde_notify_stream_open(const char *filename,
    libluksde_error_t **error);

int
libluksde_notify_stream_close(libluksde_error_t **error);

๐Ÿ’€ Error functions

void
libluksde_error_free(libluksde_error_t **error);

int
libluksde_error_fprint(libluksde_error_t *error, FILE *stream);

int
libluksde_error_sprint(libluksde_error_t *error, char *string,
    size_t size);

int
libluksde_error_backtrace_fprint(libluksde_error_t *error,
    FILE *stream);

int
libluksde_error_backtrace_sprint(libluksde_error_t *error, char *string,
    size_t size);

๐Ÿ‘‘ Volume functions

like, the main characters, honestly.

int
libluksde_volume_initialize(libluksde_volume_t **volume,
    libluksde_error_t **error);

int
libluksde_volume_free(libluksde_volume_t **volume,
    libluksde_error_t **error);

int
libluksde_volume_signal_abort(libluksde_volume_t *volume,
    libluksde_error_t **error);

int
libluksde_volume_open(libluksde_volume_t *volume, const char *filename,
    int access_flags, libluksde_error_t **error);

int
libluksde_volume_close(libluksde_volume_t *volume,
    libluksde_error_t **error);

int
libluksde_volume_is_locked(libluksde_volume_t *volume,
    libluksde_error_t **error);

int
libluksde_volume_unlock(libluksde_volume_t *volume,
    libluksde_error_t **error);

ssize_t
libluksde_volume_read_buffer(libluksde_volume_t *volume, void *buffer,
    size_t buffer_size, libluksde_error_t **error);

ssize_t
libluksde_volume_read_buffer_at_offset(libluksde_volume_t *volume,
    void *buffer, size_t buffer_size, off64_t offset,
    libluksde_error_t **error);

off64_t
libluksde_volume_seek_offset(libluksde_volume_t *volume, off64_t offset,
    int whence, libluksde_error_t **error);

int
libluksde_volume_get_offset(libluksde_volume_t *volume, off64_t *offset,
    libluksde_error_t **error);

int
libluksde_volume_get_size(libluksde_volume_t *volume, size64_t *size,
    libluksde_error_t **error);

int
libluksde_volume_get_encryption_method(libluksde_volume_t *volume,
    int *encryption_method, int *encryption_chaining_mode,
    libluksde_error_t **error);

int
libluksde_volume_get_volume_identifier(libluksde_volume_t *volume,
    uint8_t *uuid_data, size_t uuid_data_size,
    libluksde_error_t **error);

int
libluksde_volume_set_key(libluksde_volume_t *volume,
    const uint8_t *master_key, size_t master_key_size,
    libluksde_error_t **error);

int
libluksde_volume_set_utf8_password(libluksde_volume_t *volume,
    const uint8_t *utf8_string, size_t utf8_string_length,
    libluksde_error_t **error);

int
libluksde_volume_set_utf16_password(libluksde_volume_t *volume,
    const uint16_t *utf16_string, size_t utf16_string_length,
    libluksde_error_t **error);

๐ŸŒˆ Available when compiled with wide character string support:

int
libluksde_volume_open_wide(libluksde_volume_t *volume,
    const wchar_t *filename, int access_flags,
    libluksde_error_t **error);

๐Ÿฆ‹ Available when compiled with libbfio support:

int
libluksde_volume_open_file_io_handle(libluksde_volume_t *volume,
    libbfio_handle_t *file_io_handle, int access_flags,
    libluksde_error_t **error);

๐Ÿ’œ DESCRIPTION ๐Ÿ’œ

okay so literally the entire DESCRIPTION section is one singular function, she's that iconic:

  • libluksde_get_version() โ€” you call this to grab the library version. that's it. that's the whole section. version check era. โœจ

๐ŸŽ€ RETURN VALUES ๐ŸŽ€

most of the functions hand you back NULL or -1 when something goes wrong โ€” which one depends on the return type, so pay attention, bestie. and for the actual return values? go read "libluksde.h". the header knows all, the header tells all. ๐Ÿ”ฎ


๐ŸŒธ ENVIRONMENT ๐ŸŒธ

None

nothing. zero. the environment section is on a digital detox. ๐Ÿ’…


๐Ÿฆ‹ FILES ๐Ÿฆ‹

None

also nothing. same energy. โœจ


โญ NOTES โญ

  • libluksde can be compiled with wide character support (wchar_t). wide char girlies rise up ๐Ÿซถ
  • to compile libluksde with wide character support, you use:
./configure --enable-wide-character-type=yes

or you define:

_UNICODE

or:

UNICODE

during compilation.

  • LIBLUKSDE_WIDE_CHARACTER_TYPE in libluksde/features.h can be used to determine if libluksde was compiled with wide character support. like a little vibe check for your build. ๐Ÿ‘‘

๐Ÿ’€ BUGS ๐Ÿ’€

found a bug? not on my watch. please report bugs of any kind on the project issue tracker:

https://github.com/libyal/libluksde/issues

we don't gatekeep. fr fr. ๐Ÿ›


๐Ÿ’– AUTHOR ๐Ÿ’–

these man pages are generated from "libluksde.h". the header is the author, the header is the moment. ๐Ÿ˜ญ


Copyright (C) 2013-2024, Joachim Metz <joachim.metz@gmail.com>.

this is free software; see the source for copying conditions. there is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. she's giving, but she is NOT promising. periodt.


๐ŸŒˆ SEE ALSO ๐ŸŒˆ

  • the libluksde.h include file

and that's the page, bestie!! ๐ŸŽ€ source/version: libluksde, and the date stamp on this beauty is January 21, 2022 โ€” section libluksde(3). go forth and read headers, mwah ๐Ÿ’‹

๐Ÿ“ฆ where this page comes from