Giter Site home page Giter Site logo

PurePyZipAES / mZipAES test suite fails TestBaseEncryptedZipNoCompressionPurePyZipAES.test_get_what_you_put_in about puren_tonbo HOT 6 CLOSED

clach04 avatar clach04 commented on August 10, 2024
PurePyZipAES / mZipAES test suite fails TestBaseEncryptedZipNoCompressionPurePyZipAES.test_get_what_you_put_in

from puren_tonbo.

Comments (6)

clach04 avatar clach04 commented on August 10, 2024

Works fine with (slightly) larger aesop.txt file. Can decrypt file after it's encrypted. Get same (correct) CRC as:

  • pyzipper
  • 7z
  • WinRar

Can also decrypt those fine too.

from puren_tonbo.

clach04 avatar clach04 commented on August 10, 2024

Using 7z with the exact same data as used in the test, see same CRC as is put into file metadata, a55c1cb0.

7z a -mx0 -ppassword short_win_7z.aes256stored.zip encrypted.md

0xa55c1cb0 is see in the GUI. how ever in command line calc crc mode also see the "bad" crc:

(py310venv) C:\code\py\puren_tonbo>7z h puren_tonbo\tests\data\short_win_7z.aes256stored.zip

7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21

Scanning
1 file, 205 bytes (1 KiB)

CRC32             Size  Name
-------- -------------  ------------
044CA98D           205  puren_tonbo\tests\data\short_win_7z.aes256stored.zip
-------- -------------  ------------
044CA98D           205

Size: 205

CRC32  for data:              044CA98D

Everything is Ok

from puren_tonbo.

clach04 avatar clach04 commented on August 10, 2024

7z tests (its own) zip fine too:

(py310venv) C:\code\py\puren_tonbo>7z t -ppassword puren_tonbo\tests\data\short_win_7z.aes256stored.zip

7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21

Scanning the drive for archives:
1 file, 205 bytes (1 KiB)

Testing archive: puren_tonbo\tests\data\short_win_7z.aes256stored.zip
--
Path = puren_tonbo\tests\data\short_win_7z.aes256stored.zip
Type = zip
Physical Size = 205

Everything is Ok

Size:       35
Compressed: 205

from puren_tonbo.

clach04 avatar clach04 commented on August 10, 2024

Creating zip using ctcipher:

(py2764) C:\code\py\puren_tonbo>python -m puren_tonbo.tools.ptcipher -e -p password puren_tonbo\tests\data\encrypted.md -o puren_tonbo\tests\data\delete_me.aes256stored.zip
DEBUG tmp_out_filename 'C:\\code\\py\\puren_tonbo\\puren_tonbo\\tests\\data\\delete_me.aes256stored.zip20230211_162049pzt6iu'
about to write crc into zip meta 0xa55c1cb0

same crc seen in 7zip GUI with this file.

7z thinks the file is corrupted:

(py310venv) C:\code\py\puren_tonbo>7z h puren_tonbo\tests\data\delete_me.aes256stored.zip

7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21

Scanning
1 file, 207 bytes (1 KiB)

CRC32 Size Name


9D93B581 207 puren_tonbo\tests\data\delete_me.aes256stored.zip


9D93B581 207

Size: 207

CRC32 for data: 9D93B581

Everything is Ok

(py310venv) C:\code\py\puren_tonbo>7z t -ppassword puren_tonbo\tests\data\delete_me.aes256stored.zip

7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21

Scanning the drive for archives:
1 file, 207 bytes (1 KiB)

Testing archive: puren_tonbo\tests\data\delete_me.aes256stored.zip

Path = puren_tonbo\tests\data\delete_me.aes256stored.zip
Type = zip
Physical Size = 207

ERROR: CRC Failed in encrypted file. Wrong password? : encrypted.md

Sub items Errors: 1

Archives with Errors: 1

Sub items Errors: 1

also showing different CRC in console versus GUI.

At this stage looks like content of corrupted generation of stored (no compression) for pure Python AES.
Unclear why compat tests comparing with pyzipper work.

from puren_tonbo.

clach04 avatar clach04 commented on August 10, 2024

confirmed can read in pyzipper created stored fine:

python -m puren_tonbo.tools.ptcat -p password puren_tonbo\tests\data\pyzipper_delete_me.aes256stored.zip

from puren_tonbo.

clach04 avatar clach04 commented on August 10, 2024

Fixed in 7c12631

from puren_tonbo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.