I doing some free spare time programming to understanding Data Encryption and Compression..
so...
Encrypt first then Compress?
.NET Encryption or Compression come first, small file and encrypted
.NET Encryption or Compression come first, small file and encrypted
|
Jun 9 2016, 11:16 PM, updated 8y ago
Show posts by this member only | Post
#1
|
Senior Member
1,917 posts Joined: Jul 2009 From: /dev/null |
I doing some free spare time programming to understanding Data Encryption and Compression..
so... Encrypt first then Compress? |
|
|
|
Jun 10 2016, 02:30 AM
Show posts by this member only | IPv6 | Post
#2
|
VIP
6,008 posts Joined: Jan 2003 |
No. You compress first, then encrypt.
Compression removes redundancy from the input, for example repeated words or phrases. Encryption scrambles the input so that someone cannot determine from the output, without knowing the key. Good encryption conceals redundancy in the input, so the output it produces is at odds with the ideal input for compression. Why do you think you should encrypt first? This post has been edited by wKkaY: Jun 10 2016, 02:32 AM |
|
Jun 10 2016, 07:51 AM
Show posts by this member only | Post
#3
|
Senior Member
4,544 posts Joined: Dec 2004 From: Metro Prima, Kuala Lumpur, Malaysia, Earth, Sol |
Are u asking chicken or egg 1st ?
sounds like u are asking which technology invented first =P |
|
Jun 10 2016, 10:48 AM
Show posts by this member only | Post
#4
|
Senior Member
986 posts Joined: Jan 2003 |
Usually if you encrypt first, your compression won't be good because encryption will remove repetitive block that can be remove during compression. So compress first then encrypt.
|
|
Jun 10 2016, 10:55 AM
Show posts by this member only | Post
#5
|
Senior Member
986 posts Joined: Jan 2003 |
QUOTE(narf03 @ Jun 10 2016, 07:51 AM) If egg come first, it will never hatches because it will rot because you need to incubate it. If the egg somehow managed to survive, the chick will never survive without mother hen.I wonder who come out with this chicken/egg thing and why everybody keep using it. There are other animal like duck that you don't have to incubate the egg and baby duck can survive on their own, yet they still use chicken. Are they all just plain stupid? Are you? Compress first!! Totally off topic and give wrong analogy using totally wrong example. |
|
Jun 20 2016, 03:56 PM
Show posts by this member only | Post
#6
|
Junior Member
111 posts Joined: Jan 2003 |
Compress first then encrypt due to how compression algorithm works by eliminating redundancy and known formats. If you encrypt first such redundancies/known formats won't be there anymore and
resulted in poor compression ratio. You can read more in details here |
|
Jun 29 2016, 12:59 PM
Show posts by this member only | Post
#7
|
Junior Member
238 posts Joined: May 2011 |
There's this article on Hacker News today
that describes potential security issue with compress then encrypt:- Should you encrypt or compress first? http://blog.appcanary.com/2016/encrypt-or-compress.html |
|
Jun 29 2016, 01:12 PM
Show posts by this member only | Post
#8
|
Junior Member
635 posts Joined: Jul 2006 |
QUOTE(iammyself @ Jun 29 2016, 12:59 PM) There's this article on Hacker News today tl/dr: Compress, then encrypt, unless the stuff you use/do have potential for side channel attacks. (e.g. interactive sessions, or repeated requests ala CRIME)that describes potential security issue with compress then encrypt:- Should you encrypt or compress first? http://blog.appcanary.com/2016/encrypt-or-compress.html Or just randomly append the results till you get a minimum block size so that's not too far off from your average block size (for your interactive session). Or just read the HN discussion. Better, more knowledge folks there: https://news.ycombinator.com/item?id=11994286 This post has been edited by angch: Jun 29 2016, 01:13 PM |
Change to: | 0.0142sec
0.28
5 queries
GZIP Disabled
Time is now: 29th March 2024 - 07:39 AM |