Home >System Tutorial >LINUX >Centos7 detailed analysis of the installation of Chacha20 encryption algorithm

Centos7 detailed analysis of the installation of Chacha20 encryption algorithm

王林
王林forward
2024-01-10 22:02:061162browse

Some programs will use the Chacha20 encryption algorithm. If the Centos7 system reports an error Exception: libsodium not found, it is caused by the lack of M2Crypto and libsodium dependency environments;

Salsa20 is a stream cipher algorithm submitted to eSTREAM by Daniel J. Bernstein. It is built on top of pseudo-random functions based on add-rotate-xor (ARX) operations - 32-bit modular addition, exclusive OR (XOR) and circular shift operations. Salsa20 maps a 256-bit key, a 64-bit nonce, and a 64-bit stream position to a 512-bit output (a 128-bit key version also exists). This gives Salsa20 the unusual advantage that the user can seek anywhere in the output stream in constant time. It can deliver speeds of about one byte per 4–14 cycle cycles in modern x86 processors, with reasonable hardware performance. It is not patented, and Bernstein has written several public domain implementations of common architectural optimizations. Salsa20 has been submitted to eSTREAM.
A related cryptographic algorithm ChaCha, with similar characteristics but a different circular shift function, was published by Bernstein in 2008.

Introduction to M2Crypto and Libsodium

M2Crypto: A Python encryption and SSL toolkit

M2Crypto is the most complete Python wrapper for OpenSSL features RSA, DSA, DH, EC, HMAC, message digests, symmetric ciphers (including AES). SSL functionality implemented client and server; Python extensions to Python's httplib, urllib and xmlrpclib; Unforgeable HMAC'AuthCookie for network session management; FTP/TLS client and server; S/MIME; ZServerSSL: HTTPS server for Zope and ZSmime : Zope's S/MIME messenger. M2Crypto can also be used to provide SSL to Twisted. Smart cards are supported through the engine interface.

Libsodium

is used for encryption, decryption, signing, password hashing, and its goal is to provide all core operations needed to build higher-level encryption tools. Despite the emphasis on high security, the primitive is faster than most implementations of the NIST standard.

If your centos7 system needs to support the Chacha20 encryption algorithm, please use the following command to install it

yum install m2crypto gcc -y
wget -N --no-check-certificate https://download.libsodium.org/libsodium/releases/libsodium-1.0.8.tar.gz
tar zfvx libsodium-1.0.8.tar.gz
cd libsodium-1.0.8
./configure
make && make install
echo "include ld.so.conf.d/*.conf" > /etc/ld.so.conf
echo "/lib" >> /etc/ld.so.conf
echo "/usr/lib64" >> /etc/ld.so.conf
echo "/usr/local/lib" >> /etc/ld.so.conf
ldconfig

The above is the detailed content of Centos7 detailed analysis of the installation of Chacha20 encryption algorithm. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:jb51.net. If there is any infringement, please contact admin@php.cn delete