]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) |
2 | .\" | |
5fbde956 | 3 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
fea681da MK |
4 | .\" |
5 | .\" References consulted: | |
6 | .\" Linux libc source code | |
7 | .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) | |
8 | .\" 386BSD man pages | |
9 | .\" Modified Sat Jul 24 18:54:45 1993 by Rik Faith (faith@cs.unc.edu) | |
4c1c5274 | 10 | .TH memfrob 3 (date) "Linux man-pages (unreleased)" |
fea681da | 11 | .SH NAME |
c6950157 | 12 | memfrob \- frobnicate (obfuscate) a memory area |
60d73dbb AC |
13 | .SH LIBRARY |
14 | Standard C library | |
8fc3b2cf | 15 | .RI ( libc ", " \-lc ) |
fea681da MK |
16 | .SH SYNOPSIS |
17 | .nf | |
86b91fdf | 18 | .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" |
fea681da | 19 | .B #include <string.h> |
68e4db0a | 20 | .PP |
fea681da MK |
21 | .BI "void *memfrob(void *" s ", size_t " n ); |
22 | .fi | |
23 | .SH DESCRIPTION | |
60a90ecd MK |
24 | The |
25 | .BR memfrob () | |
c6950157 | 26 | function obfuscates the first \fIn\fP bytes of the |
fea681da | 27 | memory area \fIs\fP by exclusive-ORing each character with the number |
1c44bd5b | 28 | 42. |
60a90ecd MK |
29 | The effect can be reversed by using |
30 | .BR memfrob () | |
31 | on the | |
c6950157 | 32 | obfuscated memory area. |
fea681da MK |
33 | .PP |
34 | Note that this function is not a proper encryption routine as the XOR | |
33a0ccb2 | 35 | constant is fixed, and is suitable only for hiding strings. |
47297adb | 36 | .SH RETURN VALUE |
60a90ecd MK |
37 | The |
38 | .BR memfrob () | |
c6950157 | 39 | function returns a pointer to the obfuscated memory |
fea681da | 40 | area. |
60ca99ee | 41 | .SH ATTRIBUTES |
c3b39c34 PH |
42 | For an explanation of the terms used in this section, see |
43 | .BR attributes (7). | |
c466875e MK |
44 | .ad l |
45 | .nh | |
c3b39c34 PH |
46 | .TS |
47 | allbox; | |
c466875e | 48 | lbx lb lb |
c3b39c34 PH |
49 | l l l. |
50 | Interface Attribute Value | |
51 | T{ | |
60ca99ee | 52 | .BR memfrob () |
c3b39c34 PH |
53 | T} Thread safety MT-Safe |
54 | .TE | |
c466875e MK |
55 | .hy |
56 | .ad | |
57 | .sp 1 | |
3113c7f3 | 58 | .SH STANDARDS |
60a90ecd MK |
59 | The |
60 | .BR memfrob () | |
61 | function is unique to the | |
fea681da | 62 | GNU C Library. |
47297adb | 63 | .SH SEE ALSO |
879091c9 | 64 | .BR bstring (3), |
fea681da | 65 | .BR strfry (3) |