Files
Patrik Dominik Pordi cc492bbf6e
Some checks are pending
Build all targets / Scan for Board Targets (push) Waiting to run
Build all targets / Build Group [${{ matrix.group }}] (push) Blocked by required conditions
Build all targets / Upload Artifacts to S3 (push) Blocked by required conditions
Build all targets / Create Release and Upload Artifacts (push) Blocked by required conditions
Checks / build (NO_NINJA_BUILD=1 px4_fmu-v5_default) (push) Waiting to run
Checks / build (NO_NINJA_BUILD=1 px4_sitl_default) (push) Waiting to run
Checks / build (check_format) (push) Waiting to run
Checks / build (check_newlines) (push) Waiting to run
Checks / build (module_documentation) (push) Waiting to run
Checks / build (px4_fmu-v2_default stack_check) (push) Waiting to run
Checks / build (px4_sitl_allyes) (push) Waiting to run
Checks / build (shellcheck_all) (push) Waiting to run
Checks / build (tests) (push) Waiting to run
Checks / build (tests_coverage) (push) Waiting to run
Checks / build (validate_module_configs) (push) Waiting to run
Clang Tidy / build (push) Waiting to run
MacOS build / build (px4_fmu-v5_default) (push) Waiting to run
MacOS build / build (px4_sitl) (push) Waiting to run
Ubuntu environment build / Build and Test (ubuntu:22.04) (push) Waiting to run
Ubuntu environment build / Build and Test (ubuntu:24.04) (push) Waiting to run
Container build / Build and Push Container (push) Waiting to run
EKF Update Change Indicator / unit_tests (push) Waiting to run
Failsafe Simulator Build / build (failsafe_web) (push) Waiting to run
FLASH usage analysis / Analyzing px4_fmu-v5x (push) Waiting to run
FLASH usage analysis / Analyzing px4_fmu-v6x (push) Waiting to run
FLASH usage analysis / Publish Results (push) Blocked by required conditions
MAVROS Mission Tests / build (map[mission:MC_mission_box vehicle:iris]) (push) Waiting to run
MAVROS Mission Tests / build (map[mission:rover_mission_1 vehicle:rover]) (push) Waiting to run
MAVROS Offboard Tests / build (map[test_file:mavros_posix_tests_offboard_posctl.test vehicle:iris]) (push) Waiting to run
Nuttx Target with extra env config / build (px4_fmu-v5_default) (push) Waiting to run
Python CI Checks / build (push) Waiting to run
ROS Translation Node Tests / Build and test (map[ros_version:humble ubuntu:jammy]) (push) Waiting to run
ROS Translation Node Tests / Build and test (map[ros_version:jazzy ubuntu:noble]) (push) Waiting to run
SITL Tests / Testing PX4 tailsitter (push) Waiting to run
SITL Tests / Testing PX4 iris (push) Waiting to run
SITL Tests / Testing PX4 standard_vtol (push) Waiting to run
[Sponsored by ARK] Encryption (#24489)
* Added the board configs for encryption, I had to disable smbus and px4 io in the arkv6x

* Added the key generator script

* Added the decryptor, logs are needed for it though

* Added the log download and modified the decryptor

* Quick fixes & README

* Additional modifications & cleanup

* Tested upd connection
Adjusted the log downloader to handle multiple entry responses from the FC
Edited README

* Reverted IP address change

* Added pycryptodome to the requirements.txt

* fixes for log download and decryption

* Removed old log decryptors and updated README

* Pointed the ark borads to the dummy key updated the README accordingly

* Adjusted the folders in README, removed new lines

* Extended command line arguments for all possibilities for description

* Added MAV_CMD_REQUEST_AUTOPILOT_CAPABILITIES after heartbeat received to make sure log request is answered in all cases

* Update Tools/log_encryption/README.md

Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>

* Update Tools/log_encryption/README.md

Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>

* Update Tools/log_encryption/README.md

Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>

* Update Tools/log_encryption/README.md

Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>

* Edited README, changed the serial connection logic and updated logdownload, made decryption a bit easier to understand

* Update Tools/log_encryption/README.md

Co-authored-by: Hamish Willee <hamishwillee@gmail.com>

* Removed new lines

* arkv6x: add individual mags to default.px4board

---------

Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
Co-authored-by: Alex Klimaj <alex@arkelectron.com>
Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
2025-04-02 23:40:45 -08:00
..

PX4 Log Encryption Tools

Tools for generating encryption keys, building PX4 firmware with encrypted logs, downloading logs, and decrypting them.

For more information see: https://docs.px4.io/main/en/dev_log/log_encryption.html

Usage

  1. Get the board file: In order to use these tools you need to create an encrypted_logs target in your target board directory. For example:

    encrypted_logs.px4board
    

    Using make menuconfig you should enable these settings: Blake2s hash algorithm, entropy pool and strong random number generator and select use interrupts to feed timing randomness to the entropy pool. Once you have generated the keys make sure you add them to the boardconfig.

    make <your_board_name>_encrypted_logs menuconfig
    
  2. Generate Keys:

    cd PX4-Autopilot/Tools/log_encryption
    python3 generate_keys.py
    

    Make sure you have the right key in your board file CONFIG_PUBLIC_KEY1="../../../keys/public/public_key.pub"

  3. Build Firmware:

    cd PX4-Autopilot
    
    AND
    
    make <your_board_name>_encrypted_logs
    
    FOR INSTANCE
    make_ark_fpv_encrypted_logs
    
    Upload the custom firmware on your flight controller and record some logs
    
  4. Download Logs:

    cd PX4-Autopilot/Tools/log_encryption
    
    python3 download_logs.py /dev/ttyACM0 --baudrate 57600
    
    OR
    
    python3 download_logs.py udp:0.0.0.0:14550
    

    Addresses might need to be adjusted

  5. Decrypt Logs: The easiest way to run this is to have your private key and encrypted logs in the following folders respectively:

    PX4-Autopilot/keys/private
    PX4-Autopilot/logs/encrypted
    

    Then run:

    cd PX4-Autopilot/Tools/log_encryption
    
    AND
    # Uses default key + default folder
    python3 decrypt_logs.py
    
    OR
    # Use --help to get all the options
    python3 decrypt_logs.py --help
    

    Your decrypted logs can be found in:

    PX4-Autopilot/logs/decrypted
    

    Otherwise

Directory Structure

  • keys/: Encryption keys.
  • logs/encrypted/: Downloaded encrypted logs.
  • logs/decrypted/: Decrypted logs.