Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

HyShai/lastpass-pythonista

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LastPass Pythonista

Original: lastpass-python (adapted for iOS - Pythonista)

Uses Pythonista to allow for pseudo x-callback-url functionality for LastPass. It downloads your LastPass vault and stores it in Pythonista's keychain. You can then use Pythonista's powerful scripting coupled with an app such as Launch Center Pro to make the LastPass iOS experience much more bearable.

Note: This does a one-way read-only sync from LastPass using an unofficial API - if you want to manipulate your vault in any way (delete/edit) you must use the official LastPass iOS app (requires a LastPass Premium subscription - $12/yr).

There are 2 ways to import your accounts:

  1. save the encrypted blob locally
  2. save your accounts to the keychain

The advantage to using the encrypted blob is that your accounts are not saved to the keychain. Although the keychain is encrypted, there may be ways to access it from other apps. Please weigh the risks before using this.

The advantage to using the keychain is that it is a bit faster and you are not prompted for the lastpass master credentials each time that the blob is opened. You should set keychain.set_master_password for additional security.

By default lpfinder.py will look for .lastpass.blob first and fallback to the keychain. If you want to use the keychain, run the import again and choose "Save to keychain" when prompted. If you want to switch to the blob run the import again and choose "Don't Save to keychain".

See below for more.

Installation:

  • Using filedownloader.py, download and extract the zip of this repo:
    • Set URL to https://codeload.github.com/HyShai/lastpass-pythonista/zip/master.
    • Tap "Download"
    • When the Extract File alert appears, tap "OK".

Or

  • Using Shellista, type the following commands:
    mkdir lastpass
    cd lastpass
    git clone https://github.com/HyShai/lastpass-pythonista.git

Or

Usage:

  1. Import your accounts by running lpimport_api.py
  2. To use it in an x-callback-url manner run lpfinder.py which takes 2 arguments - account_name and redirect_url
  3. Tap the account for which you want the password
  4. The password will be copied to the clipboard and you will be redirected to the url/app that you passed in
  5. Use lpimport_api.py to manually update your accounts (read-only)

If you want to use the encrypted blob, you can optionally save your lastpass master credentials to the keychain for convenience - though this entails the same risk as above.

  • Save your email as service=lastpass_email, account=lastpass, password={{your-email}}.
  • Save your password as service=lastpass_master, account=lastpass, password={{your-password}}.

The names of the service and account are definite - see lpfinder.py if you want to change them. See keychain.set_password

An example Launch Center Pro action is here: https://launchcenterpro.com/q9qmfg

Example

LP Example Tap this image to see how it works.

Credits

Credit for the vast majority of the reverse engineered LastPass API goes to Dmitry Yakimenko

Credit for the Python version of the API goes to konomae

Credit for the adaption of PBKDF to use pbkdf2 instead of simple-pbkdf2 goes to Ole Moritz (and without whom we wouldn't have the awesome Pythonista ;) )

Credit for pbkdf2.py goes to Dwayne C. Litzenberger

License

The MIT License

About

LastPass Python API, adapted for iOS - Pythonista

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages