My best guess is to compress first because of the dictionary coding method used by a lot of compression algorithms.<br><br>If you encrypt first the dictionary coding function won't have much to work with.<div><br><br><div class="gmail_quote"><div dir="ltr">On Fri, 18 Nov 2016, 16:29 Ross Wheeler <<a href="mailto:ausnog@rossw.net">ausnog@rossw.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br class="gmail_msg">
Esteemed geeks, I seek your considered input.<br class="gmail_msg">
<br class="gmail_msg">
As part of "that which we may not discuss", I am seeking arguments as to<br class="gmail_msg">
precedence.<br class="gmail_msg">
<br class="gmail_msg">
If I have a plain-text log file on machine (a), that I wish to store<br class="gmail_msg">
securely for some period on machine (b), is it better to encrypt the file<br class="gmail_msg">
first and then compress it, or to compress it first and then encrypt it?<br class="gmail_msg">
Either way, it will be encrypted before it leaves machine (a) over an ssh<br class="gmail_msg">
link, and will be stored in the (compressed and encrypted) form on the<br class="gmail_msg">
storage device.<br class="gmail_msg">
<br class="gmail_msg">
I think compression is likely to be vastly superior for text files than<br class="gmail_msg">
binary files, so compression first, then encrypt the (binary) file, and<br class="gmail_msg">
indeed a couple of quick tests shows files are 10-15 times larger if I<br class="gmail_msg">
encrypt first. (330KB vs 5500KB, 125KB vs 1611KB). Given there will be a<br class="gmail_msg">
lot of files to copy daily, the savings in transmission time, storage and<br class="gmail_msg">
possibly CPU (must be easier to encrypt a small file than a large one),<br class="gmail_msg">
this looks like the clear winner.<br class="gmail_msg">
<br class="gmail_msg">
I'm not sure there's much difference either way when extracting data, but<br class="gmail_msg">
if anyone knows of a pitfall in this process, I'd rather hear about it<br class="gmail_msg">
before I get too far down the road!<br class="gmail_msg">
<br class="gmail_msg">
Thanks guys, and have a good weekend... it's almost beer oclock!<br class="gmail_msg">
<br class="gmail_msg">
R.<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
AusNOG mailing list<br class="gmail_msg">
<a href="mailto:AusNOG@lists.ausnog.net" class="gmail_msg" target="_blank">AusNOG@lists.ausnog.net</a><br class="gmail_msg">
<a href="http://lists.ausnog.net/mailman/listinfo/ausnog" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.ausnog.net/mailman/listinfo/ausnog</a><br class="gmail_msg">
</blockquote></div></div>