This question has been asked and answered several times. I've looked at all the old answers and looked at the source code, but I am not able to get base32 to work with an alternative alphabet. I would like to use the RFC4648 alphabet rather than the DUDE alphabet.
The alt_base32 files that Jeffrey Walton placed on the Cryptopp wiki have been removed from this URLhttp://www.cryptopp.com/wiki/File:RFC4648
I'm able to narrow down the failure to decoding base32. Encoding works fine. Decoding fails with a stack overflow just like the report in 2010 here:
I'm able to narrow down the failure to decoding base32. Encoding works fine. Decoding fails with a stack overflow just like the report in 2010 here:Here's a very simple test program that demonstrates the base32 decoding error:Here's how I compile the test program:g++ -g -g3 -std=c++11 -Wall -Wextra -Werror \-Weffc++ -pedantic-errors base32_test.cpp \-o b32_test \/usr/lib/libcryptopp.so
The lookup array actually a parallel data structure, and it needs to be 256 elements in size. It provides indexes into your 32-character alphabet or -1 for 'invalid'. Most entries are marked as invalid. But this looks like a pointer problem....
I've got to finish up some work in the yard so I can let my dogs out. Give me an hour or two.
Here's output from valgrind:==22360== Stack overflow in thread 1: can't grow stack to 0x7fe801ff8==22360====22360== Process terminating with default action of signal 11 (SIGSEGV)==22360== Access not within mapped region at address 0x7FE801FF8==22360== at 0x50F35EE: CryptoPP::Base32Decoder::IsolatedInitialize(CryptoPP::NameValuePairs const&) (in /usr/lib/libcrypto++.so.9.0.0)
Here's output from valgrind:==22360== Stack overflow in thread 1: can't grow stack to 0x7fe801ff8==22360====22360== Process terminating with default action of signal 11 (SIGSEGV)==22360== Access not within mapped region at address 0x7FE801FF8==22360== at 0x50F35EE: CryptoPP::Base32Decoder::IsolatedInitialize(CryptoPP::NameValuePairs const&) (in /usr/lib/libcrypto++.so.9.0.0)