<?php

class ViewEncDec /*extends HtmlResponse */{
   var $mStartKey = 981;
   var $mMultKey = 12674;
   var $mAddKey = 35891;
	
   function Encrypt($string) {
      /* $start_key = $this->mStartKey;
      $encrypted = '';
      $string = "$string"; // stringify string
      for ($i = 0; $i < strlen($string); $i++) {
         $encrypted = $encrypted . chr(ord($string{$i}) ^ ($start_key >> 8));
         $start_key = ((ord($encrypted{$i}) + $start_key) * $this->mMultKey) + $this->mAddKey;
      } */
      return /* urlencode( */base64_encode($string)/*)*/;
   }

   function Decrypt($string) {
      //$start_key = $this->mStartKey;
      $string = base64_decode($string);//$string = base64_decode(urldecode($string));
      /* $decrypted = '';
      for ($i = 0; $i < strlen($string); $i++) {
         $decrypted = $decrypted . chr(ord($string{$i}) ^ ($start_key >> 8));
         $start_key = ((ord($string{$i}) + $start_key) * $this->mMultKey) + $this->mAddKey;
      } */
      return $string;//$decrypted;
   }
}
?>