ajgb / crypt-nacl-sodium

Crypt::NaCl::Sodium - NaCl compatible modern, easy-to-use library for encryption, decryption, signatures, password hashing and more
https://metacpan.org/release/Crypt-NaCl-Sodium
9 stars 10 forks source link

Compatibility issue when installing Crypt::NaCl::Sodium on Debian server #12

Open SebastianStorb opened 9 months ago

SebastianStorb commented 9 months ago

Compatibility issue when installing Crypt::NaCl::Sodium on Debian server

Description: I'm trying to install the Perl module Crypt::NaCl::Sodium on my Debian server, but I'm running into compatibility issues with the libsodium library. The installation fails with several error messages indicating missing functions and constants in libsodium.

Installation attempt:

Command used: sudo cpanm Crypt::NaCl::Sodium Error message: The most important errors relate to undefined identifiers such as crypto_stream_aes128ctr_NONCEBYTES, crypto_stream_aes128ctr_KEYBYTES and crypto_stream_aes128ctr. System details:

Operating system: Debian 12 (latest version)

uname -mi x86_64 unknown

Perl version: 5.036000 libsodium version: 1.0.19 Steps already taken:

Attempting to install via CPANminus. Checking and uninstalling the current libsodium version. Try to find and install an older version of libsodium that contains the required features. Main problem: The main problem seems to be that the required features (crypto_streamaes128ctr*) are not present in the current version of libsodium (1.0.19) and I'm having difficulty finding an older version of libsodium that includes these features.

Solution sought: I'm looking for a way to either find and install a compatible version of libsodium or an alternative solution to successfully install Crypt::NaCl::Sodium on my Debian server.

I have tried the following without success: sudo apt-get remove --purge libsodium-dev wget http://archive.debian.org/debian/pool/main/libs/libsodium/libsodium18_1.0.11-2_amd64.deb sudo dpkg -i libsodium18_1.0.11-2_amd64.deb sudo cpanm Crypt::NaCl::Sodium

The solution mentioned in the forum and wiki doesn't work for me:

`cpan Crypt::NaCl::Sodium --force ... make: *** [Makefile:367: Sodium.o] Fehler 1 AJGB/Crypt-NaCl-Sodium-1.0.8.0.tar.gz /usr/bin/make -- NOT OK

(error): Could not expand [--force]. Check the module name. (info): I can suggest names if you install one of Text::Levenshtein::XS, Text:: Levenshtein::Damerau::XS, Text::Levenshtein, and Text::Levenshtein::Damerau::PP (info): and you provide the -x option on invocation. (error): Skipping --force because I couldn't find a matching namespace.`

mo22 commented 9 months ago

Can be solved by installing an older version of libsodium:

apt-get install git build-essential automake autoconf
git clone https://github.com/jedisct1/libsodium.git
cd libsodium
git checkout 1.0.13
./autogen.sh
./configure --with-pic
make
sudo make install

and then running sudo cpan -f Crypt::NaCl::Sodium again.