hartwork / mozilla-password-decrypt Goto Github PK
View Code? Open in Web Editor NEW:unlock: Decrypt passwords stored by Firefox, Thunderbird, Iceweasel, Icedove using libnss3.so
:unlock: Decrypt passwords stored by Firefox, Thunderbird, Iceweasel, Icedove using libnss3.so
(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.
FYI @nyov
Three parts should be extracted from decrypt_single
:
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.
Minimum:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.