Privatebin plugin - #153
Open
rfc2119 wants to merge 32 commits into
Open
Conversation
Owner
|
I love this. Let's fast track it. |
changed some types in earlier commit to suit json; still unclear about some no tests were made whatsoever
rfc2119
force-pushed
the
feature/pastebin
branch
from
April 6, 2020 15:37
86168f7 to
9d48ec9
Compare
the JSON structure sent does not map well to Go types, but it should be ok now to do JSON marshalling
final commit before testing
one more error to go!
m-242
marked this pull request as ready for review
April 12, 2020 18:19
m-242
marked this pull request as draft
April 12, 2020 18:22
Contributor
Author
|
A very bare-bones version is up! Here's a to-do list:
|
rfc2119
marked this pull request as ready for review
April 19, 2020 10:22
Collaborator
|
This needs formatting, use |
it turns out that req.WriteReq() consumes the req, hence subsequent calls find an empty request, which generates all sorts of error encoded paste data with zlib (will be removed later) authenticated aData; re-added docker-compose file
as it turned out, the key used in decryption is derived from the base58 encoded key and paste password; Initially, I thought the key used in AES is the random-looking key Interestingly enough, the KDF package is released 4 days ago by the Go crypto team, with version number v0.0.0
Instead of looking for a "NAN" field which may or may not be there (are you sorry, Canada?) we should run a collector value that adds the totals for each province in a given country code.
Signed-off-by: Olivier Moreau m242 <m242@protonmail.com>
Signed-off-by: Olivier Moreau m242 <m242@protonmail.com>
* Add .deepsource.toml * Remove unnecessary blank (_) identifier * Fix Yoda conditions (testing deepsource) Co-authored-by: DeepSource Bot <bot@deepsource.io> Co-authored-by: deepsource-autofix[bot] <62050782+deepsource-autofix[bot]@users.noreply.github.com>
…on named triggers.
used ```shell
cd bitbot
grep -R "NamedTrigger" | cut -d":" -f 1 | xargs -I f sed -i "s,NamedTrigger{,& //nolint:gochecknoglobals," f
```
Signed-off-by: Olivier Moreau m242 <m242@protonmail.com>
Signed-off-by: Olivier Moreau m242 <m242@protonmail.com>
…ts it to have an error return which it doesn't have. Signed-off-by: Olivier Moreau m242 <m242@protonmail.com>
Signed-off-by: Olivier Moreau m242 <m242@protonmail.com>
Signed-off-by: Olivier Moreau m242 <m242@protonmail.com>
Signed-off-by: Olivier Moreau m242 <m242@protonmail.com>
rfc2119
force-pushed
the
feature/pastebin
branch
from
April 25, 2020 17:45
efbaab5 to
16f853f
Compare
…t touch the code.
Clarifying comments, and fmt-ing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is still a WIP. The following is a "draft" for me of what I have found and should be doing in the plugin. This implements #135
usage and scenario
create a new paste
/msg bitbot !paste <content>delete a paste
/msg bitbot !paste --delete <delete_token>see sample for sample server-side configuration file for privatebin (and for more ideas, like url-shortner)
the following sequence diagram represents the creation of a new paste:
encryption format
from here; the following request was sent with key
7MqznSyqHVx9VwNWfHRi6PLsr322eBY4Fnkx45tFV1gRA prompt for password shows up on wrong encryption keys. Also, for ducks sake, It took me a while to figure out that the key is encoded in base58. Here's the relevant code:
Key derivation (PBKDF2)
Since passwords and keys are usually too short to be usable for encryption, it is common practice to use salted key derivation to turn such low entropy input into the actual key to use during en/decryption.
where `paste_password i
The encrypted text is then:
generating
paste_passwordIf
paste_passwordis an empty string:if a
paste_passwordhas been specified:Processing of the paste_data, if compression is enabled (the default):
repsonse
{ "status": 0, "id": "8d18870b7b9ae766", "url": "/?8d18870b7b9ae766", "deletetoken": "61927f5710f04c399533fedcad07f5b5e13fc79e6e8df4065bc71217d1f7edad" }todo
see more at this comment