All Projects → paragonie → Constant_time_encoding

paragonie / Constant_time_encoding

Licence: other
Constant-Time Character Encoding in PHP Projects

Projects that are alternatives of or similar to Constant time encoding

Decodify
Detect and decode encoded strings, recursively.
Stars: ✭ 670 (+66.25%)
Mutual labels:  encoding, base64
universal-base64
Small universal base64 functions for node.js and browsers
Stars: ✭ 25 (-93.8%)
Mutual labels:  encoding, base64
multibase
multi base encoding/decoding utility
Stars: ✭ 15 (-96.28%)
Mutual labels:  encoding, base64
BaseNcoding
Library for encoding of binary data into strings using base32, base85, base128 and other algorithms.
Stars: ✭ 42 (-89.58%)
Mutual labels:  encoding, base64
BeFoR64
BeFoR64, Base64 encoding/decoding library for FoRtran poor men
Stars: ✭ 17 (-95.78%)
Mutual labels:  encoding, base64
scure-base
Secure, audited & 0-deps implementation of bech32, base64, base32, base16 & base58
Stars: ✭ 27 (-93.3%)
Mutual labels:  encoding, base64
ffmpeg-commander
🛠️ FFmpeg Command Generator Web UI
Stars: ✭ 136 (-66.25%)
Mutual labels:  encoding
Owasp Java Encoder
The OWASP Java Encoder is a Java 1.5+ simple-to-use drop-in high-performance encoder class with no dependencies and little baggage. This project will help Java web developers defend against Cross Site Scripting!
Stars: ✭ 343 (-14.89%)
Mutual labels:  encoding
Dockerfiles
Optimized media, analytics and graphics software stack images. Use the dockerfile(s) in your project or as a recipe book for bare metal installation.
Stars: ✭ 98 (-75.68%)
Mutual labels:  encoding
dart crypto
[Flutter] 本项目基于flutter_macos_v0.5.8-dev版本采用Dart语言开发。`DYFCryptoProvider`集成了Base64, 32/16 Bits MD5, AES, RSA等算法。(This Flutter project is developed in Dart language based on flutter_macos_v0.5.8-dev. `DYFCryptoProvider` integrates Base64, 32/16 Bits MD5, AES and RSA algorithms.)
Stars: ✭ 30 (-92.56%)
Mutual labels:  base64
Csv
CSV Decoding and Encoding for Elixir
Stars: ✭ 398 (-1.24%)
Mutual labels:  encoding
Psl
PHP Standard Library - a modern, consistent, centralized, well-typed set of APIs for PHP programmers.
Stars: ✭ 329 (-18.36%)
Mutual labels:  encoding
Python Iocextract
Defanged Indicator of Compromise (IOC) Extractor.
Stars: ✭ 300 (-25.56%)
Mutual labels:  base64
Watson
WATSON: Wasted but Amazing Turing-incomplete Stack-based Object Notation
Stars: ✭ 258 (-35.98%)
Mutual labels:  encoding
Chrome Charset
An extension used to modify the page default encoding for Chromium 55+ based browsers.
Stars: ✭ 346 (-14.14%)
Mutual labels:  encoding
basex
Arbitrary base encoding in GO
Stars: ✭ 39 (-90.32%)
Mutual labels:  encoding
Gulp Tutorial
Code examples for my Gulp.js tutorial series
Stars: ✭ 383 (-4.96%)
Mutual labels:  base64
lzbase62
LZ77(LZSS) based compression algorithm in base62 for JavaScript.
Stars: ✭ 38 (-90.57%)
Mutual labels:  base64
Serpent
A protocol to serialize Swift structs and classes for encoding and decoding.
Stars: ✭ 281 (-30.27%)
Mutual labels:  encoding
Libmorton
C++ header-only library with methods to efficiently encode/decode Morton codes in/from 2D/3D coordinates
Stars: ✭ 373 (-7.44%)
Mutual labels:  encoding

Constant-Time Encoding

Build Status Latest Stable Version Latest Unstable Version License Downloads

Based on the constant-time base64 implementation made by Steve "Sc00bz" Thomas, this library aims to offer character encoding functions that do not leak information about what you are encoding/decoding via processor cache misses. Further reading on cache-timing attacks.

Our fork offers the following enchancements:

  • mbstring.func_overload resistance
  • Unit tests
  • Composer- and Packagist-ready
  • Base16 encoding
  • Base32 encoding
  • Uses pack() and unpack() instead of chr() and ord()

PHP Version Requirements

Version 2 of this library should work on PHP 7 or newer. For PHP 5 support, see the v1.x branch.

If you are adding this as a dependency to a project intended to work on both PHP 5 and PHP 7, please set the required version to ^1|^2 instead of just ^1 or ^2.

How to Install

composer require paragonie/constant_time_encoding

How to Use

use \ParagonIE\ConstantTime\Encoding;

// possibly (if applicable): 
// require 'vendor/autoload.php';

$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";

Example output:

1VilPkeVqirlPifk5scbzcTTbMT2clp+Zkyv9VFFasE=
2VMKKPSHSWVCVZJ6E7SONRY3ZXCNG3GE6ZZFU7TGJSX7KUKFNLAQ====
2vmkkpshswvcvzj6e7sonry3zxcng3ge6zzfu7tgjsx7kukfnlaq====
d558a53e4795aa2ae53e27e4e6c71bcdc4d36cc4f6725a7e664caff551456ac1
D558A53E4795AA2AE53E27E4E6C71BDCC4D36CC4F6725A7E664CAFF551456AC1

If you only need a particular variant, you can just reference 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";

Example output:

1VilPkeVqirlPifk5scbzcTTbMT2clp+Zkyv9VFFasE=
2vmkkpshswvcvzj6e7sonry3zxcng3ge6zzfu7tgjsx7kukfnlaq====

Support Contracts

If your company uses this library in their products or services, you may be interested in purchasing a support contract from Paragon Initiative Enterprises.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].