Paul
Paul

Reputation: 385

Most space-saving encoding for storage?

I use AES-256 to encrypt files. I then base64_encode the data for the file and push it to the server. This is increasing the size of the file on average 133%. Is there a way for me to send it from JS->Database, w/ AJAX, where there is minimal space increase from just the regular encryption?

Upvotes: 0

Views: 1345

Answers (1)

If you care about transfer size then base64 is optimal (though potentially you can implement your own BASE95 or so encoding). If you care about storage size, you can decode base64 back into binary format and store binary data in BLOB fields, and if you need to send them back to the client, then encode them again.

Upvotes: 1

Related Questions