The MASM Forum

General => The Campus => Topic started by: noname on August 10, 2015, 06:07:42 PM

Title: Filesize after using Crypto APIs
Post by: noname 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?
Title: Re: Filesize after using Crypto APIs
Post by: hutch-- 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.
Title: Re: Filesize after using Crypto APIs
Post by: K_F on August 10, 2015, 06:58:38 PM
Most likely redundant information after decryption.. I'd think  8)