2013-07-07 122 views
-1

我已經從這個site下載的代碼,編譯它,現在想測試它,我有幾個問題的測試...用C AES算法的實現

我從編譯生成兩個文件encrypt和從sitedecrypt和指令是:

加密程序被稱爲如下:

encrypt password cryptofile

它加密標準輸入(與填充空格它,如果需要的話),並將結果寫入到指定的cryptofile。

解密程序被稱爲如下:

decrypt password cryptofile

它解密cryptofile內容並將結果發送(填充空格,如果必要的話),以標準輸出。

我沒有得到這個程序工作的正確方法。我已經試過這些:

./encrypt to_be_encrypted_file password_file encrypted_file
./encrypt to_be_encrypted_string password_string encrypted_file

但是,所有我得到的是提示等待什麼而在加密文件的任何變化

回答

2

這樣稱呼它:

./encrypt password_string encrypted_file < to_be_encrypted_file 

說明文件說明它加密標準輸入

併爲decrypt

./decrypt password_string encrypted_file > decrypted_file 

,因爲它說的結果是發送到標準輸出

+0

謝謝,我絕對需要提高對C&UNIX世界的認識 – diegoaguilar