private static function _pad($text, $blocksize) {
        $pad = $blocksize - (strlen($text) % $blocksize);
        $textWithPadding = $text . str_repeat(chr($pad), $pad); 
        return $textWithPadding;
    }