Modify

Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#1608 closed Bug (Fixed)

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

Reported by: brainwilli@… Owned by: Jpm
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 Changed 9 years ago by mmatis@…

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 Changed 9 years ago by anonymous

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 Changed 9 years ago by Jpm

  • Milestone set to 3.3.7.0
  • Owner changed from Gary to Jpm
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed by revision [5839] in version: 3.3.7.0

comment:4 Changed 7 years ago by arcadiagiulio@…

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.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The owner will remain Jpm.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.