2017-2018-1 20145237 实验五 通讯协议设计
任务一
在Ubuntu中完成 http://www.cnblogs.com/rocedu/p/5087623.html 中的作业
提交运行结果截图
安装过程
Linux下的应用大多可以直接使用,也可以获取源代码自己进行编译、安装,使用源代码安装的过程一般是:
(1)configure
(2)make
(3)make install
OpenSSL的安装也是这样。首先解压源代码:
tar xzvf openssl-1.1.0-pre1.tar.gz
然后进入源代码目录:
cd openssl-1.1.0-pre1
然后使用下列命令编译安装:
./configure
make
sudo make install
你也可以使用make test
测试一下有没有问题。
Linux下OpenSSL的使用
OpenSSL应用程序
通过man openssl
查看帮助文档。
OpenSSL密码算法库
编写一个测试代码test_openssl.c:
#include <stdio.h>
#include <openssl/evp.h>
int main(){
OpenSSL_add_all_algorithms();
return 0;
}
然后用下面命令编译:
gcc -o to test_openssl.c -I /usr/local/ssl/inlcude /usr/local/ssl/lib -ldl -lpthread
执行./to;echo $?,结果打印0.
任务二
在Ubuntu中实现对实验二中的“wc服务器”通过混合密码系统进行防护
提交测试截图
任务三
运行实验箱中,ARM调用Z32算法的实验,提交实验截图
用Z32的国密算法重新改写“wc服务器”的混合密码系统防护,提交运行截图
未完成