crypto.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:delta-sdk-python 作者: Covata 项目源码 文件源码
def encrypt_key_with_public_key(secret_key, public_encryption_key):
    """
    Encrypts the given secret key with the public key.

    :param bytes secret_key: the key to encrypt
    :param public_encryption_key: the public encryption key
    :type public_encryption_key: :class:`~rsa.RSAPublicKey`
    :return: the encrypted key
    :rtype: bytes
    """
    return public_encryption_key.encrypt(
        secret_key,
        padding.OAEP(
            mgf=padding.MGF1(algorithm=hashes.SHA256()),
            algorithm=hashes.SHA256(),
            label=None))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号