$key = md5($this->rngInstance->getExtraSalt());
}
+ // Add some "garbage" to the string
+ $garbageString = md5($this->rngInstance->randomString(10))."|".base64_encode($str)."|".sha1($this->rngInstance->randomString(20));
+
// Encrypt the string
- $encrypted = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $str, MCRYPT_MODE_ECB, $iv);
+ $encrypted = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $key, $garbageString, MCRYPT_MODE_ECB, $iv);
// Return the string
return $encrypted;
$key = md5($this->rngInstance->getExtraSalt());
}
- // Encrypt the string
- $str = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $encrypted, MCRYPT_MODE_ECB, $iv);
+ // Decrypt the string
+ $garbageString = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $key, $encrypted, MCRYPT_MODE_ECB, $iv);
+
+ // Get the real string out
+ $strArray = explode("|", $garbageString);
+ $str = base64_decode($strArray[1]);
// Trim trailing nulls away
$str = rtrim($str, "\0");
public final function setFontSize ($fontSize) {
// Random font size?
if ($fontSize === "rand") {
- $fontSize = $this->getRngInstance()->randomNumber(3, 9);
+ $fontSize = $this->getRngInstance()->randomNumber(4, 9);
} // END - if
$this->imageStrings[$this->currString]['size'] = (int) $fontSize;