You are here

private static function AESEncryption::pkcs5_unpad in SAML SP 2.0 Single Sign On (SSO) - SAML Service Provider 7

1 call to AESEncryption::pkcs5_unpad()
AESEncryption::decrypt_data in includes/encryption.php
*

File

includes/encryption.php, line 39

Class

AESEncryption
@package miniOrange @author miniOrange Security Software Pvt. Ltd. @license GNU/GPLv3 @copyright Copyright 2015 miniOrange. All Rights Reserved.

Code

private static function pkcs5_unpad($text) {
  $pad = ord($text[strlen($text) - 1]);
  if ($pad > strlen($text)) {
    return false;
  }
  if (strspn($text, $text[strlen($text) - 1], strlen($text) - $pad) != $pad) {
    return false;
  }
  return substr($text, 0, -1 * $pad);
}