fix: encode base64 string as a single line during encryption#4
Merged
Conversation
If the encrypted string is long, the following error may occur during decryption: ``` bad decrypt 40C795C66F7F0000:error:1C800064:Provider routines:ossl_cipher_unpadblock:bad decrypt:../providers/implementations/ciphers/ciphercommon_block.c:124: ``` To prevent this error, use the -A flag during decryption. The -A flag ensures that the Base64-encoded string is written as a single line without line breaks. For more details, refer to the following documentation: - [OpenSSL Base64 Encoding Documentation](https://wiki.openssl.org/index.php/Enc#Base64_Encoding) The document notes: > These flags tell OpenSSL to apply Base64-encoding before or after the cryptographic operation. > The -a and -base64 are equivalent. If you want to decode a base64 file it is necessary to use the -d option. > **By default the encoded file has a line break every 64 characters**. > To suppress this you can use in addition to -base64 the -A flag. > This will produce a file with no line breaks at all. You can use these flags just for encoding Base64 without any ciphers involved.
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.
If the encrypted string is long, the following error may occur during decryption:
To prevent this error, use the -A flag during decryption.
The -A flag ensures that the Base64-encoded string is written as a single line without line breaks.
For more details, refer to the following documentation:
The document notes: