def install_pip(self, package, save=True, save_dev=False):
        """Installs a pip package.

        :param save: if `True`, pins the package to the Hydrogen requirements
            YAML file.
        :param save_dev: if `True`, pins the package as a development
            dependency to the Hydrogen requirements YAML file.
        :param return: a **single** :class:`Requirement` object, representing
            the installed version of the given package.
        """
        requirement = Requirement.coerce(package)
        click.echo("pip install " + requirement.package)
        cmd = envoy.run("pip install {}".format(str(requirement)))
        if cmd.status_code == 0:
            installed_packages = get_installed_pypackages()
            package = installed_packages[requirement.package]
            requirement.version = "=={}".format(package.version)
            if save:
                self.requirements["all"].add(requirement)
            if save_dev:
                self.requirements["dev"].add(requirement)
            if save or save_dev:
                self.requirements.save()
            return requirement
        else:
            fatal(cmd.std_err)
def _encrypted_user_photo_key_str(self):
        """
        Software Secure needs to have both UserPhoto and PhotoID decrypted in
        the same manner. So even though this is going to be the same for every
        request, we're also using RSA encryption to encrypt the AES key for
        faces.
        """
        face_aes_key_str = settings.VERIFY_STUDENT["SOFTWARE_SECURE"]["FACE_IMAGE_AES_KEY"]
        face_aes_key = face_aes_key_str.decode("hex")
        rsa_key_str = settings.VERIFY_STUDENT["SOFTWARE_SECURE"]["RSA_PUBLIC_KEY"]
        rsa_encrypted_face_aes_key = rsa_encrypt(face_aes_key, rsa_key_str)

        return rsa_encrypted_face_aes_key.encode("base64")