OXID eShop CE  4.9.6
 All Classes Files Functions Variables Pages
oxdecryptor.php
Go to the documentation of this file.
1 <?php
2 
7 {
8 
17  public function decrypt($sString, $sKey)
18  {
19  $sKey = $this->_formKey($sKey, $sString);
20 
21  $sString = substr($sString, 3);
22  $sString = str_replace('!', '=', $sString);
23  $sString = base64_decode($sString);
24  $sString = $sString ^ $sKey;
25 
26  return substr($sString, 2, -2);
27  }
28 
37  protected function _formKey($sKey, $sString)
38  {
39  $sKey = '_' . $sKey;
40  $iKeyLength = (strlen($sString) / strlen($sKey)) + 5;
41 
42  return str_repeat($sKey, $iKeyLength);
43  }
44 }