Pay attention to base64_decode in http://www.adp-gmbh.ch/cpp/common/base64.html
base64_decode
std::string base64_decode(std::string const& encoded_string)
I dont think one should use std::string for byte-data-storage. The method provide aren't design to deal with byte-data and you will risk yourself since any changes (or "optimization") on std::string will break your code.