Crate paranoid_core

crate paranoid_core

Variables

const FRAMEWORKS: [ComplianceFramework; 6]
const MAX_BATCH_SIZE: usize
const MAX_CHARSET_LEN: usize
const MAX_CONSTRAINED_ATTEMPTS: usize
const MAX_MULTI_COUNT: usize
const MAX_PASSWORD_LEN: usize
const VERSION: &str

Functions

fn check_compliance(password_length: usize, total_entropy: f64, character_counts: &CharacterCounts, framework: &ComplianceFramework) -> bool
fn chi_squared(passwords: &str, num_passwords: usize, password_length: usize, charset: &str) -> Result<(f64, usize, f64), ParanoidError>
fn combined_framework_requirements(selected: &[FrameworkId]) -> CombinedFrameworkRequirements
fn count_char_types(password: &str) -> CharacterCounts
fn count_collisions(passwords: &[String]) -> Result<usize, ParanoidError>
fn execute_request<F>(request: &ParanoidRequest, run_audit: bool, mut on_stage: F) -> Result<GenerationReport, ParanoidError>
where
    F: FnMut(AuditStage)
fn framework_by_id(id: FrameworkId) -> &'static ComplianceFramework
fn frameworks() -> &'static [ComplianceFramework]
fn generate_constrained_password(charset: &str, length: usize, requirements: CharRequirements) -> Result<String, ParanoidError>
fn generate_multiple(charset: &str, length: usize, count: usize, requirements: CharRequirements) -> Result<Vec<String>, ParanoidError>
fn generate_password(charset: &str, length: usize) -> Result<String, ParanoidError>
fn pattern_issues(password: &str) -> usize
fn resolve_charset(spec: &str) -> Result<String, ParanoidError>
fn run_audit_summary<F>(request: &ResolvedRequest, passwords: &[GeneratedPassword], entropy: EntropyMetrics, on_stage: &mut F) -> Result<AuditSummary, ParanoidError>
where
    F: FnMut(AuditStage)
fn secure_preview(password: &str) -> String
fn serial_correlation(data: &[u8]) -> f64
fn sha256_hex(input: &str) -> Result<String, ParanoidError>
fn validate_charset(input: &str) -> Result<String, ParanoidError>

Enums

enum AuditStage
Generate
ChiSquared
SerialCorrelation
CollisionDetection
EntropyProofs
PatternDetection
ThreatAssessment
Complete

Implementations

impl AuditStage

Functions

fn label(self) -> &'static str
enum CharsetSpec
NamedOrLiteral(String)
Options(CharsetOptions)

Implementations

impl CharsetSpec

Functions

fn resolve(&self, combined: &CombinedFrameworkRequirements) -> Result<String, ParanoidError>

Traits implemented

impl Default for CharsetSpec
enum FrameworkId
Nist
PciDss
Hipaa
Soc2
Gdpr
Iso27001

Implementations

impl FrameworkId

Functions

fn as_str(self) -> &'static str
fn parse(input: &str) -> Option<Self>

Traits implemented

impl fmt::Display for FrameworkId
enum ParanoidError
InvalidArguments(String)
ImpossibleRequirements(String)
RandomFailure(String)
HashFailure(String)
ExhaustedAttempts

Structs and Unions

struct AuditSummary
password_length: usize
charset_size: usize
chi2_statistic: f64
chi2_df: usize
chi2_p_value: f64
chi2_pass: bool
serial_correlation: f64
serial_pass: bool
batch_size: usize
duplicates: usize
collision_pass: bool
entropy: EntropyMetrics
nist_memorized: bool
nist_high_value: bool
nist_crypto_equiv: bool
nist_post_quantum: bool
rejection_max_valid: usize
rejection_rate_pct: f64
passwords_all_pass: bool
selected_frameworks_pass: bool
overall_pass: bool
struct CharRequirements
min_lowercase: usize
min_uppercase: usize
min_digits: usize
min_symbols: usize

Implementations

impl CharRequirements

Functions

fn max_with(self, other: Self) -> Self
fn total(self) -> usize
struct CharacterCounts
lowercase: usize
uppercase: usize
digits: usize
symbols: usize
struct CharsetOptions
include_lowercase: bool
include_uppercase: bool
include_digits: bool
include_symbols: bool
include_space: bool
exclude_ambiguous: bool
custom_charset: Option<String>

Implementations

impl CharsetOptions

Functions

fn apply_frameworks(&mut self, combined: &CombinedFrameworkRequirements)
fn build(&self) -> Result<String, ParanoidError>

Traits implemented

impl Default for CharsetOptions
struct CombinedFrameworkRequirements
min_length: usize
require_lowercase: bool
require_uppercase: bool
require_digits: bool
require_symbols: bool
struct ComplianceFramework
id: FrameworkId
name: &'static str
description: &'static str
min_length: usize
min_entropy_bits: f64
require_mixed_case: bool
require_digits: bool
require_symbols: bool
struct ComplianceStatus
id: FrameworkId
name: String
selected: bool
passed: bool
struct EntropyMetrics
bits_per_char: f64
total_entropy: f64
log10_search_space: f64
brute_force_years: f64
collision_probability: f64
passwords_for_50pct: f64
struct GeneratedPassword
value: String
sha256_hex: String
character_counts: CharacterCounts
pattern_issues: usize
compliance: Vec<ComplianceStatus>
selected_compliance_pass: bool
all_pass: bool
struct GenerationReport
request: ResolvedRequest
passwords: Vec<GeneratedPassword>
audit: Option<AuditSummary>
struct ParanoidRequest
length: usize
count: usize
batch_size: usize
charset: CharsetSpec
requirements: CharRequirements
selected_frameworks: Vec<FrameworkId>

Implementations

impl ParanoidRequest

Functions

fn resolve(&self) -> Result<ResolvedRequest, ParanoidError>

Traits implemented

impl Default for ParanoidRequest
struct ResolvedRequest
length: usize
count: usize
batch_size: usize
charset: String
requirements: CharRequirements
selected_frameworks: Vec<FrameworkId>