Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class sagepay {
- public $encryptPassword = 'djgktifhtjriekfj';
- protected function encryptAndEncode($strIn) {
- $strIn = $this->pkcs5_pad($strIn, 16);
- echo $strIn;
- return "@".bin2hex(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $this->encryptPassword, $strIn, MCRYPT_MODE_CBC, $this->encryptPassword));
- }
- protected function pkcs5_pad($text, $blocksize) {
- $pad = $blocksize - (strlen($text) % $blocksize);
- return $text . str_repeat(chr($pad), $pad);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement