This section is based on catpages contributed by Mainichi Communications, Inc. Translated by: MYCOM team Converted by: Japanese Online Manual Project <man-jp@jp.FreeBSD.ORG> Submitted by: Kazuo Horikawa <k-horik@yk.rim.or.jp>
85 lines
2.9 KiB
Groff
85 lines
2.9 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
|
|
.\"
|
|
.Dd April 15, 1997
|
|
.Dt ARC4RANDOM 3
|
|
.Os
|
|
.Sh 名称
|
|
.Nm arc4random,
|
|
.Nm arc4random_stir,
|
|
.Nm arc4random_addrandom
|
|
.Nd arc4 乱数ジェネレータ
|
|
.Sh 書式
|
|
.Fd #include <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
|
|
と呼ばれています。
|
|
.\" kuma
|