Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Customer data encryption

by traveler (Parson)
on Feb 25, 2007 at 16:22 UTC ( #602009=note: print w/ replies, xml ) Need Help??


in reply to Customer data encryption

Also, do I need to encrypt and then compress, or compress and then encrypt?

If you want the compression to actually compress the data you must compress first. If you encrypt the data it should make the data look random, there will be no patterns (for any reasonable algorithm). Compression algorithms rely on patterns to reduce the size of the data. So, if you compress first, you get the benefit of the compression, if you encrypt first, it may actually increase the size of the final output. Corrected


Comment on Re: Customer data encryption
Re^2: Customer data encryption
by 0xbeef (Hermit) on Feb 25, 2007 at 16:47 UTC
    Thanks, this makes sense and I will likely end up using it like this. I was wondering if there are any drawbacks to compressing first - e.g. if an attacker could perhaps exploit any patterns that gzip/bzip2 may produce?

    Niel

      Very unlikely. Encryption will add entropy to the entropy making it somewhat more difficult to crack than just encrypted text.
      That's what salting is for.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://602009]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2014-09-18 02:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (105 votes), past polls