OXID eShop CE  4.8.12
 All Classes Files Functions Variables Pages
oxencryptor.php
Go to the documentation of this file.
1 <?php
2 
7 {
15  public function encrypt($sString, $sKey)
16  {
17  $sString = "ox{$sString}id";
18 
19  $sKey = $this->_formKey($sKey, $sString);
20 
21  $sString = $sString ^ $sKey;
22  $sString = base64_encode ( $sString );
23  $sString = str_replace( "=", "!", $sString );
24 
25  return "ox_$sString";
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 
43 }