random(4d) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

random(4d)

random(4D)                Device Drivers & /dev files               random(4D)

NAME
       random, urandom - Strong random number generator device

SYNOPSIS
       /dev/random


       /dev/urandom

DESCRIPTION
       The  /dev/random  and  /dev/urandom  files are special files that are a
       source for random bytes generated by the kernel random number generator
       device. The /dev/random and /dev/urandom files are suitable for  appli‐
       cations  requiring  high  quality random numbers for cryptographic pur‐
       poses. However, it is recommended to use the getrandom(2) function  in‐
       stead  of directly using open(2) and read(2) functions on the /dev/ran‐
       dom or /dev/urandom files.


       The generator device produces random  numbers  from  data  and  devices
       available  to the kernel and estimates the amount of randomness (or en‐
       tropy) collected from these sources. The entropy level  determines  the
       amount  of  high  quality  random  numbers that are produced at a given
       time.


       Applications retrieve random bytes by reading /dev/random or /dev/uran‐
       dom. The /dev/random interface returns random bytes  only  when  suffi‐
       cient  amount  of entropy has been collected. If there is no entropy to
       produce the requested number of bytes, /dev/random  blocks  until  more
       entropy  can  be obtained. Non-blocking I/O mode can be used to disable
       the blocking behavior. The /dev/random interface also supports poll(2).
       Note that using poll(2) does not increase the  speed  at  which  random
       numbers can be read.


       Bytes  retrieved  from  /dev/random  provide the highest quality random
       numbers produced by the generator, and can be  used  to  generate  long
       term keys and other high value keying material.


       The  /dev/urandom  interface  returns bytes regardless of the amount of
       entropy available. It does not block on a read request due to  lack  of
       entropy.  While  bytes  produced  by  the /dev/urandom interface are of
       lower quality than bytes produced by /dev/random, they are  nonetheless
       suitable for less demanding and shorter term cryptographic uses such as
       short term session keys, paddings, and challenge strings.


       Data  can  be  written to /dev/random and /dev/urandom. Data written to
       either special file is added to the generator's  internal  state.  Data
       that  is  difficult to predict by other users may contribute randomness
       to the generator state and help improve the quality of future generated
       random numbers.


       /dev/random collects entropy from providers that  are  registered  with
       the  kernel-level  cryptographic  framework and implement random number
       generation routines. The cryptoadm(8) utility allows  an  administrator
       to configure which providers is used with /dev/random.


       The  limitation  per  read for /dev/random is 1040 bytes. The limit for
       /dev/urandom is (128 * 1040).

ERRORS
       EAGAIN    O_NDELAY or O_NONBLOCK was set and no random bytes are avail‐
                 able for reading from /dev/random.


       EINTR     A signal was caught while reading  and  no  data  was  trans‐
                 ferred.


       ENXIO     open(2)  request  failed  on  /dev/random  because no entropy
                 provider is available.


FILES
       /dev/random


       /dev/urandom


ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:

       tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE  TYPEAT‐
       TRIBUTE  VALUE _ Availabilitysystem/kernel _ Interface StabilityCommit‐
       ted


SEE ALSO
       getentropy(2), getrandom(2),  open(2),  poll(2),  attributes(7),  cryp‐
       toadm(8)

NOTES
       /dev/random  can be configured to use only the hardware-based providers
       registered with the kernel-level cryptographic framework  by  disabling
       the  software-based provider using cryptoadm(8). You can also use cryp‐
       toadm(8) to obtain the name of the software-based provider.


       Because no entropy is available,  disabling  all  randomness  providers
       causes read(2) and poll(2) on /dev/random to block indefinitely and re‐
       sults  in  a  warning  message being logged and displayed on the system
       console. However, read(2) and poll(2) on /dev/urandom continue to  work
       in this case.

HISTORY
       An implementation of the /dev/random and /dev/urandom kernel-based ran‐
       dom number generator first appeared in Linux 1.3.30.


       A /dev/random interface for Solaris first appeared as part of the Cryp‐
       toRand implementation. Support for /dev/random and /dev/urandom was in‐
       cluded in Solaris 9, and made available as a patch for Solaris 8.

Oracle Solaris 11.4               10 Dec 2020                       random(4D)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3