Jump to content

Search the Community

Showing results for tags 'cryptencrypt'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • Forum FAQ
  • AutoIt

Calendars

  • Community Calendar

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 1 result

  1. Hello All, I have the following issue with using the _Crypt_EncryptData autoit function which I understand is merely a wrapper around the advapi dll's CryptEncrypt function. Part of the functionality of my script is to read a file in chunks(I cannot avoid that) encrypt the data and write it into a separate file on the disk. To read and write I use the _WinAPI_ReadFile and _WinAPI_WriteFile function. The buffer size usually is 1MB. Sometimes it's smaller, but never more than that. In order to verify the integrity of the resulting file I decrypt it with the sample script in the help for the _Crypt_DecryptFile function. I'm using a hex editor to compare the source and target files. For the most part they are the same, but It looks like there are discrepancies always with a size of 16 bytes in the files. For example: the original will be F0 FF FF FF 48 2F 0F 00 C0 2F 0F 00 00 00 00 00 68 62 69 6E 00 10 0F 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 the decrypted will be F0 FF FF FF 48 2F 0F 00 C0 2F 0F 00 00 00 00 00 2C 34 F4 B2 D7 2C 9C 62 DF 54 3C 50 63 04 52 79 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 The code I'm using is below. What am I doing wrong? Please help. I think I've tried almost everything and I still can't figure out what is causing this.I've read that the CryptEncrypt win32 api function is not thread safe, but my script isn't multithreaded. Is it possible that it's feeding in the write buffer with data taken from somewhere else _WinAPI_ReadFile($hFile, DllStructGetPtr($readbuffer), DllStructGetSize($readbuffer), $nBytes) if $final Then $varEncrypted = _Crypt_EncryptData(DllStructGetData($readbuffer, 1), "pass", $CALG_AES_128, True) $writebuffer = DllStructCreate("byte["& BinaryLen($varEncrypted) &"]") DllStructSetData($writebuffer, 1, $varEncrypted) _WinAPI_WriteFile($targetFile, DllStructGetPtr($writebuffer), DllStructGetSize($writebuffer), $nBytes) else $varEncrypted = _Crypt_EncryptData(DllStructGetData($readbuffer, 1), "pass", $CALG_AES_128, False) $writebuffer = DllStructCreate("byte["& BinaryLen($varEncrypted) &"]") DllStructSetData(writebuffer, 1, $varEncrypted) _WinAPI_WriteFile($targetFile, DllStructGetPtr($writebuffer), DllStructGetSize($writebuffer), $nBytes) endif
×
×
  • Create New...