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