Skip to main content

Security Considerations

Cryptographic Features

  • ChaCha20 mixing for cryptographic security
  • 256-bit internal state
  • Constant-time operations to prevent timing attacks
  • NIST SP 800-22 validated

Best Practices

Secure Seeding

# Use cryptographic random seed
secure_seed <- as.integer(openssl::rand_bytes(4))
createPRNG(list(seed = secure_seed))

Key Generation

# Enable crypto mixing for key generation
createPRNG(list(
  use_crypto_mixer = TRUE,
  mixer_rounds = 20  # ChaCha20 rounds
))

# Generate cryptographic keys
key_bytes <- as.integer(generatePRNG(32) * 256)

Security Warnings

Do not use qiprng for cryptographic applications without enabling the crypto mixer. The base quadratic irrational algorithm alone is not cryptographically secure.

Threat Model

qiprng with crypto mixing protects against:
  • Statistical distinguishers
  • Linear and differential cryptanalysis
  • Time-memory trade-off attacks
  • Side-channel attacks (constant-time operations)