Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
RandomTools[BlumBlumShub][NewGenerator] - Blum, Blum and Shub Pseudo Random Bit Generator
Calling Sequence
NewBitGenerator( opt1, opt2, ... )
Parameters
opt1, opt2, ...
-
(optional) argument of the form option=value where option is one of range, or seed
Description
The NewGenerator command outputs a Maple procedure, a pseudo-random number generator, which when called outputs a pseudo-random number. The generator is a Blum-Blum-Shub (BBS) generator. A BBS generator uses the following quadratic recurrence to generate a sequence of integers from which cryptographically secure pseudo-random bits are extracted:
- n is a product of two large primes p and q
- and
- is determined from the seed s.
Each iteration of , the least significant bits of , generates cryptographically secure bits. The output of the generator depends on the options described below.
The cryptographic security of the BBS generator assumes that the number theoretic problem of distinguishing a quadratic residue from a pseudo-square in Z mod n is computationally infeasible when n is the product of two primes p and q and the factorization of n is not known. Thus it also assumes that integer factorization is computationally infeasible. Recall the definitions of a quadratic residue and pseudo-square:
Definition: An integer x in Z mod n is a quadratic residue if (i) and (ii) for some integer y.
Definition: An integer z in Z mod n where is a pseudo square if (i) and (ii) z is not a quadratic residue in Z mod p and (iii) z is not a quadratic residue in Z mod q.
The primes p and q are chosen to be of the form and where s and t are prime and 2 is a primitive element in the Z mod s and in Z mod t. This choice guarantees that p and q are both congruent to 3 mod 4 (a requirement for the security of the generator) and also that the period of the generator for for any quadratic residue other than 1 is either or or , all of which are large. Random primes p and q, and their product , satisfying these requirements of lengths 512 bits, 768 bits, and 1024 bits, have been precomputed and the prime factorization discarded (Maple does not have the factorizations). Thus there are three choices for of lengths 308, 462 and 616 decimal digits, providing a range of security for cryptographic applications.
The following optional arguments are supported. They are input as equations in any order.
range=integer..integer or integer
The range argument specifies the range from which the integer is chosen. If a range is given, the returned procedure will generate numbers in this range. If an integer is given, the returned procedure will return integers in the range 0 to value-1. By default the range is 0 to 10^12-1.
seed=integer
The argument seed determines the seed for the generator. The value used for must be a ``random'' quadratic residue which is not equal to 1 (to avoid a short period). The value used for is computed from the value of the seed argument. If a seed is not given, a seed is generated by calling RandomTools[MersenneTwister][GenerateInteger] with the argument range = .
The RandomTools[BlumBlumShub] module also exports the NewBitGenerator function. This function provides the user with greater control over the properties of the returned procedure. For cryptographic applications, the NewBitGenerator function should be used.
Examples
See Also
rand, RandomTools, RandomTools[BlumBlumShub], RandomTools[BlumBlumShub][NewBitGenerator], RandomTools[Generate]
Download Help Document