88 lines
3 KiB
Groff
88 lines
3 KiB
Groff
.\" $OpenBSD: arc4random.3,v 1.2 1997/04/27 22:40:25 angelos Exp $
|
||
.\" Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de>
|
||
.\" All rights reserved.
|
||
.\"
|
||
.\" Redistribution and use in source and binary forms, with or without
|
||
.\" modification, are permitted provided that the following conditions
|
||
.\" are met:
|
||
.\" 1. Redistributions of source code must retain the above copyright
|
||
.\" notice, this list of conditions and the following disclaimer.
|
||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||
.\" notice, this list of conditions and the following disclaimer in the
|
||
.\" documentation and/or other materials provided with the distribution.
|
||
.\" 3. All advertising materials mentioning features or use of this software
|
||
.\" must display the following acknowledgement:
|
||
.\" This product includes software developed by Niels Provos.
|
||
.\" 4. The name of the author may not be used to endorse or promote products
|
||
.\" derived from this software without specific prior written permission.
|
||
.\"
|
||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||
.\"
|
||
.\" Manual page, using -mandoc macros
|
||
.\" %FreeBSD: src/lib/libc/gen/arc4random.3,v 1.8.2.4 2001/12/14 18:33:50 ru Exp %
|
||
.\"
|
||
.\" $FreeBSD$
|
||
.Dd April 15, 1997
|
||
.Dt ARC4RANDOM 3
|
||
.Os
|
||
.Sh ̾¾Î
|
||
.Nm arc4random ,
|
||
.Nm arc4random_stir ,
|
||
.Nm arc4random_addrandom
|
||
.Nd arc4 Íð¿ô¥¸¥§¥Í¥ì¡¼¥¿
|
||
.Sh ¥é¥¤¥Ö¥é¥ê
|
||
.Lb libc
|
||
.Sh ½ñ¼°
|
||
.In stdlib.h
|
||
.Ft u_int32_t
|
||
.Fn arc4random "void"
|
||
.Ft void
|
||
.Fn arc4random_stir "void"
|
||
.Ft void
|
||
.Fn arc4random_addrandom "unsigned char *dat" "int datlen"
|
||
.Sh ²òÀâ
|
||
.Fn arc4random
|
||
´Ø¿ô¤Ï¡¢arc4 °Å¹æ¤¬ºÎÍѤ·¤Æ¤¤¤ë¥¡¼¥¹¥È¥ê¡¼¥à¥¸¥§¥Í¥ì¡¼¥¿¤ò»ÈÍѤ·¤Þ¤¹¡£
|
||
arc4 °Å¹æ¤Ï¡¢8*8 ¤Î 8 ¥Ó¥Ã¥È S-Box ¤ò»ÈÍѤ·¤Þ¤¹¡£
|
||
S-Box ¤ÏÌó
|
||
.if t 2 2\u\s71700\s10\d
|
||
.if n (2**1700)
|
||
¸Ä¤Î¾õÂÖ¤ò¼è¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£
|
||
.Pp
|
||
.Fn arc4random_stir
|
||
´Ø¿ô¤Ï¡¢
|
||
.Pa /dev/urandom
|
||
¤«¤é¥Ç¡¼¥¿¤òÆÉ¤ß¼è¤ê¡¢¤½¤ì¤ò»ÈÍѤ·¤Æ
|
||
.Fn arc4random_addrandom
|
||
¤Ë¤è¤Ã¤Æ S-Box ¤Î½ç½ø¤òÊѤ¨¤Þ¤¹¡£
|
||
.Pp
|
||
.Fn arc4random
|
||
¤ò»ÈÍѤ¹¤ëÁ°¤Ë
|
||
.Fn arc4random_stir
|
||
¤ò¸Æ¤Ó½Ð¤¹É¬ÍפϤ¢¤ê¤Þ¤»¤ó¡£
|
||
.Fn arc4random
|
||
¤Ï¼«Æ°Åª¤Ë¼«Ê¬¼«¿È¤ò½é´ü²½¤¹¤ë¤«¤é¤Ç¤¹¡£
|
||
.Pp
|
||
.Sh ´ØÏ¢¹àÌÜ
|
||
.Xr rand 3 ,
|
||
.Xr random 3 ,
|
||
.Xr srandomdev 3
|
||
.Sh Îò»Ë
|
||
.Pa RC4
|
||
¤Ï¡¢RSA Data Security, Inc. ¤Ë¤è¤Ã¤ÆÀ߷פµ¤ì¤Þ¤·¤¿¡£
|
||
.Pa RC4
|
||
¤Ï¡¢Æ¿Ì¾¤Ç USENET ¤Ë¥Ý¥¹¥È¤µ¤ì¡¢¥ª¥ê¥¸¥Ê¥ë¤Î¥³¡¼¥É¤Ë¥¢¥¯¥»¥¹¤·¤¿
|
||
Ê£¿ô¤Î¿Í¤Ë¤è¤Ã¤ÆÆ±Åù¤Ç¤¢¤ë¤³¤È¤¬³Îǧ¤µ¤ì¤Þ¤·¤¿¡£
|
||
.Pa RC4
|
||
¤Ï´ë¶Èµ¡Ì©¤Ç¤¢¤Ã¤¿¤Î¤Ç¡¢¤³¤Î°Å¹æ¤Ï
|
||
.Pa ARC4
|
||
¤È¸Æ¤Ð¤ì¤Æ¤¤¤Þ¤¹¡£
|