安装 libsodium 使用 salsa20 或 chacha20 或 chacha20-ietf 算法

谷歌发布了针对ARM优化的新算法,但是如果要使用 salsa20 或 chacha20 或 chacha20-ietf 算法,还是需要先安装 libsodium 。

CentOS下:

yum install epel-release -y
yum install libsodium -y

如果想自己编译,那么可以用以下的命令:

#CentOS

yum -y groupinstall "Development Tools"
wget https://github.com/jedisct1/libsodium/releases/download/1.0.12/libsodium-1.0.12.tar.gz
tar xf libsodium-1.0.12.tar.gz && cd libsodium-1.0.12
./configure && make -j2 && make install
echo /usr/local/lib > /etc/ld.so.conf.d/usr_local_lib.conf
ldconfig

#Ubuntu/Debian:

apt-get install build-essential -y
wget https://github.com/jedisct1/libsodium/releases/download/1.0.12/libsodium-1.0.12.tar.gz
tar xf libsodium-1.0.12.tar.gz && cd libsodium-1.0.12
./configure && make -j2 && make install
ldconfig

如果曾经安装过旧版本,亦可重复用以上步骤更新到最新版,仅1.0.4或以上版本支持chacha20-ietf。

假如我们遇到以下的错误时:

xxx: In function `crypto_derive_key':undefined reference to `crypto_pwhash'
xxx: In function `cipher_aead_decrypt':undefined reference to `crypto_aead_xchacha20poly1305_ietf_decrypt'
xxx: In function `cipher_aead_encrypt':undefined reference to `crypto_aead_xchacha20poly1305_ietf_encrypt'
collect2: error: ld returned 1 exit status
make[2]: *** [xxx] Error 1
make[2]: Leaving directory `xxx'
make[1]: *** [xxx] Error 1
make[1]: Leaving directory `xxx'
make: *** [all] Error 2

其实这原因有二:

1.系统存在旧libsodium的缘故,试试apt-get purge libsodium-dev再试试编译

2.尝试在编译时添加路径: ./configure --with-sodium=xxx

相关推荐:
软件的安装 Linux下软件的安装主要有两种不同的形式。第一种安装文件名为xxx.tar.gz;另一种安装文件名为xxx.i386.rpm。以第一种方式发行的软件多为以源码形式发送的;第二种方式则是直接以二进制形式发送 …
这是源码安装软件时配置环境用的,根据你的配置选项和你的系统情况生成makefile文件,为make 做准备。 最常用的参数就是: ./configure --prefix=xxx 若不指定prefix,则可执行文件默认放在/usr/local/bin …
在Linux系统上架设ASP.NET网站项目已经在圈子中流行,而“Mono+Jexus”架构模式是Linux承载ASP.NET企业级应用的极为重要的架构方式。 这种架构中,Jexus很好安装、配置,基本上就是一个下载、解压、复制的过 …
从cmake官网下载最新的cmake版本,官方地址: https://cmake.org/download/ 1、解压 tar -zxvf cmake-xxx.tar.gz 2、进入目录并配置源码 cd cmake-xxx ./configure 3、编译 make 4、安装 make install
SSH登录服务器时总是要停顿等待一下才能连接上,原因在于:OpenSSH服务器有一个DNS查找选项UseDNS默认是打开的。 在UseDNS选项打开状态下,当客户端试图登录OpenSSH服务器时,服务器端先根据客户端的IP地址 …
拿起手机扫一扫即可带走我!