Path: csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python,': 0.02; 'subject:Python': 0.05; 'remaining': 0.07; 'cipher': 0.09; 'implies': 0.09; 'oh,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'substitution': 0.09; 'throw': 0.09; 'cc:addr:python-list': 0.10; 'files.': 0.13; 'wed,': 0.15; '"while': 0.16; '*only*': 0.16; '24,': 0.16; 'ciphers': 0.16; 'defence': 0.16; 'disk.': 0.16; 'encryption': 0.16; 'nefarious': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'wrote:': 0.16; 'suggested': 0.20; 'machine': 0.21; 'cc:2**0': 0.21; 'cc:addr:python.org': 0.21; 'are.': 0.22; '2015': 0.23; 'minutes.': 0.23; "i've": 0.24; 'header:In-Reply-To:1': 0.24; 'implemented': 0.24; 'written': 0.24; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'data,': 0.27; 'random': 0.29; "i'd": 0.31; 'supposed': 0.31; "can't": 0.32; 'post': 0.32; 'usually': 0.33; "d'aprano": 0.33; 'received:comcast.net': 0.33; 'steven': 0.33; 'to:addr:python-list': 0.35; 'but': 0.36; 'being': 0.36; 'thanks': 0.36; 'alone': 0.36; 'quite': 0.37; 'subject:: ': 0.37; "won't": 0.38; 'received:org': 0.38; 'files': 0.38; 'pm,': 0.39; 'performance': 0.39; 'to:addr:python.org': 0.39; 'system.': 0.39; 'resources': 0.39; 'data': 0.40; 'your': 0.60; 'real': 0.61; 'here.': 0.61; 'effective': 0.62; 'above,': 0.63; 'hours': 0.63; 'making': 0.64; 'spend': 0.64; 'charset:windows-1252': 0.65; 'here': 0.66; 'encrypted': 0.66; 'one-time': 0.66; 'subject:Data': 0.66; 'virus': 0.68; 'protect': 0.74; 'case?': 0.84; 'malware,': 0.84; 'oppositional': 0.84; 'partially': 0.84; 'sfxlen:4': 0.84; 'glad': 0.86; 'pfxlen:big': 0.91; 'spy': 0.91; 'senders': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Randall Smith Subject: Re: Pure Python Data Mangling or Encrypting Date: Thu, 25 Jun 2015 14:09:00 -0500 References: <558b7e85$0$1648$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: "comp.lang.python" X-Gmane-NNTP-Posting-Host: c-98-251-140-107.hsd1.ms.comcast.net User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 46 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1435259352 news.xs4all.nl 2944 [2001:888:2000:d::a6]:51314 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:93161 On 06/24/2015 11:27 PM, Devin Jeanpierre wrote: > On Wed, Jun 24, 2015 at 9:07 PM, Steven D'Aprano wrote: >> But just sticking to the three above, the first one is partially mitigated >> by allowing virus scanners to scan the data, but that implies that the >> owner of the storage machine can spy on the files. So you have a conflict >> here. > > If it's encrypted malware, and you can't decrypt it, there's no threat. > >> Honestly, the *only* real defence against the spying issue is to encrypt the >> files. Not obfuscate them with a lousy random substitution cipher. The >> storage machine can keep the files as long as they like, just by making a >> copy, and spend hours bruteforcing them. They *will* crack the substitution >> cipher. In pure Python, that may take a few days or weeks; in C, hours or >> days. If they have the resources to throw at it, minutes. Substitution >> ciphers have not been effective encryption since, oh, the 1950s, unless you >> use a one-time pad. Which you won't be. > > The original post said that the sender will usually send files they > encrypted, unless they are malicious. So if the sender wants them to > be encrypted, they already are. > > "While the data senders are supposed to encrypt data, that's not > guaranteed, and I'd like to protect the recipient against exposure to > nefarious data by mangling or encrypting the data before it is written > to disk." > > The cipher is just to keep the sender from being able to control what > is on disk. > > I am usually very oppositional when it comes to rolling your own > crypto, but am I alone here in thinking the OP very clearly laid out > their case? > > -- Devin > Thanks Devin. You understand the issue perfectly despite my limited description of the system. I've fully implemented and performance tested your suggested solution and am quite happy with it. Though the issue is solved, I would be glad to listen to any remaining criticisms, suggestions or questions. --Randall