Author Topic: Filesize after using Crypto APIs  (Read 2413 times)

noname

  • Regular Member
  • *
  • Posts: 3
Filesize after using Crypto APIs
« on: August 10, 2015, 06:07:42 PM »
hello,

after you encrypt a file using CryptEncrypt with a block cipher key which has a block size of 8 bytes, filesize increases by 8 bytes. but when you decrypt the encypted file using CryptDecrypt, the filesize of the decrypted file is still bigger than the original file size by 8 bytes. how can i get the original file(=the original filesize) after decrypting?

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 10009
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Filesize after using Crypto APIs
« Reply #1 on: August 10, 2015, 06:32:42 PM »
Truncate it to its original size and if necessary, store that size somewhere in the file. Just check the documentation to see if there is a technique to get the unencrypted length.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

K_F

  • Member
  • *****
  • Posts: 1692
  • Anybody out there?
Re: Filesize after using Crypto APIs
« Reply #2 on: August 10, 2015, 06:58:38 PM »
Most likely redundant information after decryption.. I'd think  8)
'Sire, Sire!... the peasants are Revolting !!!'
'Yes, they are.. aren't they....'