Comments (6)
Easiest would probably be to add a REST API-like interface to engine instead of the current CLI implementation, then write a simple frontend in vue/whatever
from pdfrip.
Consider using macros to allow compiling PDFRip in two modes, cli and UI/REST since it would probably simplify argument parsing logic since the different interfaces would have widely different parameters. This would be easiest if all user interactions (read: Parameter parsing) is separated to a separated layer from the rest of the application.
Alternatively just add a new mode to the arguments that starts the REST api, but it would make the binary pretty big to run both cli and REST at once.
Running Axum + utoipa for Swagger documentation would be neat imo if this is the chosen approach
from pdfrip.
I like the idea of this! Seems like something that could pretty easily be broken down into a handful of issues.
from pdfrip.
Yep, a webview approach sounds good.
@Pommaq One implementation detail I am curious to know your input on is the progress bar. To implement a progress bar in the GUI that works in the same way as the indicatif
progress bar in the console stdout, we would have to pass it on each channel message increments, which would affect performance since it involves network calls. We could show progress per 1000 (or n
) increments which should solve it but I am curious to know if you have a better idea since you implemented the current channel-based cracker.
from pdfrip.
Engine.rs takes a callback now, one way would be to add an API endpoint where we can "poll" the progress similarly to what you've already thought of, which returns e.g. how many passwords have been consumed from the producer + it's size, then the UI simply uses that periodically (for example, once a second wouldn't be too much of a performance hit).
The callback can likely just increment an atomic (thread safety, race conditions) integer which said endpoint uses to track the progress.
I've only put like 5 seconds of thought into how this could be done, but I believe the borrow checker could be angry about this approach since the api and engine are likely to run in different threads, a solution is to just wrap the integer in an Arc.
from pdfrip.
Alternatively, open a websocket and send the progress through it to avoid polling but it would then have the performance issues you've already thought of. Unless that websocket was to be run in a separate and very slim thread from the crackers.
Said socket would have the benefit that when the cracking has finished the results can be pushed to the UI instead of it being polled.
A future thing to keep in mind is that some crackers might be unable to estimate the number of passwords they will produce, an example would be a future implementation that simply reads passwords from a socket (This would allow a distributed producer approach) would be unable to know how many passwords it could get unless one were to implement some weird clunky protocol I think.
The easiest solution would be that those types of producers don't show a progress bar, instead it just shows a spinner + time elapsed
from pdfrip.
Related Issues (20)
- Missing Documentation for Passwords with Letters HOT 1
- Parse command for Year Range in ddmmyyyy format HOT 2
- Race condition in src/core/engine.rs
- Using Numbers in custom query HOT 1
- Feature request: resumable jobs HOT 3
- Password of '123B' was not cracked by default query. HOT 1
- Crash resulting from malloc error HOT 5
- Password of '1234' and 'q123' and was not found by default query HOT 2
- Feature request: brute-force range options
- Split PDFRip into multiple crates
- Rewrite PDFRip to take an Async approach HOT 1
- Cannot run custom-query without any integer ranges.
- Simple password not discovered using default-query (similar issue already reported by someone else) HOT 1
- Digital password didn't find by range but by default-query HOT 2
- wordlist crack dosent work HOT 1
- Says success but not showing password
- wanted new feature
- Allow dd.mm.yyyy date format and others
- Add Regex expressions to Custom Queries
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdfrip.