Re: Pure Python Data Mangling or Encrypting

2015-07-01 Thread Randall Smith
On 06/30/2015 01:33 PM, Chris Angelico wrote: From the software's point of view, it has two distinct modes: server, in which it listens on a socket and receives data, and client, in which it connects to other people's sockets and sends data. As such, the server mode is the only one that

Re: Pure Python Data Mangling or Encrypting

2015-06-30 Thread Randall Smith
On 06/29/2015 10:00 PM, Steven D'Aprano wrote: On Tue, 30 Jun 2015 06:52 am, Randall Smith wrote: Not sure why you posted the link. The crc32 checksum is just to check for possible filesystem corruption. The system does periodic data corruption checks. BTRFS uses crc32 checksums also

Re: Pure Python Data Mangling or Encrypting

2015-06-30 Thread Randall Smith
On 06/29/2015 03:49 PM, Jon Ribbens wrote: On 2015-06-29, Randall Smith rand...@tnr.cc wrote: Same reason newer filesystems like BTRFS use checkusms (BTRFS uses CRC32). The storage machine runs periodic file integrity checks. It has no control over the underlying filesystem. True

Re: Pure Python Data Mangling or Encrypting

2015-06-29 Thread Randall Smith
On 06/28/2015 09:21 AM, Jon Ribbens wrote: On 2015-06-27, Randall Smith rand...@tnr.cc wrote: Thankyou. Nice points. I do think given the risks (there are always risks) discussed, a successful attack of this nature is not very likely. Worse case, something that looks like this would land

Re: Pure Python Data Mangling or Encrypting

2015-06-29 Thread Randall Smith
On 06/27/2015 01:50 PM, Steven D'Aprano wrote: On Sun, 28 Jun 2015 03:08 am, Randall Smith wrote: Though I didn't mention it in the description, the storage server is appending a CRC32 checksum for routine integrity checks. So by the time the data hits the disk, it will have added both a 256

Re: Pure Python Data Mangling or Encrypting

2015-06-27 Thread Randall Smith
On 06/26/2015 08:21 PM, Chris Angelico wrote: On Sat, Jun 27, 2015 at 6:09 AM, Randall Smith rand...@tnr.cc wrote: Give me one plausible scenario where an attacker can cause malware to hit the disk after bytearray.translate with a 256 byte translation table and I'll be thankful to you

Re: Pure Python Data Mangling or Encrypting

2015-06-27 Thread Randall Smith
On 06/27/2015 03:29 AM, Peter Otten wrote: Would it be sufficient to prepend the chunk with one block, say, of random data? To unmangle you'd just strip off that block. BLOCK = os.urandom(BLOCKSIZE) def mangle(source, dest): dest.write(BLOCK) shutil.copyfileobj(source, dest) def

Re: Pure Python Data Mangling or Encrypting

2015-06-27 Thread Randall Smith
On 06/27/2015 07:38 AM, Grant Edwards wrote: On 2015-06-26, Randall Smith rand...@tnr.cc wrote: The only person who can read a file is the owner. That's always the plan, but many a successful exploit has been based on breaking that assumption. If privacy actually matters, that's not a good

Re: Pure Python Data Mangling or Encrypting

2015-06-26 Thread Randall Smith
On 06/26/2015 12:06 PM, Steven D'Aprano wrote: On Fri, 26 Jun 2015 11:01 am, Ian Kelly wrote: You're making the same mistake that Steven did in misunderstanding the threat model. I don't think I'm misunderstanding the threat, I think I'm pointing out a threat which the OP is hoping to just

Re: Pure Python Data Mangling or Encrypting

2015-06-26 Thread Randall Smith
On 06/26/2015 05:42 PM, Johannes Bauer wrote: On 26.06.2015 23:29, Jon Ribbens wrote: While you seem to think that Steven is rampaging about nothing, he does have a fair point: You consistently were vague about wheter you want to have encryption, authentication or obfuscation of data. This

Re: Pure Python Data Mangling or Encrypting

2015-06-26 Thread Randall Smith
On 06/26/2015 04:55 PM, Mark Lawrence wrote: To be perfectly blunt I gave up days ago trying to follow what was being said, just too many words from all angles and too few diagrams for me to follow. I sincerely hope it doesn't end in tears. Mark. There's not much to follow. The solution

Re: Pure Python Data Mangling or Encrypting

2015-06-26 Thread Randall Smith
On 06/26/2015 04:07 PM, Johannes Bauer wrote: You consistently were vague about wheter you want to have encryption, authentication or obfuscation of data. I knew (possibly extra) encryption wasn't necessary at this stage, but I also knew that encryption would provide good obfuscation.

Re: Pure Python Data Mangling or Encrypting

2015-06-25 Thread Randall Smith
On 06/24/2015 08:33 PM, Dennis Lee Bieber wrote: On Wed, 24 Jun 2015 13:20:07 -0500, Randall Smith rand...@tnr.cc declaimed the following: On 06/24/2015 06:36 AM, Steven D'Aprano wrote: I don't understand how mangling the data is supposed to protect the recipient. Don't they have the ability

Re: Pure Python Data Mangling or Encrypting

2015-06-25 Thread Randall Smith
On 06/24/2015 11:27 PM, Devin Jeanpierre wrote: On Wed, Jun 24, 2015 at 9:07 PM, Steven D'Aprano st...@pearwood.info 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

Re: Pure Python Data Mangling or Encrypting

2015-06-25 Thread Randall Smith
Thanks Jon. I couldn't have answered those questions better myself, and I wrote the software in question. I didn't intend to describe the entire system, but rather just enough of it to present the issue at hand. You seem to understand it quite well. I'm now using a randomly generated 256

Pure Python Data Mangling or Encrypting

2015-06-24 Thread Randall Smith
Chunks of data (about 2MB) are to be stored on machines using a peer-to-peer protocol. The recipient of these chunks can't assume that the payload is benign. While the data senders are supposed to encrypt data, that's not guaranteed, and I'd like to protect the recipient against exposure to

Re: Pure Python Data Mangling or Encrypting

2015-06-24 Thread Randall Smith
On 06/24/2015 04:24 PM, Grant Edwards wrote: OK. But if the recipient (the server) mangles the data and then never unmangles or reads the data, there doesn't seem to be any point in storing it. I must be misunderstanding your statement that the data is never read/unmangled. When the

Re: Pure Python Data Mangling or Encrypting

2015-06-24 Thread Randall Smith
On 06/24/2015 06:36 AM, Steven D'Aprano wrote: I don't understand how mangling the data is supposed to protect the recipient. Don't they have the ability unmangle the data, and thus expose themselves to whatever nasties are in the files? They never look at the data and wouldn't care to

Re: Pure Python Data Mangling or Encrypting

2015-06-24 Thread Randall Smith
On 06/24/2015 02:44 AM, Devin Jeanpierre wrote: How about a random substitution cipher? This will be ultra-weak, but fast (using bytes.translate/bytes.maketrans) and seems to be the kind of thing you're asking for. -- Devin I tried this out and it seems to be just what I need. Thanks Devin!

Re: Pure Python Data Mangling or Encrypting

2015-06-24 Thread Randall Smith
On 06/24/2015 07:19 AM, Dennis Lee Bieber wrote: Pardon, but that description has me confused. Perhaps I just don't understand the full use-case. Who exactly is supposed to be protected from what? You state data senders are supposed to encrypt which, if the recipient doesn't

Re: Pure Python Data Mangling or Encrypting

2015-06-24 Thread Randall Smith
On 06/24/2015 01:29 PM, Grant Edwards wrote: On 2015-06-24, Randall Smith rand...@tnr.cc wrote: On 06/24/2015 06:36 AM, Steven D'Aprano wrote: I don't understand how mangling the data is supposed to protect the recipient. Don't they have the ability unmangle the data, and thus expose

Re: moving Connection/PipeConnection between processes

2009-06-15 Thread Randall Smith
Now that I've done some homework, everything you said is clear. Mike Kazantsev wrote: Pickle has nothing to do with the problem since it lay much deeper: in the OS. From kernel point of view, every process has it's own descriptor table and the integer id of the descriptor is all the process

moving Connection/PipeConnection between processes

2009-06-13 Thread Randall Smith
I've got a situation in which I'd like to hand one end of a pipe to another process. First, in case you ask why, a spawner process is created early before many modules are imported. That spawner process is responsible for creating new processes and giving a proxy to the parent process.

Re: moving Connection/PipeConnection between processes

2009-06-13 Thread Randall Smith
Mike Kazantsev wrote: On Sat, 13 Jun 2009 02:23:37 -0500 Randall Smith rand...@tnr.cc wrote: I've got a situation in which I'd like to hand one end of a pipe to another process. First, in case you ask why, a spawner process is created early before many modules are imported. That spawner

Re: multiprocessing / forking memory usage

2009-05-27 Thread Randall Smith
Thanks Piet. You gave a good explanation and I think I understand much better now. Piet van Oostrum wrote: Randall Smith rand...@tnr.cc (RS) wrote: RS I'm trying to get a grasp on how memory usage is affected when forking as RS the multiprocessing module does. I've got a program

multiprocessing / forking memory usage

2009-05-26 Thread Randall Smith
I'm trying to get a grasp on how memory usage is affected when forking as the multiprocessing module does. I've got a program with a parent process using wx and other memory intensive modules. It spawns child processes (by forking) that should be very lean (no wx required, etc). Based on

bundling python with application

2008-07-26 Thread Randall Smith
I'd like to bundle Python with my app, which will be targeted at Linux, Windows and Mac. Discussions I've found about this tend to lead to py2exe, freeze, etc, but I'd like to do something rather simple and am seeking advice. What I'd like to do is just copy the standard libraries and

Re: Name of type of object

2005-02-08 Thread Randall Smith
Jive Dadson wrote: The traceback routine prints out stuff like, NameError: global name 'foo' is not defined NameError is a standard exception type. What if I want to print out something like that? I've determined that global name 'foo' is not defined comes from the __str__ member of the