Debian Codegraph @

upstream/debian-trixie/man3/memfrob.3

raw
1 '\" t
2 .\" Copyright 1993 David Metcalfe ([email protected])
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .\" References consulted:
7 .\" Linux libc source code
8 .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
9 .\" 386BSD man pages
10 .\" Modified Sat Jul 24 18:54:45 1993 by Rik Faith ([email protected])
11 .TH memfrob 3 2024-05-02 "Linux man-pages 6.9.1"
12 .SH NAME
13 memfrob \- frobnicate (obfuscate) a memory area
14 .SH LIBRARY
15 Standard C library
16 .RI ( libc ", " \-lc )
17 .SH SYNOPSIS
18 .nf
19 .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
20 .B #include <string.h>
21 .P
22 .BI "void *memfrob(void " s [. n "], size_t " n );
23 .fi
24 .SH DESCRIPTION
25 The
26 .BR memfrob ()
27 function obfuscates the first \fIn\fP bytes of the
28 memory area \fIs\fP 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)