1Data::Entropy::RawSourcUes:e:rRaCnodnotmrOirbgu(t3e)d PeDraltaD:o:cEunmternotpayt:i:oRnawSource::RandomOrg(3)
2
3
4
6 Data::Entropy::RawSource::RandomOrg - download entropy from random.org
7
9 use Data::Entropy::RawSource::RandomOrg;
10
11 my $rawsrc = Data::Entropy::RawSource::RandomOrg->new;
12
13 $c = $rawsrc->getc;
14 # and the rest of the I/O handle interface
15
17 This class provides an I/O handle connected to a stream of random
18 octets being generated by an electromagnetic noise detector connected
19 to the random.org server. This is a strong source of random bits, but
20 is not suitable for security applications because the bits are passed
21 over the Internet unencrypted. The handle implements a substantial
22 subset of the interface described in IO::Handle.
23
24 For use as a general entropy source, it is recommended to wrap an
25 object of this class using "Data::Entropy::Source", which provides
26 methods to extract entropy in more convenient forms than mere octets.
27
28 The bits generated at random.org are, theoretically and as far as
29 anyone can tell, totally unbiased and uncorrelated. However, they are
30 sent over the Internet in the clear, and so are subject to interception
31 and alteration by an adversary. This is therefore generally unsuitable
32 for security applications. The capacity of the random bit server is
33 also limited. This class will slow down requests if the server's
34 entropy pool is less than half full, and (as requested by the server
35 operators) pause entirely if the entropy pool is less than 20% full.
36
37 Applications requiring secret entropy should generate it locally (see
38 Data::Entropy::RawSource::Local). Applications requiring a large
39 amount of entropy should generate it locally or download it from
40 randomnumbers.info (see Data::Entropy::RawSource::RandomnumbersInfo).
41 Applications requiring a large amount of apparently-random data, but
42 not true entropy, might prefer to fake it cryptographically (see
43 Data::Entropy::RawSource::CryptCounter).
44
46 Data::Entropy::RawSource::RandomOrg->new
47 Creates and returns a handle object referring to a stream of random
48 octets generated by random.org.
49
51 A subset of the interfaces described in IO::Handle and IO::Seekable are
52 provided:
53
54 $rawsrc->read(BUFFER, LENGTH[, OFFSET])
55 $rawsrc->getc
56 $rawsrc->ungetc(ORD)
57 $rawsrc->eof
58 Buffered reading from the source, as in IO::Handle.
59
60 $rawsrc->sysread(BUFFER, LENGTH[, OFFSET])
61 Unbuffered reading from the source, as in IO::Handle.
62
63 $rawsrc->close
64 Does nothing.
65
66 $rawsrc->opened
67 Retruns true to indicate that the source is available for I/O.
68
69 $rawsrc->clearerr
70 $rawsrc->error
71 Error handling, as in IO::Handle.
72
73 The buffered ("read" et al) and unbuffered ("sysread" et al) sets of
74 methods are interchangeable, because no such distinction is made by
75 this class.
76
77 Methods to write to the file are unimplemented because the stream is
78 fundamentally read-only. Methods to seek are unimplemented because the
79 stream is non-rewindable; "ungetc" works, however.
80
82 Data::Entropy::RawSource::CryptCounter,
83 Data::Entropy::RawSource::Local,
84 Data::Entropy::RawSource::RandomnumbersInfo, Data::Entropy::Source,
85 <http://www.random.org>
86
88 Andrew Main (Zefram) <zefram@fysh.org>
89
91 Copyright (C) 2006, 2007, 2009, 2011 Andrew Main (Zefram)
92 <zefram@fysh.org>
93
95 This module is free software; you can redistribute it and/or modify it
96 under the same terms as Perl itself.
97
98
99
100perl v5.36.0 2022-07D-a2t2a::Entropy::RawSource::RandomOrg(3)