libsodium-php | The PHP extension for libsodium | Cryptography library

 by   jedisct1 C Version: Current License: BSD-2-Clause

kandi X-RAY | libsodium-php Summary

kandi X-RAY | libsodium-php Summary

libsodium-php is a C library typically used in Security, Cryptography applications. libsodium-php has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

A simple, low-level PHP extension for [libsodium] Requires libsodium >= 1.0.9 and PHP 7.{0,1,2,3,4}.x or PHP 8.0.x. Full documentation here: [Using Libsodium in PHP Projects] a guide to using the libsodium PHP extension for modern, secure, and fast cryptography.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              libsodium-php has a low active ecosystem.
              It has 514 star(s) with 71 fork(s). There are 29 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 1 open issues and 139 have been closed. On average issues are closed in 46 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of libsodium-php is current.

            kandi-Quality Quality

              libsodium-php has 0 bugs and 0 code smells.

            kandi-Security Security

              libsodium-php has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              libsodium-php code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              libsodium-php is licensed under the BSD-2-Clause License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              libsodium-php releases are not available. You will need to build from source code and install.
              Installation instructions, examples and code snippets are available.
              It has 299 lines of code, 111 functions and 3 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of libsodium-php
            Get all kandi verified functions for this library.

            libsodium-php Key Features

            No Key Features are available at this moment for libsodium-php.

            libsodium-php Examples and Code Snippets

            No Code Snippets are available at this moment for libsodium-php.

            Community Discussions

            QUESTION

            libsodium "Call to undefined function" error
            Asked 2020-Jan-10 at 09:29

            I have installed libsodium and libsodium-php on ubuntu 16.04 but when I run:

            ...

            ANSWER

            Answered 2017-Jul-15 at 23:45

            The PHP API for libsodium has changed in version 2.0.0 of the extension.

            Originally, all functions were in a \Sodium\ namespace.

            However, following a vote by PHP developers regarding its inclusion in PHP 7.2, it was decided to move everything to the global namespace instead.

            So, what used to be \Sodium\library_version_major() is now sodium_library_version_major().

            Source https://stackoverflow.com/questions/45123295

            QUESTION

            How to use google-api-php-client on laravel 5.6 when there is no namespace
            Asked 2019-Feb-27 at 09:23

            Sorry if this is a repeat but the few close questions I have found have not worked for me. I am a Laravel newbie. I am trying to use the github library https://github.com/google/google-api-php-client with laravel 5.6 framework.

            I installed the api by running:

            composer require google/apiclient:^2.0

            My composer.json looks correct since it includes:

            ...

            ANSWER

            Answered 2018-Apr-03 at 22:10

            If a class is not in any namespace, you can reference from inside a namespace by prefixing it with a leading \, as in $foo = new \Google_Client;

            Meanwhile, the string you specify in a use statement isn't a "path" as such, it's just the "fully-qualified class name", that is, the class name with its namespace included on the front. So for a class in no namespace, it's just the name, use Google_Client;

            Source https://stackoverflow.com/questions/49639801

            QUESTION

            Can't decrypt encrypted file using libsodium
            Asked 2019-Feb-08 at 12:24

            I'm working on the encryption using libsodium my problem is the decryption part, its not going through and displaying error.

            Fatal error: Uncaught SodiumException: ops limit must be greater than 0 in C:\xampp\htdocs\encrypter\decrypt.php:18 Stack trace: #0 C:\xampp\htdocs\encrypter\decrypt.php(18): sodium_crypto_pwhash() #1 {main} thrown in C:\xampp\htdocs\encrypter\decrypt.php on line 18

            I tried to copy some lines in the encryption code but didn't work.

            I also receive warning.

            But I don't know if this is the cause. I also receive this on encryption.

            Warning: unpack(): 64-bit format codes are not available for 32-bit versions of PHP in C:\xampp\htdocs\encrypter\decrypt.php on line 11

            Warning: unpack(): 64-bit format codes are not available for 32-bit versions of PHP in C:\xampp\htdocs\encrypter\decrypt.php on line 12

            UPDATE

            • The warning is fixed by changing the pack() code from P to V.

            • Upon changing the code the $opslimit has a value more than 0.

            DECRYPTION CODE

            ...

            ANSWER

            Answered 2019-Feb-08 at 12:24

            The code was indeed not designed for 32 bit versions of PHP.

            If you change P to V, you need to:

            • Do it both in calls to unpack() and calls to pack()
            • Change the number of bytes read/written from 8 to 4.

            But the best thing to do would actually be trying to understand what the code does.

            It stores the memory limit and iterations at the beginning of the file, so that these parameters can be recovered later when reading the file, without having to hard-code them.

            pack() encodes a value in a fixed number of bytes. unpack() does the opposite. pack('P') encodes a 64 bit value into 8 bytes. unpack('P') reads 8 bytes and converts them into a value.

            If your environment doesn't support 64 bit values, pack/unpack to 4 bytes, but you then need to write 4 bytes, not 8. And read 4 bytes as well, not 8.

            Source https://stackoverflow.com/questions/54587528

            QUESTION

            PHP - Encryption security concern (Am I vulnerable?)
            Asked 2018-Mar-04 at 13:25

            I want to connect to ssh via PHP. I can do that easily but the problem is the integrity of the login details (username, password). When I first tried the code I stored my username and password in plain sight. I thought about encrypting those variables. By looking at other questions I found libsodium: https://github.com/jedisct1/libsodium-php

            I am using their first example of encrypting a string:

            ...

            ANSWER

            Answered 2018-Mar-04 at 13:25
            1. Nothing is totally bulletproof. Anyway, this is far from it. It's your implementation that lacks. First you encrypt it, but then you store the encrypted message along with the secret key in a database.

            2. This is all that's required to decrypt it. So any SQL injection flaws OR server/database breaches could compromise the encrypted messages and render it useless. Don't store the private key on the server; especially not with it's intended message. It's nothing more than expensive cleartext if you do that.

            3. Don't even store the database connection file in the web root. It's trivial for an hacker to grab that way, look up LFI. You can store it outside e.g. in /var/www/ and serve your index.php from /var/www/public/.

            As noted in the comments, it's a little odd what you're doing here anyway. You'd probably be much better off using SSH keys with a pass phrase.

            Source https://stackoverflow.com/questions/48371695

            QUESTION

            Library failure when installing Libsodium (Amazon EC2)
            Asked 2017-Oct-27 at 08:09

            I can't figure out how to get Libsodium up and running on my EC2 instance.

            When attempting to check if the installation was successful with:

            ...

            ANSWER

            Answered 2017-Oct-26 at 07:53

            Same on alpine and PHP 7.1... I am installing it via PECL.

            There is a bug report about it: https://github.com/jedisct1/libsodium-php/issues/156

            You can overcome this issue by forcing to use 2.0.8 until the issue gets fixed: pecl install -f libsodium-2.0.8

            Source https://stackoverflow.com/questions/46851047

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install libsodium-php

            libsodium (and, if you are using binary packages, on some distributions, libsodium-dev as well) has to be installed before this extension.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/jedisct1/libsodium-php.git

          • CLI

            gh repo clone jedisct1/libsodium-php

          • sshUrl

            git@github.com:jedisct1/libsodium-php.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Reuse Pre-built Kits with libsodium-php

            Consider Popular Cryptography Libraries

            dogecoin

            by dogecoin

            tink

            by google

            crypto-js

            by brix

            Ciphey

            by Ciphey

            libsodium

            by jedisct1

            Try Top Libraries by jedisct1

            libsodium

            by jedisct1C

            dsvpn

            by jedisct1C

            piknik

            by jedisct1Go

            minisign

            by jedisct1C

            libsodium.js

            by jedisct1HTML