MCPcopy Create free account
hub / github.com/VASTDynamics/Vaporizer2 / XOREncrypt

Method XOREncrypt

VASTvaporizer/Source/Plugin/VASTAudioProcessor.cpp:2180–2203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2178JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE("-Wconversion")
2179JUCE_BEGIN_IGNORE_WARNINGS_MSVC(4244 4267)
2180std::string VASTAudioProcessor::XOREncrypt(std::string a_sValue, std::string a_sKey)
2181{
2182 std::string sRet;
2183 sRet = a_sValue;
2184
2185 int idxVal = 0;
2186 int size_svalue = a_sValue.length();
2187 int idxKey = 0;
2188 int size_skey = a_sKey.length();
2189
2190 while (idxVal < size_svalue)
2191 {
2192 sRet[idxVal] = sRet.at(idxVal) ^ a_sKey.at(idxKey);
2193 idxVal++;
2194 idxKey++;
2195 if (idxKey >= size_skey)
2196 idxKey = 0;
2197 }
2198
2199 std::string hexRepr;
2200 convertToASCIIhex(hexRepr, sRet);
2201
2202 return hexRepr;
2203}
2204
2205std::string VASTAudioProcessor::XORDecrypt(std::string a_sValue, std::string a_sKey)
2206{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected