Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #93256 > unrolled thread
| Started by | Randall Smith <randall@tnr.cc> |
|---|---|
| First post | 2015-06-27 13:17 -0500 |
| Last post | 2015-06-27 13:17 -0500 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Pure Python Data Mangling or Encrypting Randall Smith <randall@tnr.cc> - 2015-06-27 13:17 -0500
| From | Randall Smith <randall@tnr.cc> |
|---|---|
| Date | 2015-06-27 13:17 -0500 |
| Subject | Re: Pure Python Data Mangling or Encrypting |
| Message-ID | <mailman.142.1435429051.3674.python-list@python.org> |
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 unmangle(source, dest): > source.read(BLOCKSIZE) > shutil.copyfileobj(source, dest) > > Disclaimer: I did not follow the ongoing discussion. > That is happening as a side effect. Though not completely random, after running the data through a translation table, the 256 byte table is prepended. Then a 4 byte checksum is calculated and prepended. -Randall
Back to top | Article view | comp.lang.python
csiph-web