Maple Professionel
Maple Académique
Maple Edition Étudiant
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professionel
MapleSim Académique
Maple T.A. - Suite d'examens de classement
Maple T.A. MAA Placement Test Suite
Möbius - Didacticiels de mathématiques en ligne
Machine Design / Industrial Automation
Aéronautique
Ingénierie des véhicules
Robotics
Energie
System Simulation and Analysis
Model development for HIL
Modélisation du procédé pour la conception de systèmes de contrôle
Robotics/Motion Control/Mechatronics
Other Application Areas
Enseignement des mathématiques
Enseignement de l’ingénierie
Enseignement secondaire et supérieur (CPGE, BTS)
Tests et évaluations
Etudiants
Modélisation financière
Recherche opérationnelle
Calcul haute performance
Physique
Webinaires en direct
Webinaires enregistrés
Agenda des évènements
Forum MaplePrimes
Blog Maplesoft
Membres Maplesoft
Maple Ambassador Program
MapleCloud
Livres blancs techniques
Bulletin électronique
Livres Maple
Math Matters
Portail des applications
Galerie de modèles MapleSim
Cas d'Etudes Utilisateur
Exploring Engineering Fundamentals
Concepts d’enseignement avec Maple
Centre d’accueil utilisateur Maplesoft
Centre de ressources pour enseignants
Centre d’assistance aux étudiants
RandomTools[BlumBlumShub][NewBitGenerator] - Blum, Blum and Shub Pseudo Random Bit Generator
Calling Sequence
NewBitGenerator( seed, opt1, opt2, ... )
Parameters
seed
-
an integer, the seed for the generator
opt1, opt2, ...
(optional) argument of the form option=value where option is one of primes, numbits, or output
Description
The NewBitGenerator command outputs a Maple procedure, a pseudo-random bit generator, which when called outputs one pseudo-random bit, a 0 or 1. 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 default is to output one bit.
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 both Z mod s and 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 n=p*q, 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 integer seed determines the seed for the generator. The value used for used 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 seed s. For cryptographic applications the seed should be chosen by the user to be a random integer from a large set, e.g., from . It will be automatically reduced modulo n.
The following optional arguments are supported. They are input as equations in any order.
primes = , or
The integer l, which must be one of , or specifies the length of the primes p and q in bits. The default is .
numbits=integer
This specifies how many bits are computed and output by each call to the generator. The default is 1.
output= bits or integer
This specifies how the bits are output. If integer is specified, the output is a Maple integer in the range 0 to 2^b-1. If bits is specified, the output will be a Maple sequence of b bits. The default is bits.
The RandomTools[BlumBlumShub] module also exports the NewGenerator function. This function's interface is compatible with the NewGenerator functions of other RandomTools pseudo-random number generator subpackages.
Examples
See Also
rand, RandomTools, RandomTools[BlumBlumShub], RandomTools[BlumBlumShub][NewGenerator], RandomTools[Generate]
Download Help Document