Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 9, 2024 via composer
Package summary
Share
0
issues
2
licenses
1
MIT
1
ISC
Package created
29 Dec 2016
Version published
30 Apr 2023
Maintainers
1
Total deps
2
Direct deps
1
License
ISC

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
paragonie/random_compat@v9.99.100

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
paragonie/sodium_compat@v1.20.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of paragonie/sodium_compat 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
paragonie/random_compatv9.99.1005.93 kBMIT
prod

Visualizations

Frequently Asked Questions

What does paragonie/sodium_compat do?

Paragonie/sodium_compat is a cryptography library that is a pure PHP polyfill for the Sodium cryptography library also known as libsodium. This library is a core extension in PHP 7.2.0+ and is also available in PECL. If the PHP extension is installed, Sodium Compat will use the PHP extension instead of its own implementation. It supports PHP 5.2.4 - 8.x, although officially, it only supports non-EOL'd versions of PHP.

How do you use paragonie/sodium_compat?

To use the paragonie/sodium_compat library, you need to install it first. There are multiple methods of doing so. One of the easiest methods is by using Composer. Simply run composer require paragonie/sodium_compat in your terminal. After installation, include the autoload.php script in your project with require_once "/path/to/sodium_compat/autoload.php";. Here is an example of how to use the library in your code:

<?php
require_once "/path/to/sodium_compat/autoload.php";

$alice_kp = \Sodium\crypto_sign_keypair();
$alice_sk = \Sodium\crypto_sign_secretkey($alice_kp);
$alice_pk = \Sodium\crypto_sign_publickey($alice_kp);

$message = 'This is a test message.';
$signature = \Sodium\crypto_sign_detached($message, $alice_sk);
if (\Sodium\crypto_sign_verify_detached($signature, $message, $alice_pk)) {
    echo 'OK', PHP_EOL;
} else {
    throw new Exception('Invalid signature');
}

Where are the paragonie/sodium_compat docs?

For detailed documentation, refer to the official libsodium documentation which contains insightful technical information on how to use the library. Additionally, you can read the Libsodium Quick Reference, which aims to answer, "Which function should I use for [common problem]?".

You can find these materials at:

Remember, this library has not been formally audited by an independent third party that specializes in cryptography or cryptanalysis. However, it has been informally reviewed by many security experts and has been adopted by high profile open source projects, such as Joomla! and Magento.