Giter Club home page Giter Club logo

mozilla-password-decrypt's People

Contributors

hartwork avatar nyov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mozilla-password-decrypt's Issues

Project structure

(To not discuss this in #3 )
I though on how to continue with this or refactor it, taking both decoding and encoding into mind.
First I'd like to ask about renaming and shortening the module. mozilla_passwords or mozpassword would be my take. This is also for consideration of #2 (packaging).

For the module structure, after some thought, I would go with a few classes: a database/file representation (loader), a login/password/site representation and a wrapper class for the NSS functionality:

My first thought was to go with a Decryptor and Encryptor class, but then it makes sense to combine this in a "NssPK11Password" (or something) class with both decryption and encryption methods which takes care of setup and teardown of NSS for use in both decrypting and encrypting (and keeping it around).

After that I'd think to go with another class for the Mozilla Logins (Moz[illa]Password or Moz[illa]Login comes to mind -- "Site" would feel wrong for e.g. Thunderbird logins, and any "Site" could have multiple login forms), which handles the data structure derived from the signons database (or, optionally, later also support for the signons.txt Netscape Communicator Key Database Format). I have gone with the namedtuple for this now, but it would probably extend to some custom class methods later.

Then the loader class to represent a file storage (sqlite db or signons.txt) would handle loading and saving entries -- return MozillaLogin objects and store/update passed-in objects, and do NSS login/logout for password protected databases.
This class would pull in the sqlite dependencies when inspecting a signons db, or something else for the netscape text format.

This is a layout I think would feel natural to me, unless you maybe have reason to go with a more functional approach and less mutable datastructures.

Break up decrypt_single (volunteers wanted)

Three parts should be extracted from decrypt_single:

  • Initialization
  • Decryption
  • Clean-up

decrypt_single should use those parts.

After that, cli.py should be made to call these three parts rather than decrypt_single.
The latter should be kept for convenience, though.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.