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

paragonie/constant_time_encoding v2.6.3

Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)
Package summary
Share
0
issues
1
license
1
MIT
Package created
12 Mar 2016
Version published
14 Jun 2022
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

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/constant_time_encoding@v2.6.3
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

0
All Dependencies CSV
β“˜ This is a list of paragonie/constant_time_encoding 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does paragonie/constant_time_encoding do?

The paragonie/constant_time_encoding package provides constant-time implementations for RFC 4648 encoding, which includes Base-64, Base-32, and Base-16. The primary goal is to offer character encoding functions that do not reveal any information about what you are encoding/decoding via processor cache misses, thereby mitigating cache-timing attacks. It's robust against vulnerabilities such as mbstring.func_overload and includes enhancements such as Base16 encoding, Base32 encoding, and the use of pack() and unpack() instead of chr() and ord(). This offers a safer route for character encoding and decoding in your PHP applications, particularly where security is paramount.

How do you use paragonie/constant_time_encoding?

To use the paragonie/constant_time_encoding package, you will first need to install it using composer:

composer require paragonie/constant_time_encoding

Then you can use the package in your code using the following example:

use ParagonIE\ConstantTime\Encoding;

$data = random_bytes(32);
echo Encoding::base64Encode($data), "\n";
echo Encoding::base32EncodeUpper($data), "\n";
echo Encoding::base32Encode($data), "\n";
echo Encoding::hexEncode($data), "\n";
echo Encoding::hexEncodeUpper($data), "\n";

If you need a particular encoding variant, you can directly refer to the required class like so:

use ParagonIE\ConstantTime\Base64;
use ParagonIE\ConstantTime\Base32;

$data = random_bytes(32);
echo Base64::encode($data), "\n";
echo Base32::encode($data), "\n";

Where are the paragonie/constant_time_encoding docs?

The paragonie/constant_time_encoding documentation can be found in the README file in the project's GitHub repository.