c# - Eliminate Special Characters in GnuPG Encryption -
is there way eliminate special characters when encrypting gnupg
. got below issue. when encrypt text gpg
including special characters +
.
encrypt command
--encrypt --armor --recipient
so when encrypted text passed via query string , when try decrypt. getting below error.
error
gpg: no valid openpgp data found.gpg: decrypt_message failed: unknown system error
so, there way configure gpg
not include special characters?
no, there isn't. openpgp specifies 2 encodings, ascii armoring use , binary format.
ascii armoring has been developed mail transfer allows basic, 7-bit ascii characters without further encoding.
url encoding requires additional limitations or encoding. if cannot change data (and gnupg/openpgp can't), you'll have add encoding enforced transfer protocol chose.
luckily, c# has such url encoding , decoding methods built-in. i'd propose try url-encoding binary data if transmission size critical, might save significant portion of data. if transmit small encrypted messages, i'd stay url encoding ascii-armored message, handling ascii-armored string data more robust exchanging binary information.
Comments
Post a Comment