Encryption key related improvements (QOL) #16
Merged
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.
Adds a table of known keys, associated with (partial) signatures.
When the signature of the current
config.bin
matches one in the table and the--key
parameter is omitted, the associated key gets used automatically.Also adds a new parameter,
--try-all-known-keys
, todecode.py
, which tries all the keys in the table against the payload, until one decrypts it successfully (checks if the decrypted payload starts with the payload magic), or it runs out of keys.Lastly, it adds a few messages to help the user.
If a key was automatically chosen, it gets printed, so the user knows how to re-encrypt the file.
If the decrypted payload doesn't start with the magic, the user gets an error suggesting that the key was wrong, instead of a stacktrace.
If
encode.py
gets used without a key or signature, the user gets some warnings.