| 1 |
'\" t |
| 2 |
.\" Copyright 1993, David Metcalfe <[email protected]> |
| 3 |
.\" Copyright, the authors of the Linux man-pages project |
| 4 |
.\" |
| 5 |
.\" SPDX-License-Identifier: Linux-man-pages-copyleft |
| 6 |
.\" |
| 7 |
.TH memfrob 3 2026-02-08 "Linux man-pages 6.18" |
| 8 |
.SH NAME |
| 9 |
memfrob \- frobnicate (obfuscate) a memory area |
| 10 |
.SH LIBRARY |
| 11 |
Standard C library |
| 12 |
.RI ( libc ,\~ \-lc ) |
| 13 |
.SH SYNOPSIS |
| 14 |
.nf |
| 15 |
.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" |
| 16 |
.B #include <string.h> |
| 17 |
.P |
| 18 |
.BR "void *memfrob(" "size_t n;" |
| 19 |
.BI " void " s [ n "], size_t " n ); |
| 20 |
.fi |
| 21 |
.SH DESCRIPTION |
| 22 |
The |
| 23 |
.BR memfrob () |
| 24 |
function obfuscates the first |
| 25 |
.I n |
| 26 |
bytes of the memory area |
| 27 |
.I s |
| 28 |
by exclusive-ORing each character with the number |
| 29 |
42. |
| 30 |
The effect can be reversed by using |
| 31 |
.BR memfrob () |
| 32 |
on the |
| 33 |
obfuscated memory area. |
| 34 |
.P |
| 35 |
Note that this function is not a proper encryption routine as the XOR |
| 36 |
constant is fixed, and is suitable only for hiding strings. |
| 37 |
.SH RETURN VALUE |
| 38 |
The |
| 39 |
.BR memfrob () |
| 40 |
function returns a pointer to the obfuscated memory |
| 41 |
area. |
| 42 |
.SH ATTRIBUTES |
| 43 |
For an explanation of the terms used in this section, see |
| 44 |
.BR attributes (7). |
| 45 |
.TS |
| 46 |
allbox; |
| 47 |
lbx lb lb |
| 48 |
l l l. |
| 49 |
Interface Attribute Value |
| 50 |
T{ |
| 51 |
.na |
| 52 |
.nh |
| 53 |
.BR memfrob () |
| 54 |
T} Thread safety MT-Safe |
| 55 |
.TE |
| 56 |
.SH STANDARDS |
| 57 |
GNU. |
| 58 |
.SH SEE ALSO |
| 59 |
.BR bstring (3), |
| 60 |
.BR strfry (3) |