bodgit/sevenzip

Unable to decrypt 7-ZIP file with password (err: breader.ReadByte: no data!)

zollty opened this issue · 1 comments

What version of the package or command are you using?

master (4e0de6e

What are you trying to do?

Decompress 7-ZIP file with password

What steps did you take?

func TestOpenReaderWithPassword(t *testing.T) {
	t.Parallel()

	tables := []struct {
		name, file, password string
	}{
		{
			name:     "xxxx header compression",
			file:     "7zcracker.7z",
			password: "876",
		},
	}
....

see: reader_test.go
the file url: download
the file is created by "7z2201-x64.exe" (from www.7-zip.org) with default options.

What did you expect to happen, and what actually happened instead?

Err: breader.ReadByte: no data !

Running tool: D:\__SYNC1\Softwares\Go\bin\go.exe test -timeout 30s -run ^TestOpenReaderWithPassword$ github.com/bodgit/sevenzip

--- FAIL: TestOpenReaderWithPassword (0.00s)
    --- FAIL: TestOpenReaderWithPassword/xxxx_header_compression (1.59s)
        d:\__SYNC2\go-path\src\zollty.com\test\sevenzip\reader_test.go:183: breader.ReadByte: no data
FAIL
FAIL	github.com/bodgit/sevenzip	3.581s
FAIL

After my testing:

All 7-zip encrypted files created by software 7-zip (official windows x64 version, default options) cannot be decrypted.

but files encrypted by another software Bandzip can be decrypted normally.

Closing as a duplicate of #75