79318362

Date: 2024-12-30 18:51:48
Score: 0.5
Natty:
Report link

It is possible to do so, but certainly not optimal or recommended considering your use case. It is not possible to predict the char range before AES encryption, so the main idea is that you could try to encrypt the message with a different key and/or a different IV instead, and do so until you detect programmatically that the ciphertext contains no special char before sending it over the network. Your service will then suffer another problem considering the security of key sharing and decryption unless you choose to work only with a new IV. Using Base64 encoding like TheNytangel answer will use less bandwidth over the network while tackle the initial problem more effectively.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Low reputation (0.5):
Posted by: v-g