Encryption and decryption is a joke #1
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Basically, right now, decryption is fake. Books are stored as plaintext files with the password used as part of the filename, and then the books' text is scrambled.
This basically means that the encryption process itself is unnecessary as the only thing it does is scramble the contents of the book, and could just as well be replaced with filling the book with randomness.
If possible, the book should be properly encrypted and decrypted, with the password stored in a file if adminDecrypt is enabled. Perhaps use a proper encryption algorithm, but that might break compatibility with existing books.
Note: For AES, the IV and salt would need to be retained. Most likely, instead of storing the original book file, a new one would need to be stored with Base64 IV and Base64 salt stored as extra parameters, and each encrypted page would be stored instead of the original unencrypted ones.
The encryption method should be stored in the book file for each type.
Should probably have an option for real encryption vs. the current encryption.
Instead of storing the key as part of the file name, it should be stored in the file.
The existing decryption code should be retained for existing encrypted books.
An optional true encryption mode has been added in the string-formatting branch, and will be merged once that's all finished