Ejemplo n.º 1
0
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 "";
	}
}
Ejemplo n.º 2
0
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 "";
    }
}
Ejemplo n.º 3
0
std::string AdvancedCrypt(std::string boinchash)
{

	try 
	{
	   std::vector<unsigned char> vchSecret( boinchash.begin(), boinchash.end() );
	   std::string d1 = "                                                                                                                                        ";
	   std::vector<unsigned char> vchCryptedSecret(d1.begin(),d1.end());
       bool OK = GridEncrypt(vchSecret, vchCryptedSecret);
	   std::string encrypted = UnsignedVectorToString(vchCryptedSecret);
	   return encrypted;
	} catch (std::exception &e) 
	{
		printf("Error while encrypting %s",boinchash.c_str());
		return "";
	}
	catch(...)
	{
		printf("Error while encrypting 2.");
		return "";
	}
              
}