- Oct 11, 2013
-
-
Karl Fogel authored
This doesn't get all the way to full bidirectional compatibility, but it's progress toward that goal. Run 'make check' to see what's next. * onetime: Add 2 vs 3 conditional block at top. (btos): New utility function, defined in above block. (Pad.convert, Pad._make_fuzz): Handle string vs int manually. (main): Use binary_stdout. Encode headers and footer before writing them. Use new btos() helper where necessary.
-
- Sep 28, 2013
-
-
Karl Fogel authored
* onetime (Configuration._parse_pad_records_file, Configuration.register): Ask if key is in dict in an way that works for Python 2 and 3.
-
Karl Fogel authored
* onetime: Remove the block that defined True and False if they weren't already defined. It's not necessary to support Pythons that old, and its try/except syntax is unidiomatic now anyway.
-
Karl Fogel authored
* onetime (__doc__): Remove newline at the end. (Configuration.show_pad_records, main): Update print() calls.
-
Karl Fogel authored
-
- Sep 27, 2013
-
-
Karl Fogel authored
Along the way, fix some conditionals that would behave correctly when succeeding but report a syntax error when unexpectedly failing. What happened was that 'grep -n' would produce no output in the failure case, and that absence of output in the left half of a shell test would cause the '-ne' operator to be a syntax error when reached.
-
Karl Fogel authored
This fixes a bug introduced in commit 52e24e55 that would result in re-use of pad data. This also makes some regression tests start failing, because the used lengths they're expecting are now different; I will fix the tests in a subsequent commit. * onetime (Pad._make_fuzz): Adjust pad used length. I mean, duh.
-
Karl Fogel authored
(Pad._make_fuzz): Explain why we read 4 bytes. (PadEncoder.encode): Remove old comment.
-
Karl Fogel authored
Should have been doing this all along, as Python's default I/O mode is text mode. It won't make any difference in most cases, perhaps all, but binary mode is certainly correct if we're being careful. * onetime (Pad.__init__): Read the pad in binary mode. (Configuration.save): Add comment explaining why not binary mode. (main): Open input and output in binary mode.
-
Karl Fogel authored
* onetime (Pad.__init__): New self._begun flag variable. (Pad.convert): Take new format_version argument. Set the self._begun flag. (Pad.read): Remove; self._make_fuzz will handle this now. (Pad._make_fuzz): New function. (PadEncoder.__init__, PadDecoder.__init__): Remove self._used flag. (PadEncoder.encode): Remove fuzz code, as Pad handles this now. (PadDecoder.decode): Same, but pass format_version where needed.
-
- Sep 22, 2013
-
-
Karl Fogel authored
This isn't strictly about issue #2, but it happens to make testing the fixes for that issue much easier, since the in-progress fixes make so many tests fail and one wants to see the groupings more clearly. * check.sh (check_result): If fail, print an extra blank line afterwards. (everywhere): Add an extra blank line before error messages, so they're easier to parse visually and so they're more grouped with their associated final failure line.
-
- Sep 21, 2013
-
-
Karl Fogel authored
It's expected that this change would cause tests to fail that depend on exact offsets or lengths being recorded in the pad-records file. * onetime (PadEncoder.__init__): Rename self.used to self._used. (PadEncoder.encode, PadDecoder.decode): Grab noise bytes, but don't use them yet. * check.sh ("encode msg, where v1 pad entry has some range already used"): Make an error message more accurate.
-
Karl Fogel authored
-
Karl Fogel authored
* onetime (PadEncoder.encode): Don't record consumption in-loop, just record it once at the very end, so the reconsumption check is valid. * check.sh: Print explanation of output at start of run. ("encryption, decryption of large plaintext"): Remove XFAIL label. Also, run faster, by iterating only 5 times instead of 10. This makes the files half the size they used to be, but they're still easily large enough to stimulate the now-fixed bug.
-
Karl Fogel authored
Along the way, discover that there's a validation bug when encrypting very large files. This bug that was masked by the fact that Python's bzip2 compressor often doesn't produce any output until it flushes; as a result, Configuration._consolidate_used_ranges() never had a chance to wrongly claim incoherent range reconsumption when consolidating, which it would otherwise do, because PadEncoder.pad.convert() and especially PadEncoder.config.record_consumed() are only called once, in PadEncoder.finish(), not in PadEncoder.encode(), because the compressor never offers any output in the latter. So this commit is really about tidying up the code and writing a regression test, in preparation for fixing *that* bug, after which we'll return to fixing issue #2. * onetime (Pad.__doc__): Document that Pads are per-session. (Pad.offset): Fix tense in doc string. (Pad.PadUninitialized): New error class. (Pad.convert): Raise an error if offset hasn't been set yet. (Pad.read): New method. (PadEncoder.__init__): New self.used variable, initialized to False. (PadEncoder.encode): Only consume pad if there is compressed plaintext available. This doesn't fix the validation bug referred to above, but it highlights the circumstance that produces the bug and makes debugging easier. * check.sh ("encryption, decryption of large plaintext"): New xfail test.
-
Karl Fogel authored
* onetime (main): When encrypting, read in 8k chunks, instead of reading the whole file into memory. If someone has enough pad to encrypt their DVD collection, we should still perform acceptably.
-
- Sep 19, 2013
-
-
Karl Fogel authored
the warning not to re-use pad data for encryption, taking special care to avoid the confusing word "plaintext", which means a different thing in normal-speak than in crypto-speak anyway.
-
- Sep 10, 2013
-
-
Karl Fogel authored
-
- Sep 06, 2013
-
-
Karl Fogel authored
* index.html-top: Same. * onetime (__doc__, usage): Do it.
-
Karl Fogel authored
following up to commit 9b112d75.
-
Karl Fogel authored
-
Karl Fogel authored
* index.html-top: Refer to the new instructions below. * index.html-middle-top: New name for index.html-middle. * index.html-middle-bottom: New file. * Makefile (www): Adjust accordingly, splicing in the '--pad-help' output.
-
Karl Fogel authored
* onetime (usage): Document new '--pad-help' option, and move that help to... (pad_generation_help): ...this new function. Also, fix the example to use the correct number of bytes per block. (main): Handle new '--pad-help' option.
-
Karl Fogel authored
Add documentation on pad generation, from @jvasile.
-
James Vasile authored
-
- Jul 30, 2013
-
-
Karl Fogel authored
-
Karl Fogel authored
-
Karl Fogel authored
-
Karl Fogel authored
-
Karl Fogel authored
This doesn't change any behavior, it's just stricter coding practice. * onetime (Pad.__init__): Initialize self._offset to None instead of 0.
-
Karl Fogel authored
-
- Jul 29, 2013
-
-
Karl Fogel authored
-
Karl Fogel authored
* example.onetime: New file, destination of above.
-
Karl Fogel authored
-
- Jul 28, 2013
-
-
Karl Fogel authored
-
Karl Fogel authored
-
Karl Fogel authored
* check.sh ("option parsing"): Echo description of error in failure case, ("basic encryption, decryption"): Same, following up to commit 3143ab39. ("decode msg, erroring because garbage after base64 data"): Same, following up to commit af967549.
-
Karl Fogel authored
* onetime (PadDecoder.decode): Document when IOError is thrown. (main): Handle IOError when decrypting. * check.sh ("failed decryption should give an error and create no output"): New test. * TODO: Remove this item.
-
Karl Fogel authored
-
Karl Fogel authored
Also, make minor formatting and wording improvements to web pages. * onetime (__doc__): Recommend using pad pairs. * index.html-top: Same, and make some formatting improvements. * index.html-middle: Formatting improvements. * index.html-bottom: Wording improvements.
-