diff --git a/README.txt b/README.txt index abe9011..aa95b5d 100644 --- a/README.txt +++ b/README.txt @@ -67,5 +67,5 @@ Refer to http://www.winzip.com/aes_info.htm#winzip11 for the reasoning. 16. Storage Format (file data payload) totals CompressedSize64 bytes: a. Salt - 8, 12, or 16 bytes depending on keysize b. Password Verification Value - 2 bytes - c. Encrypted Data - UncompressedSize64 bytes + c. Encrypted Data - compressed size - satl - pwv - auth lengths d. Authentication code - 10 bytes diff --git a/reader.go b/reader.go index 45f4023..ff7909b 100644 --- a/reader.go +++ b/reader.go @@ -218,7 +218,7 @@ func newDecryptionReader(r io.Reader, f *File) (io.Reader, error) { salt := content[:saltLen] pwvv := content[saltLen : saltLen+2] content = content[saltLen+2:] - size := f.UncompressedSize64 + size := f.CompressedSize64 - uint64(saltLen) - 2 - 10 data := content[:size] authcode := content[size:] // generate keys