Simple encryption algorithm
Since you key is const it would be nice to mark it as such (and avoid accidents of changing your key):

void encodeStr(string const&amp; encryptKey, string&amp; inputToEncrypt) {
//                    ^^^^^


To save the cost of the copy I would also make it a reference.

No idea what these are:

assert(minVal &lt; maxVal);


The extra set of variables seems like a good idea but actually makes the code harder to read as you need to understand what the variable represents:

size_t countEnd = inputToEncrypt.length();
while (count &lt; countEnd) {

// Simpler to

while (count &lt; inputToEncrypt.length()) {


When is this condition every going to fail and give you 0?

keyCount = (count &lt; inputToEncrypt.length()) ? inputToEncrypt[count] : 0;


If it was going to fail then you should have the same precautions on this:

inputToEncrypt[count] = remainder;


This is also bound to result in truncation of reminder. As inputToEncrypt as a string and thus each position is a char while remainder is the sum of 2 integers both greater than minval.

inputToEncrypt[count] = remainder;