Hello!

Help solve the problem. There is a program that implements the AEC algorithm, but there are some differences:

  1. the time that the program needs to decrypt is 2 times longer than that required to be encrypted;
  2. on different computers the result of the program is different, on one computer after the program is executed, the size of the source and decrypted files are the same, and on the other computer they differ by several bytes.

What could be the reason? After all, AES is a symmetric block cipher, which means that the time it takes to decrypt a file should coincide with the time it takes to encrypt a file or differ a little, but not 2 times as much. Why on one computer when decrypting information decoded into the decrypted file is equal to that in the source file, and on the other computer in the decrypted file, empty lines are added to the information that is written there, resulting in the size of the decrypted file does not match the size of the original file .

  • five
    1. AES, not AEC? 2. Obviously, this happens because the program is written incorrectly. To solve the problem, if possible, it is desirable to take a deliberately correct implementation, written and studied by specialist cryptographers. For example, OpenSSL. Because in its own implementation (if it is not educational, but intended for real work), you can make mistakes. Even if the data is encrypted correctly, there will always be attacks on third-party channels . If the task is educational - the code is in the studio, telepaths are on vacation. - drdaeman
  • one
    Empty lines can be added if there are different axes on different computers (windows and Unix in this case), in Windows the line break character consists of 2 characters and in Nix one of them. In general, I fully support @drdaeman - Raskilas
  • if I put the code you can find the reason why the time is different - Maverick
  • if the code is written in C, then rather for everything, you have crap with pointers. which leads to unpredictable program behavior - jmu
  • my code is written in CUDA C - Maverick

0