original_string: public static function generateFilteredKey($definition, $masterKey) {
          $cipher = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_CBC, '');
          $ivSize = mcrypt_enc_get_iv_size($cipher);
          $iv = mcrypt_create_iv($ivSize, MCRYPT_RAND);
          
          $definitionWithPading = self::_pad(json_encode($definition),16);
      
          if (mcrypt_generic_init($cipher, $masterKey, $iv) != -1) {
              $cipherText = mcrypt_generic($cipher,$definitionWithPading);
              mcrypt_generic_deinit($cipher);
              $encrypted = sprintf("%s-%s",bin2hex($iv),bin2hex($cipherText)); 
              
              return $encrypted;
          }
      }
code: public static function generateFilteredKey($definition, $masterKey) {
          $cipher = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', MCRYPT_MODE_CBC, '');
          $ivSize = mcrypt_enc_get_iv_size($cipher);
          $iv = mcrypt_create_iv($ivSize, MCRYPT_RAND);
          
          $definitionWithPading = self::_pad(json_encode($definition),16);
      
          if (mcrypt_generic_init($cipher, $masterKey, $iv) != -1) {
              $cipherText = mcrypt_generic($cipher,$definitionWithPading);
              mcrypt_generic_deinit($cipher);
              $encrypted = sprintf("%s-%s",bin2hex($iv),bin2hex($cipherText)); 
              
              return $encrypted;
          }
      }
code_tokens: public static function generateFilteredKey ( $ definition , $ masterKey ) { $ cipher = mcrypt_module_open ( MCRYPT_RIJNDAEL_128 , '' , MCRYPT_MODE_CBC , '' ) ; $ ivSize = mcrypt_enc_get_iv_size ( $ cipher ) ; $ iv = mcrypt_create_iv ( $ ivSize , MCRYPT_RAND ) ; $ definitionWithPading = self :: _pad ( json_encode ( $ definition ) , 16 ) ; if ( mcrypt_generic_init ( $ cipher , $ masterKey , $ iv ) != - 1 ) { $ cipherText = mcrypt_generic ( $ cipher , $ definitionWithPading ) ; mcrypt_generic_deinit ( $ cipher ) ; $ encrypted = sprintf ( "%s-%s" , bin2hex ( $ iv ) , bin2hex ( $ cipherText ) ) ; return $ encrypted ; } }
docstring: Encrypt filtered key for use with the Connect API
  @param array $definition The filtered key definition
  @param string $masterKey The master key for the Connect project
  @return String
docstring_tokens: Encrypt filtered key for use with the Connect API