Skip to main content
QMSQMS
QMS
  • Welcome to your QMS
  • Quality Manual
  • Procedures
  • Records
  • Legit.Health Plus Version 1.1.0.0
    • CAPA Plan - BSI CE Mark Closeout
    • Index
    • Overview and Device Description
    • Information provided by the Manufacturer
    • Design and Manufacturing Information
      • R-TF-012-019 SOUPs
        • Aioboto3
        • Albumentations
        • Argon2-CFFI
        • Authlib
        • Boto3
        • Dependency Injector
        • Dill
        • FastAPI
        • PyTorch Grad-CAM
        • Httpx
        • NumPy
        • PyNVML
        • OpenCV
        • Pillow
        • Psutil
        • Pydantic
        • Pydantic Settings
        • PyYAML
        • Segmentation Models PyTorch
        • Starlette
        • Timm
        • PyTorch
        • TorchVision
        • Ultralytics YOLO
        • Uvicorn
      • R-TF-012-028 Software Requirement Specification
      • R-TF-012-029 Software Architecture Description
      • R-TF-012-030 Software Configuration Management Plan
      • R-TF-012-031 Product requirements specification
      • R-TF-012-037 Labeling and IFU Requirements
      • R-TF-012-040 Documentation level FDA
      • R-TF-012-041 Software Classification 62304
      • R-TF-012-043 Traceability Matrix
      • Review meetings
    • GSPR
    • Benefit-Risk Analysis and Risk Management
    • Product Verification and Validation
    • Post-Market Surveillance
  • Legit.Health Plus Version 1.1.0.1
  • Legit.Health Utilities
  • Licenses and accreditations
  • Applicable Standards and Regulations
  • Pricing
  • Public tenders
  • Legit.Health Plus Version 1.1.0.0
  • Design and Manufacturing Information
  • R-TF-012-019 SOUPs
  • Argon2-CFFI

Argon2-CFFI

General Information​

FieldValue
Package Nameargon2-cffi
Manufacturer / VendorHynek Schlawack and contributors
Software CategoryLibrary
Primary DocumentationDocumentation, GitHub, PyPI
Programming Language(s)Python, C (via CFFI bindings)
LicenseMIT License
Deployed Version(s)>=25.1.0
Most Recent Available Version25.1.0
Last Review Date2026-01-27

Overview​

argon2-cffi is a Python library that provides secure password hashing using the Argon2 algorithm. Argon2 won the Password Hashing Competition in 2015 and is specifically designed to be resistant to GPU cracking attacks and side-channel attacks through its memory-hard computation approach. The library offers a simple, production-ready API for password hashing and verification operations.

Within the medical device software, argon2-cffi is integrated exclusively into the API Gateway service to provide secure credential management for authenticated user access. It is used in two key components:

  • Argon2AuthenticationService: The primary authentication service in the API Gateway that handles password hashing during user registration and password verification during login operations.
  • Argon2PasswordHasher: A utility component in the user account management tooling that enforces password strength requirements (minimum 12 characters, uppercase, lowercase, digits, and special characters) before hashing, and provides rehash capability when security parameters are updated.

The library uses the Argon2id variant by default, which combines resistance to both side-channel timing attacks (from Argon2i) and GPU-based cracking (from Argon2d), making it the recommended choice for password hashing in production environments.

argon2-cffi was selected over alternatives (bcrypt, scrypt, PBKDF2) due to:

  • Argon2's status as the Password Hashing Competition winner, representing the current state-of-the-art in password hashing security
  • Memory-hard design that significantly increases the cost of parallel GPU-based attacks
  • Configurable security parameters (time cost, memory cost, parallelism) allowing tuning for specific hardware and security requirements
  • Active maintenance with regular updates and Python version support (currently 3.8 through 3.14)
  • Strong community adoption with over 5.6 million weekly downloads
  • MIT license permitting commercial use in medical device software
  • CII Best Practices badge certification demonstrating project quality standards

Functional Requirements​

The following functional capabilities of this SOUP are relied upon by the medical device software.

Requirement IDDescriptionSource / Reference
FR-001Hash plaintext passwords using the Argon2id algorithm with cryptographically secure random saltPasswordHasher.hash() method
FR-002Verify plaintext passwords against stored Argon2id hashesPasswordHasher.verify() method
FR-003Raise VerifyMismatchError exception when password verification failsargon2.exceptions.VerifyMismatchError
FR-004Determine if a password hash requires rehashing due to parameter changesPasswordHasher.check_needs_rehash() method
FR-005Generate hashes in PHC string format with embedded parameters and salt$argon2id$v=VERSION$m=MEM,t=TIME,p=PAR$SALT$HASH
FR-006Accept both Unicode string and bytes input for password valuesPasswordHasher input handling

Performance Requirements​

The following performance expectations are relevant to the medical device software.

Requirement IDDescriptionAcceptance Criteria
PR-001Password hashing shall complete within acceptable API latency boundsHash operation completes within overall authentication timeout
PR-002Password verification shall support concurrent login requestsVerification completes within 500ms under normal system load
PR-003Memory allocation during hashing shall not cause resource exhaustionMemory usage bounded by configured memory_cost parameter

Hardware Requirements​

The following hardware dependencies or constraints are imposed by this SOUP component.

Requirement IDDescriptionNotes / Limitations
HR-001Sufficient system memory for Argon2 memory-hard computationDefault memory cost requires approximately 64 MiB per concurrent hash operation
HR-002Multi-core CPU recommended for optimal parallelismArgon2 can utilize multiple CPU cores for parallel lane computation
HR-003x86-64 or ARM64 processor architecturePre-built wheels available for common platforms

Software Requirements​

The following software dependencies and environmental assumptions are required by this SOUP component.

Requirement IDDescriptionDependency / Version Constraints
SR-001Python runtime environmentPython >=3.8 (device uses Python 3.12)
SR-002argon2-cffi-bindings for native Argon2 implementationAutomatically installed as dependency
SR-003CFFI (C Foreign Function Interface) for PythonBundled with argon2-cffi-bindings

Known Anomalies Assessment​

This section evaluates publicly reported issues, defects, or security vulnerabilities associated with this SOUP component and their relevance to the medical device software.

As of 2026-01-27, no CVEs or security vulnerabilities have been reported against the argon2-cffi library. A comprehensive review of the National Vulnerability Database (NVD), Snyk vulnerability database, GitHub Security Advisories, and PyPI security reports identified no known security issues affecting this package. The library has maintained a clean security record throughout its release history. According to Snyk's security analysis, the package has been scanned for vulnerabilities and deemed safe to use, with a health score of 87/100. The project maintains a formal security policy (SECURITY.md) and has earned the CII Best Practices badge, demonstrating commitment to security best practices.

The underlying Argon2 algorithm has undergone extensive cryptographic review as part of the Password Hashing Competition and is recommended by OWASP for password storage. The algorithm's memory-hard design provides strong resistance against:

  • GPU-based attacks: Memory bandwidth requirements make parallel GPU cracking economically impractical
  • ASIC attacks: Custom hardware provides limited advantage due to memory access patterns
  • Side-channel attacks: Argon2id variant provides data-independent memory access patterns

The device's usage pattern maintains security best practices:

  • Strong password requirements: The Argon2PasswordHasher enforces minimum password complexity (12+ characters, mixed case, digits, special characters) before hashing
  • Secure defaults: The library's default parameters (Argon2id, 64 MiB memory, 3 iterations, 4 parallel lanes) align with current security recommendations
  • No custom parameter weakening: The device uses the library's default secure parameters without reduction
  • Constant-time verification: The verify() method uses constant-time comparison to prevent timing attacks
  • Automatic salt generation: Each password hash includes a cryptographically secure random salt, preventing rainbow table attacks
  • Hash portability: The PHC string format allows hashes to be verified even if parameters are later updated

Risk Control Measures​

The following risk control measures are implemented to mitigate potential security and operational risks associated with this SOUP component:

  • Password strength validation enforces minimum complexity requirements (12+ characters, mixed case, digits, special characters) before hashing
  • Authentication rate limiting prevents brute-force attacks at the API layer
  • Secure password transmission over HTTPS prevents interception
  • Hash storage in encrypted database prevents direct hash extraction
  • Account lockout policies provide defense-in-depth against credential attacks
  • Secure library defaults are used without parameter weakening

Assessment Methodology​

The following methodology was used to identify and assess known anomalies:

  • Sources consulted:

    • National Vulnerability Database (NVD) search for "argon2-cffi" and "argon2"
    • Snyk vulnerability database and package health analysis
    • GitHub Security Advisories for hynek/argon2-cffi
    • PyPI security reports
    • OWASP Password Storage Cheat Sheet recommendations
  • Criteria for determining applicability:

    • Vulnerability must affect deployed versions (>=25.1.0)
    • Vulnerability must be exploitable through the device's authentication interfaces
    • Attack vector must be reachable in the deployment environment
    • Existing input validation and security controls must not mitigate the vulnerability

Signature meaning

The signatures for the approval process of this document can be found in the verified commits at the repository for the QMS. As a reference, the team members who are expected to participate in this document and their roles in the approval process, as defined in Annex I Responsibility Matrix of the GP-001, are:

  • Author: Team members involved
  • Reviewer: JD-003 Design & Development Manager, JD-004 Quality Manager & PRRC
  • Approver: JD-001 General Manager
Previous
Albumentations
Next
Authlib
  • General Information
  • Overview
  • Functional Requirements
  • Performance Requirements
  • Hardware Requirements
  • Software Requirements
  • Known Anomalies Assessment
    • Risk Control Measures
    • Assessment Methodology
All the information contained in this QMS is confidential. The recipient agrees not to transmit or reproduce the information, neither by himself nor by third parties, through whichever means, without obtaining the prior written permission of Legit.Health (AI Labs Group S.L.)