]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) |
2 | .\" | |
93015253 | 3 | .\" %%%LICENSE_START(VERBATIM) |
fea681da MK |
4 | .\" Permission is granted to make and distribute verbatim copies of this |
5 | .\" manual provided the copyright notice and this permission notice are | |
6 | .\" preserved on all copies. | |
7 | .\" | |
8 | .\" Permission is granted to copy and distribute modified versions of this | |
9 | .\" manual under the conditions for verbatim copying, provided that the | |
10 | .\" entire resulting derived work is distributed under the terms of a | |
11 | .\" permission notice identical to this one. | |
c13182ef | 12 | .\" |
fea681da MK |
13 | .\" Since the Linux kernel and libraries are constantly changing, this |
14 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
15 | .\" responsibility for errors or omissions, or for damages resulting from | |
16 | .\" the use of the information contained herein. The author(s) may not | |
17 | .\" have taken the same level of care in the production of this manual, | |
18 | .\" which is licensed free of charge, as they might when working | |
19 | .\" professionally. | |
c13182ef | 20 | .\" |
fea681da MK |
21 | .\" Formatted or processed versions of this manual, if unaccompanied by |
22 | .\" the source, must acknowledge the copyright and authors of this work. | |
4b72fb64 | 23 | .\" %%%LICENSE_END |
fea681da MK |
24 | .\" |
25 | .\" References consulted: | |
26 | .\" Linux libc source code | |
27 | .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) | |
28 | .\" 386BSD man pages | |
29 | .\" Modified Sat Jul 24 18:54:45 1993 by Rik Faith (faith@cs.unc.edu) | |
31a1b45e | 30 | .TH MEMFROB 3 2017-03-13 "GNU" "Linux Programmer's Manual" |
fea681da MK |
31 | .SH NAME |
32 | memfrob \- frobnicate (encrypt) a memory area | |
33 | .SH SYNOPSIS | |
34 | .nf | |
86b91fdf | 35 | .BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */" |
fea681da | 36 | .B #include <string.h> |
68e4db0a | 37 | .PP |
fea681da MK |
38 | .BI "void *memfrob(void *" s ", size_t " n ); |
39 | .fi | |
40 | .SH DESCRIPTION | |
60a90ecd MK |
41 | The |
42 | .BR memfrob () | |
43 | function encrypts the first \fIn\fP bytes of the | |
fea681da | 44 | memory area \fIs\fP by exclusive-ORing each character with the number |
1c44bd5b | 45 | 42. |
60a90ecd MK |
46 | The effect can be reversed by using |
47 | .BR memfrob () | |
48 | on the | |
fea681da MK |
49 | encrypted memory area. |
50 | .PP | |
51 | Note that this function is not a proper encryption routine as the XOR | |
33a0ccb2 | 52 | constant is fixed, and is suitable only for hiding strings. |
47297adb | 53 | .SH RETURN VALUE |
60a90ecd MK |
54 | The |
55 | .BR memfrob () | |
56 | function returns a pointer to the encrypted memory | |
fea681da | 57 | area. |
60ca99ee | 58 | .SH ATTRIBUTES |
c3b39c34 PH |
59 | For an explanation of the terms used in this section, see |
60 | .BR attributes (7). | |
61 | .TS | |
62 | allbox; | |
63 | lb lb lb | |
64 | l l l. | |
65 | Interface Attribute Value | |
66 | T{ | |
60ca99ee | 67 | .BR memfrob () |
c3b39c34 PH |
68 | T} Thread safety MT-Safe |
69 | .TE | |
47297adb | 70 | .SH CONFORMING TO |
60a90ecd MK |
71 | The |
72 | .BR memfrob () | |
73 | function is unique to the | |
fea681da | 74 | GNU C Library. |
47297adb | 75 | .SH SEE ALSO |
879091c9 | 76 | .BR bstring (3), |
fea681da | 77 | .BR strfry (3) |