public function pad($data, $blocksize = 16) { $pad = $blocksize - strlen($data) % $blocksize; return $data . str_repeat(chr($pad), $pad); }