NinebotTEA is an open-source command-line tool and library designed for the encryption and decryption needs of Ninebot manufactured scooter firmware. It is based on the Tiny Encryption Algorithm (TEA), tailored specifically to meet the requirements of Ninebot scooter firmware.
- Command-line interface for easy encryption and decryption of firmware data.
- Library capabilities for integration into scooter firmware development projects.
- Supports Ninebot scooters and Xiaomi scooters manufactured by Ninebot.
- Customizable encryption keys.
- Optimized for handling ZIP firmware archives.
pip install git+https://github.com/scooterhacking/NinebotTEA.git
CLI Usage:
-
Encrypt Firmware Data:
ninebottea encrypt <input_path> <output_path> --key <hex_key>
-
Decrypt Firmware Data:
ninebottea decrypt <input_path> <output_path> --key <hex_key>
Library Usage:
For firmware development, include NinebotTEA in your project to aid in the creation of ready to flash firmware packages:
from ninebottea import NinebotTEA
# Initialize the TEA algorithm with an optional key
tea = NinebotTEA(key=your_optional_bytes_key)
# To encrypt data
encrypted_data = tea.encrypt(data_to_encrypt)
# To decrypt data
decrypted_data = tea.decrypt(encrypted_data)
An example code of how complete firmware packages can be created with the aid of this library can be found here.
-
Encrypting Firmware Data via CLI:
python NinebotTEA.py encrypt firmware_original.bin firmware_encrypted.bin --key 1a2b3c4d5e6f7890a1b2c3d4e5f60708
-
Decrypting Firmware Data via CLI:
python NinebotTEA.py decrypt firmware_encrypted.bin firmware_decrypted.bin --key 1a2b3c4d5e6f7890a1b2c3d4e5f60708
-
Using in a Firmware Project:
# Assuming tea is an instance of NinebotTEA encrypted_zip = tea.encrypt(zip_content)
We encourage contributions from those knowledgeable in encryption, scooter firmware, and scooter hacking in general. To contribute:
- Fork the repository.
- Create a new branch for your feature (
git checkout -b feature/AmazingFeature
). - Commit your changes (
git commit -m 'Add some AmazingFeature'
). - Push to the branch (
git push origin feature/AmazingFeature
). - Open a pull request.
Distributed under the MIT License. See LICENSE
for more information.
For any issues or questions, especially related to the use of NinebotTEA with Ninebot and Xiaomi scooter firmware or ZIP firmware archives, please file an issue on the project's GitHub issue tracker, or reach out to us on the ScooterHacking Assembly.