public function encrypt($plaintext, $key)
	{
		// Set up encryption parameters.
		$inputData = cryptoHelpers::convertStringToByteArray($plaintext);
		$keyAsNumbers = cryptoHelpers::toNumbers(bin2hex($key));
		$keyLength = count($keyAsNumbers);
		$iv = cryptoHelpers::generateSharedKey(16);

		$encrypted = AES::encrypt(
			$inputData,
			AES::modeOfOperation_CBC,
			$keyAsNumbers,
			$keyLength,
			$iv
		);

		$retVal = $encrypted['originalsize'] . self::SEPARATOR_CRYPTO_PARTS
			. cryptoHelpers::toHex($iv) . self::SEPARATOR_CRYPTO_PARTS
			. cryptoHelpers::toHex($encrypted['cipher']);

		return self::IDENTIFIER . self::SEPARATOR_ALGORITHM . $retVal;
	}