Testing of AES algorithm implementation in C [closed]

烂漫一生 提交于 2019-12-25 18:28:04

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!