]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/memfrob.3
membarrier.2: Remove redundant mention of return value of MEMBARRIER_CMD_SHARED
[thirdparty/man-pages.git] / man3 / memfrob.3
CommitLineData
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)
fe0fefbf 30.TH MEMFROB 3 2015-03-02 "GNU" "Linux Programmer's Manual"
fea681da
MK
31.SH NAME
32memfrob \- frobnicate (encrypt) a memory area
33.SH SYNOPSIS
34.nf
86b91fdf 35.BR "#define _GNU_SOURCE" " /* See feature_test_macros(7) */"
fea681da
MK
36.B #include <string.h>
37.sp
38.BI "void *memfrob(void *" s ", size_t " n );
39.fi
40.SH DESCRIPTION
60a90ecd
MK
41The
42.BR memfrob ()
43function encrypts the first \fIn\fP bytes of the
fea681da 44memory area \fIs\fP by exclusive-ORing each character with the number
1c44bd5b 4542.
60a90ecd
MK
46The effect can be reversed by using
47.BR memfrob ()
48on the
fea681da
MK
49encrypted memory area.
50.PP
51Note that this function is not a proper encryption routine as the XOR
33a0ccb2 52constant is fixed, and is suitable only for hiding strings.
47297adb 53.SH RETURN VALUE
60a90ecd
MK
54The
55.BR memfrob ()
56function returns a pointer to the encrypted memory
fea681da 57area.
60ca99ee 58.SH ATTRIBUTES
c3b39c34
PH
59For an explanation of the terms used in this section, see
60.BR attributes (7).
61.TS
62allbox;
63lb lb lb
64l l l.
65Interface Attribute Value
66T{
60ca99ee 67.BR memfrob ()
c3b39c34
PH
68T} Thread safety MT-Safe
69.TE
47297adb 70.SH CONFORMING TO
60a90ecd
MK
71The
72.BR memfrob ()
73function is unique to the
fea681da 74GNU C Library.
47297adb 75.SH SEE ALSO
fea681da 76.BR strfry (3)