Skip to content

πŸ’» Interact with TurtlPass devices from the terminal β€” hardware-backed passwords and cryptographic seeds, safe and local.

License

Notifications You must be signed in to change notification settings

TurtlPass/turtlpass-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Logo

πŸ”— TurtlPass Ecosystem

🐒 Firmware β€’ πŸ’Ύ Protobuf β€’ πŸ’» Host β€’ 🌐 Chrome β€’ πŸ“± Android


πŸ’» TurtlPass Host (Python CLI)

A minimal host-side command-line client for interacting with TurtlPass hardware devices via USB. Generate passwords, manage cryptographic seeds, and control your TurtlPass device securely and locally β€” all from the terminal.


⚑ Features

  • πŸ”Œ Automatic Device Detection β€” Instantly detects connected TurtlPass devices
  • πŸ” Secure Password Generation β€” Fully configurable length & charset
  • 🧬 Seed Management β€” Initialize, generate, or restore 512-bit seeds from 24-word BIP-39 mnemonics
  • πŸ’₯ Factory Reset β€” Safely reset your device to factory defaults
  • πŸ”’ Hardware Security β€” All cryptography happens on-device; seeds never leave the TurtlPass

βš™οΈ Requirements

  • Python 3.8+
  • TurtlPass device
  • USB cable with data support

πŸ“¦ Installation

git clone https://github.com/TurtlPass/turtlpass-python.git
cd turtlpass-python
pip install -r requirements.txt

πŸš€ Usage

  1. Plug in your TurtlPass device and run:

    python turtlpass.py
  2. Choose from the interactive menu:

    β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•—β–‘β–‘β–‘β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•—β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
    β•šβ•β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β•šβ•β•β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•
    β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–‘
    β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ•”β•β•β•β•β–‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–‘β•šβ•β•β•β–ˆβ–ˆβ•—β–‘β•šβ•β•β•β–ˆβ–ˆβ•—
    β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–‘β–‘β–‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–‘β–‘β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–‘β–‘β–‘β–‘β–‘β–ˆβ–ˆβ•‘β–‘β–‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•
    β–‘β–‘β–‘β•šβ•β•β–‘β–‘β–‘β–‘β•šβ•β•β•β•β•β•β–‘β•šβ•β•β–‘β–‘β•šβ•β•β–‘β–‘β–‘β•šβ•β•β–‘β–‘β–‘β•šβ•β•β•β•β•β•β•β•šβ•β•β–‘β–‘β–‘β–‘β–‘β•šβ•β•β–‘β–‘β•šβ•β•β•šβ•β•β•β•β•β•β–‘β•šβ•β•β•β•β•β•β–‘
    Welcome to TurtlPass!
    Device detected: /dev/cu.usbmodem14101
    Options:
    0. <Exit>
    1. Get TurtlDevice Information
    2. Generate Password on TurtlDevice
    3. Initialize TurtlDevice with 512-bit Seed
    4. Generate 24-word Mnemonic and Derive 512-bit Seed
    5. Restore 512-bit Seed from a 24-word Mnemonic
    6. Factory Reset TurtlDevice (⚠️ DANGEROUS)
    Select an option: 
    

πŸ“– Usage Example: Generate a Password

2. Generate Password on TurtlDevice
β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘
Enter desired password length (1-128) [press ENTER to use 100]: 128
Select character set:
1. Numbers (0–9)
2. Letters (a–z, A–Z)
3. Letters + Numbers (a–z, A–Z, 0–9)  [default]
4. Letters + Numbers + Symbols (a–z, A–Z, 0–9, symbols)
Choose charset [press ENTER to use default]: 4

Enter Domain Name (e.g. 'google'): github
Enter Account ID (e.g. 'user@example.com'): turtlpass@ryanamaral.com
Enter PIN (e.g. '704713'): ******

βœ… Password successfully generated
β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘

All passwords are generated on-device, ensuring maximum security.


πŸ’» Supported Platforms

OS Status
Linux βœ… Supported
macOS βœ… Supported
Windows βœ… Supported

🧰 Troubleshooting

  • Device not detected: Ensure USB cable supports data transfer and device is plugged in
  • Linux users: You may need to add a udev rule for USB access
  • macOS users: Check /dev/cu.* to find the connected device
  • Windows users: Verify COM port and drivers

πŸ“š Dependencies

  • argon2-cffi β€” Secure Argon2 key derivation and password hashing
  • pyserial β€” USB communication with the TurtlPass device
  • protobuf β€” Protocol Buffers serialization for device messages
  • mnemonic β€” BIP-39 mnemonic generation and seed handling

πŸ“œ License

This repository is licensed under the MIT License.

About

πŸ’» Interact with TurtlPass devices from the terminal β€” hardware-backed passwords and cryptographic seeds, safe and local.

Topics

Resources

License

Stars

Watchers

Forks

Languages