Constant time hex and base64 encode and decode
Switch branches/tags
Nothing to show
Clone or download
Sc00bz Logic fail
If testBase64() fails then testHex() won't run.
Latest commit 3c11bb8 Oct 8, 2014
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
php Create test.php Oct 8, 2014
LICENSE
README.md Update README.md Oct 8, 2014
base64.cpp
base64.h
hex.cpp
hex.h
main.cpp Logic fail Oct 8, 2014

README.md

Constant Time Encoding

Constant time hex and base64, encode and decode.

Base64 encoding with these character sets:

  • "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" base64Encode() and base64Decode()
  • "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" base64EncodeDotSlash() and base64DecodeDotSlash()
  • "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" base64EncodeDotSlashOrdered() and base64DecodeDotSlashOrdered()

Semi-tested

It looks correct there are some tests but there might be bugs.

PHP

I'm pretty sure there are problems with PHP and multi-byte character strings. I think it's something screwy with strlen() and maybe ord() and chr(). So you should probably not use this yet.