I am using a Chrome extension to encrypt data and post it over HTTPS to a PHP script that stores them into a MySQL database. Then, the database is dumped and sent to a secure environment where the data is decrypted.
For encryption I'm using a RSA-2048 public key that I ship with the extension.
The data is just an array of bytes (represented as integers) and the length of the array is always a multiple of five. Something like this:
var data = [255, 24, 16, 0, 34];
In RSA-2048 I can only encrypt up to 245 bytes. I don't want to encode these bytes in base64 because I will only be able to store 120 bytes of the original data. What is the most efficient encoding that is safe for transport in this case?