mcrypt encrypt adding s bunch of '%00' to end of string
问题 Working with OAuth and encrypting the keys with the following function with a string which we'll call 'foo' (actually an OAuth token) public function encrypt( $text ) { // add end of text delimiter $data = mcrypt_encrypt( MCRYPT_RIJNDAEL_128, $this->key, $text, MCRYPT_MODE_ECB, $this->iv ); return base64_encode( $data ); } When I decrypt it using the inverse function, I end up with: Function: public function decrypt( $text ) { $text = base64_decode( $text ); return mcrypt_decrypt( MCRYPT