code: function (cipher, message, key, cfg) {
              // Apply config defaults
              cfg = this.cfg.extend(cfg);
  
              // Encrypt
              var encryptor = cipher.createEncryptor(key, cfg);
              var ciphertext = encryptor.finalize(message);
  
              // Shortcut
              var cipherCfg = encryptor.cfg;
  
              // Create and return serializable cipher params
              return CipherParams.create({
                  ciphertext: ciphertext,
                  key: key,
                  iv: cipherCfg.iv,
                  algorithm: cipher,
                  mode: cipherCfg.mode,
                  padding: cipherCfg.padding,
                  blockSize: cipher.blockSize,
                  formatter: cfg.format
              });
          }
docs: Encrypts a message.
  
  @param {Cipher} cipher The cipher algorithm to use.
  @param {WordArray|string} message The message to encrypt.
  @param {WordArray} key The key.
  @param {Object} cfg (Optional) The configuration options to use for this operation.
  
  @return {CipherParams} A cipher params object.
  
  @static
  
  @example
  
  var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key);
  var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv });
  var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL });