{"library":"pyaescrypt","title":"pyAesCrypt","description":"pyAesCrypt is a Python library (version 6.1.1) for encrypting and decrypting files and streams using the AES Crypt format (version 2). It provides a straightforward API for secure file and stream operations with AES encryption, often seeing patch and minor releases and occasional major updates that introduce breaking changes or significant features.","language":"python","status":"active","last_verified":"Mon May 18","install":{"commands":["pip install pyaescrypt"],"cli":null},"imports":["import pyAesCrypt","import pyAesCrypt\npyAesCrypt.encryptFile(...)","import pyAesCrypt\npyAesCrypt.decryptFile(...)","import pyAesCrypt\npyAesCrypt.encryptStream(...)","import pyAesCrypt\npyAesCrypt.decryptStream(...)","from pyAesCrypt import AESCryptException"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import pyAesCrypt\nimport os\n\n# --- Setup (create dummy file) ---\ninput_file = \"data.txt\"\nencrypted_file = \"data.aes\"\ndecrypted_file = \"data.txt.out\"\npassword = os.environ.get('AESCRYPT_PASSWORD', 'mySuperSecretPassword123') # Replace with strong password\nbuffer_size = 64 * 1024 # 64KB\n\nwith open(input_file, 'w') as f:\n    f.write('This is a test message to be encrypted.')\n\nprint(f\"Original file '{input_file}' created.\")\n\n# --- Encryption ---\ntry:\n    pyAesCrypt.encryptFile(input_file, encrypted_file, password, buffer_size)\n    print(f\"File '{input_file}' encrypted to '{encrypted_file}'.\")\n\n    # --- Decryption ---\n    pyAesCrypt.decryptFile(encrypted_file, decrypted_file, password, buffer_size)\n    print(f\"File '{encrypted_file}' decrypted to '{decrypted_file}'.\")\n\n    with open(decrypted_file, 'r') as f:\n        content = f.read()\n        print(f\"Decrypted content: '{content}'\")\n\n    # Verify content\n    with open(input_file, 'r') as f_orig, open(decrypted_file, 'r') as f_dec:\n        if f_orig.read() == f_dec.read():\n            print(\"Decryption successful and content matches original.\")\n        else:\n            print(\"WARNING: Decrypted content does NOT match original!\")\n\nexcept pyAesCrypt.AESCryptException as e:\n    print(f\"An encryption/decryption error occurred: {e}\")\nexcept FileNotFoundError as e:\n    print(f\"File not found error: {e}\")\nexcept PermissionError as e:\n    print(f\"Permission error: {e}\")\nfinally:\n    # --- Cleanup ---\n    for f in [input_file, encrypted_file, decrypted_file]:\n        if os.path.exists(f):\n            os.remove(f)\n            print(f\"Cleaned up '{f}'.\")\n","lang":"python","description":"This quickstart demonstrates how to encrypt and decrypt a file using `pyAesCrypt.encryptFile` and `pyAesCrypt.decryptFile`. It creates a dummy text file, encrypts it, decrypts it, prints the decrypted content, and then cleans up the temporary files. Remember to use a strong password and manage it securely.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-18","installed_version":"6.1.1","pypi_latest":"6.1.1","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":2.5,"avg_import_s":0.03,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"pyaescrypt","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.03,"mem_mb":1.5,"disk_size":"34.4M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"pyaescrypt","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.6,"import_time_s":0.02,"mem_mb":1.5,"disk_size":"35M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"pyaescrypt","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.04,"mem_mb":1.6,"disk_size":"36.5M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"pyaescrypt","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.4,"import_time_s":0.03,"mem_mb":1.6,"disk_size":"37M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"pyaescrypt","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.03,"mem_mb":1.3,"disk_size":"28.3M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"pyaescrypt","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.1,"import_time_s":0.03,"mem_mb":1.3,"disk_size":"29M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"pyaescrypt","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.03,"mem_mb":1.4,"disk_size":"28.0M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"pyaescrypt","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":2.2,"import_time_s":0.03,"mem_mb":1.2,"disk_size":"28M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"pyaescrypt","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0.03,"mem_mb":1.4,"disk_size":"34.6M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"pyaescrypt","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":3,"import_time_s":0.02,"mem_mb":1.4,"disk_size":"35M"}]}}