Home > System Tutorial > LINUX > body text

Centos7 detailed analysis of the installation of Chacha20 encryption algorithm

王林
Release: 2024-01-10 22:02:06
forward
1079 people have browsed it

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
Copy after login

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!

source:jb51.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!