问题
I've downloaded the code from this site, compiled it and now trying to test it I got a few problems...
I generated two files from compilation encrypt
and decrypt
and instructions from the site are:
The encryption program is called as follows:
encrypt password cryptofile
It encrypts the standard input (padding it with spaces, if necessary), and writes the result to the specified cryptofile.
The decryption program is called as follows:
decrypt password cryptofile
It decrypts the cryptofile contents and sends the result (padded with spaces, if necessary) to the standard output.
I'm not getting this programs working the right way... I've tried these:
./encrypt to_be_encrypted_file password_file encrypted_file
./encrypt to_be_encrypted_string password_string encrypted_file
But all I'm getting is the prompt waiting for anything and any change in the encrypted file
回答1:
Call it like this:
./encrypt password_string encrypted_file < to_be_encrypted_file
The documentation says It encrypts the standard input.
And for decrypt
:
./decrypt password_string encrypted_file > decrypted_file
because it says the result is send to the standard output.
来源:https://stackoverflow.com/questions/17516738/testing-of-aes-algorithm-implementation-in-c