Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/pre consumption/decrypt pdf #8

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

bernd3k
Copy link

@bernd3k bernd3k commented Nov 14, 2024

pre-consumption bash script for paperless-ngx to strip encryption with a known password from pdfs you're consuming. No cracking involved.

Relies on passwords.txt which the user has to fill/supply themselves,
though it's prefilled with some of the most common passwords that have
been found in various data dumps.
No cracking is performed. The script will try them out one by one until
one matches or it runs out of passwords to try.
If the password is over a certain length, the script will output a subtle
reminder with the character length and first and last character of the
matched password.

CAVEAT: the original document version will have no encryption
afterwards, if that is important to you.

Refer-to: https://en.wikipedia.org/wiki/List_of_the_most_common_passwords and other language variants
Refer-to: https://github.com/tarraschk/richelieu
Refer-to: https://nordpass.com/de/most-common-passwords-list/
also makes some command substitutions obsolete, reducing surface for errors
instead of a single monolithic password.txt, now all *.pwd.txt files within the script will
be concatenated together and tried out. This makes it easier to add new lists.
The file 'personal.pwd.txt' is reserved for the user's true passwords
and guarded via .gitignore.
e.g. constant use of curly braces and quoting for variables, capitalization
of names of code variables, constants, environment variables, etc.
also linting via SpellCheck

Refer-to: https://google.github.io/styleguide/shellguide.html
Refer-to: https://www.shellcheck.net/
skips as much of the script logic as possible for these cases
Copy link
Owner

@marcelbrueckner marcelbrueckner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for your contribution. I've reviewed your changes and they just need some small adjustments. After that, I'm happy to merge your PR.

docs/pre-consumption/README.md Outdated Show resolved Hide resolved
docs/pre-consumption/decrypt-pdf.md Show resolved Hide resolved
docs/pre-consumption/decrypt-pdf.md Show resolved Hide resolved
docs/pre-consumption/README.md Show resolved Hide resolved
@bernd3k bernd3k force-pushed the feat/pre-consumption/decrypt-pdf branch from cb9c758 to aba43f2 Compare November 24, 2024 02:27
Markdown was also linted
Comment on lines +15 to +17
* **personal.pwd.txt** is slated for your personal passwords, it's also added to the local _.gitignore_ file
* **insecure.pwd.txt** contains some of the most prolific passwords I could find
* you can create other files in the same manner to try passwords from dumps, "most common password in XXX" lists etc.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, it renders like this, enumerating the details on the password files:

grafik

But isn't it meant to render like this, with the details further indented? If so, please add a space before each unnumbered list item.

grafik

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that's funny because that's how it is written and rendered on GitHub and VisualStudio Code. Where is your output from?

2024-11-28 09_08_18-paperless sh_docs_pre-consumption_decrypt-pdf md at feat_pre-consumption_decrypt
2024-11-28 09_07_27-● decrypt-pdf md - fork_paperless sh - Visual Studio Code

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've checked out your code and ran mkdocs serve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants