CRYPTO_WIPE(3MONOCYPHER)
π CRYPTO_WIPE π
okay bestie, so this one's from the Monocypher crew β it lives in section 3MONOCYPHER, and it's called crypto_wipe. yes the name is giving "delete but make it secure" and honestly? that's exactly what it is. π§
β¨ NAME β¨
crypto_wipe β wipe data from memory π§½β¨
πΈ SYNOPSIS πΈ
#include <monocypher.h>
void
crypto_wipe(void *secret, size_t secret_size);
π DESCRIPTION π
crypto_wipe() securely erases sensitive data in memory. like, actually erases it. no leftovers, no crumbs. π
Sensitive data (think cryptographic keys or secret plaintexts) should be erased from memory as early as possible, to minimise the window in which it can be leaked. and listen β standard functions like memset and bzero are not safe to use here, because the compiler may decide they have no effect and justβ¦ optimise them out. π it literally ghosts your wipe. do not trust them.
The arguments are:
- secret β the buffer to erase. bye bye buffer π«Ά
- secret_size β the number of bytes to erase from the buffer. normally this is the size of the entire buffer.
Monocypher will wipe its context structs when finalizing an operation such as signing or decrypting. when you're using direct interfaces like crypto_lock(3monocypher), these context structs are invisible to you β you don't even see them, they're lowkey doing their own thing. they are exposed in incremental interfaces like crypto_blake2b_init(3monocypher) though. and heads up: the original key buffer does not get automatically wiped. so when you're using incremental interfaces, you may want to wipe the original key buffers immediately after calling the respective init function. π
Usingcrypto_wipe()alone may not suffice for security. it's recommended to lock down relevant memory regions as well β refer tointro(3monocypher)for instructions on how to lock down memory on common operating systems. no cap, one wipe is not the whole vibe check. π₯
β RETURN VALUES β
This function returns nothing. it just does the thing and leaves. main character energy, no receipts. π
π SEE ALSO π
π HISTORY π
The crypto_wipe() function first appeared in Monocypher 1.1.0. iconic behaviour since day one fr fr. π
and that's the whole page bestie!! this one came from the Debian edition of the Monocypher manual, dated December 12, 2019. stay safe, wipe your secrets, and lock down that memory πβ¨π¦
π¦ where this page comes from
- fedora 43: monocypher-devel 3.1.2-12.fc43 Β· LicenseRef-Callaway-BSD OR CC0-1.0
- fedora 43: monocypher-devel 3.1.2-12.fc43 Β· LicenseRef-Callaway-BSD OR CC0-1.0
- fedora 44: monocypher-devel 3.1.2-13.fc44 Β· LicenseRef-Callaway-BSD OR CC0-1.0
- fedora 44: monocypher-devel 3.1.2-13.fc44 Β· LicenseRef-Callaway-BSD OR CC0-1.0
- π the page's license: BSD-2-Clause OR CC0-1.0
- Copyright (c) 2017-2019 Loup Vaillant
- Copyright (c) 2017-2018 Michael Savage
- Copyright (c) 2017, 2019 Fabio Scotoni
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms