Modify

Opened 16 years ago

Closed 16 years ago

Last modified 14 years ago

#1608 closed Bug (Fixed)

Encrypting a file about 10 MB destroys the file - crypt.au3 bug ?

Reported by: brainwilli@… Owned by: J-Paul Mesnage
Milestone: 3.3.7.0 Component: Standard UDFs
Version: 3.3.6.0 Severity: None
Keywords: large file encryption crypt.au3 Cc:

Description

Tested with Version 3.3.6.1

Encrypting a file over a size limit of ca. 10 MB destroys the file.
All algorithm, only RC4 is working
Try the AutoIt Example Script "_Crypt_DecryptFile" .
Tested on XP 32Bit and Win7 64Bit

Attachments (0)

Change History (4)

comment:1 by mmatis@…, 16 years ago

Having this issue too. Here's more detail. I'm not sure if this is a problem in Crypt.au3, a limitation of Windows' implementation of AES, or a lack of knowledge on my part, but is appears that either _Crypt_EncryptFile or _Crypt_DecryptFile mangles .zip files that are over ~1MB. In the script below, if test.zip is more than a few megabytes, the resulting dec_test.zip will be unreadable. Zip programs can see files in the .zip, but will not be able to extract the data due to corruption. This doesn't seem to happen to other large files, but I've managed to corrupt other archive types, like .7z as well as installer executables, and .msi files.

This seems to happen with the AES family of algorithms. RC4 works fine. I haven't tried others. Can anyone provide some insight as to what is happening?

I'm currently on 3.3.4.0

#Include <Crypt.au3>
$file2encrypt="test.zip"
$encryptedfile="test.zip.enc"
$decryptedfile="dec_test.zip"
$key="12345"
_Crypt_EncryptFile($file2encrypt , $encryptedfile, $key, $CALG_AES_256)
_Crypt_DecryptFile($encryptedfile , $decryptedfile, $key, $CALG_AES_256)

comment:2 by anonymous, 16 years ago

I Have tested this with a 10MB PDF File. The decryptet file was broken, too.
Then I used a Hex Editor (tiny hexer) to compare both files. The difference starts exactly at Byte 1048576 (Offset: 0x10000).

Same Thing with a 37,0MB .rar file.
(Because of "$bTempData = FileRead($hInFile, 1024 * 1024)" the error must occur in the second run in the inner loop of _Crypt_DecryptFile or _Crypt_EncryptFile)

A 14,2MB .mp3 worked fine.

comment:3 by J-Paul Mesnage, 16 years ago

Milestone: 3.3.7.0
Owner: changed from Gary to J-Paul Mesnage
Resolution: Fixed
Status: newclosed

Fixed by revision [5839] in version: 3.3.7.0

comment:4 by arcadiagiulio@…, 14 years ago

I'm having the same issue on v3.3.8.1. For some kind of files, crypting with AES256 and decrypting deletes the entire content leaving just 4 NUL characters.

Modify Ticket

Action
as closed The owner will remain J-Paul Mesnage.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.