🌑

Explore / Study / Computer Science / Cryptography 779 words | 4 minutes

§4 Pseudorandom Generators

  1. Pseudorandomness
  2. Pseudorandom (Number) Generators (PRGs/PRNGs)
  3. Linear Congruential Generator
  4. Blum Blum Shub Generator
  5. Stream Cipher
  6. Pseudo One-Time Pad
  7. Pseudo One-Time Pad: Computational Security

Pseudorandomness

  • Definition: Let {Dn}\{D_n\} be a sequence of distributions over p(n)p(n)-bit strings. {Dn}\{D_n\} is pseudorandom if for every probabilistic, polynomial-time algorithm A\mathscr A, there is a negligible function ϵ\epsilon such that

    PrxDn[A(x)=1]PrxUp(n)[A(x)=1]ϵ(n)\left|\operatorname{Pr}_{x \leftarrow D_{n}}[\mathscr{A}(x)=1]-\operatorname{Pr}_{x \leftarrow U_{p(n)}}[\mathscr{A}(x)=1]\right| \leq \epsilon(n)

Pseudorandom (Number) Generators (PRGs/PRNGs)

  • Definition. Let pp be a polynomial and let GG be a deterministic polynomial-time algorithm such that for any nn and any input s{0,1}ns \in \{0,1\}^n, G(s)G(s) is a string of length p(n)p(n).

    We say that GG is a pseudorandom generator if the following hold:

    1. Expansion: For every nn it holds that p(n)>np(n) > n. We call pp the expansion factor of GG.

    2. Pseudorandomness: For any PPT algorithm DD, there is a negligible function ϵ\epsilon such that

      PrsUn[D(G(s))=1]PrrUp(n)[D(r)=1]ϵ(n)\left|\operatorname{Pr}_{s \leftarrow U_{n}}[D(G(s))=1]-\operatorname{Pr}_{r \leftarrow U_{p(n)}}[D(r)=1]\right| \leq \epsilon(n)

      where the first probability is over uniform choice of s{0,1}ns \in \{0,1\}^n and the randomness of DD, and the second is over uniform choice of r{0,1}p(n)r \in \{0,1\}^{p(n)} and the randomness of DD.

Linear Congruential Generator

  • The Linear Congruential Generator is a simple Pseudo-Random Generator, that is in general not cryptographically secure.

  • Parameters.

    • m>0m > 0: the modulus,
    • 0<a<m0 < a < m: the multiplier,
    • 0c<m0 ≤ c < m: the increment, and
    • 0X0<m0 ≤ X_0 < m: the seed.
  • The Linear Congruential Generator generates a sequence of pseudo-random numbers {Xn}\{X_n\} via:

    Xn+1=(aXn+c)modmX_{n+1} = (aX_{n} + c) \bmod m

Blum Blum Shub Generator

  • The Blum Blum Shub Generator is a cryptographically secure pseudo-random bit generator.

  • Parameters.

    • p,qp, q: large prime numbers such that pq3(mod4)p \equiv q \equiv 3 \pmod{4},
    • M=p×qM = p \times q,
    • ss : random number relatively prime to MM.
  • The Blum Blum Shub generator generates a sequence of pseudo-random bits BiB_i via:

    X0=s2modM, for i=1,Xi=(Xi1)2modM,Bi=Ximod2X_{0}=s^{2} \bmod M, \text { for } i=1 \rightarrow \infty, X_{i}=\left(X_{i-1}\right)^{2} \bmod M, B_{i}=X_{i} \bmod 2

Stream Cipher

  • Definition: A Stream Cipher is a pair of deterministic algorithms (Init,GetBits)(Init, GetBits) where:
    1. InitInit takes input seed ss, optional initialisation vector IVIV, outputs initial state st0st_0.
    2. GetBitsGetBits takes input state stist_i, outputs bit yy and updated state sti+1st_{i+1}.

Pseudo One-Time Pad

  • Pseudo One-Time Pad Construction. Let GG be a pseudorandom generator with expansion factor pp. Define a private-key encryption scheme for messages of length pp as:
    • GenGen : Takes input 1n1^n, outputs a uniform k{0,1}nk \in \{0,1\}^n as the key.
    • EncEnc: Takes as inputs key k{0,1}nk \in \{0,1\}^n and message m{0,1}p(n)m \in \{0,1\}^{p(n)}, outputs the ciphertext c:=G(k)mc := G(k) \oplus m.
    • DecDec : Takes as inputs key k{0,1}nk \in \{0,1\}^n and ciphertext c{0,1}p(n)c \in \{0,1\}^{p(n)}, outputs the message m:=G(k)cm := G(k) \oplus c.

Pseudo One-Time Pad: Computational Security

  • Theorem. If GG is a pseudorandom generator, then the Pseudo One-Time Pad construction is a fixed-length private-key encryption scheme that has indistinguishable encryptions in the
    presence of an eavesdropper.

— Feb 3, 2023

Creative Commons License
§4 Pseudorandom Generators by Lu Meng is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Permissions beyond the scope of this license may be available at About.