std::string AdvancedDecrypt(std::string boinchash_encrypted) { try{ std::string d2 = " "; std::vector<unsigned char> vchCryptedSecret(boinchash_encrypted.begin(),boinchash_encrypted.end()); std::vector<unsigned char> vchPlaintext(d2.begin(),d2.end()); bool OKDecrypt = GridDecrypt(vchCryptedSecret,vchPlaintext); std::string decrypted = UnsignedVectorToString(vchPlaintext); return decrypted; } catch (std::exception &e) { printf("Error while decrypting %s",boinchash_encrypted.c_str()); return ""; } catch(...) { printf("Error while decrypting 2."); return ""; } }
std::string AdvancedDecrypt(std::string boinchash_encrypted) { try{ std::string pre_encrypted_boinchash = DecodeBase64(boinchash_encrypted); std::vector<unsigned char> vchCryptedSecret(pre_encrypted_boinchash.begin(),pre_encrypted_boinchash.end()); std::vector<unsigned char> vchPlaintext; GridDecrypt(vchCryptedSecret,vchPlaintext); std::string decrypted = UnsignedVectorToString(vchPlaintext); return decrypted; } catch (std::exception &e) { LogPrintf("Error while decrypting %s",boinchash_encrypted); return ""; } catch(...) { LogPrintf("Error while decrypting 2."); return ""; } }