MCPcopy Index your code
hub / github.com/PyGithub/PyGithub / encrypt

Function encrypt

github/PublicKey.py:53–60  ·  view source on GitHub ↗

Encrypt a Unicode string using the public key.

(public_key: str, secret_value: str)

Source from the content-addressed store, hash-verified

51
52
53def encrypt(public_key: str, secret_value: str) -> str:
54 """
55 Encrypt a Unicode string using the public key.
56 """
57 pk = public.PublicKey(public_key.encode("utf-8"), encoding.Base64Encoder)
58 sealed_box = public.SealedBox(pk)
59 encrypted = sealed_box.encrypt(secret_value.encode("utf-8"))
60 return b64encode(encrypted).decode("utf-8")
61
62
63class PublicKey(CompletableGithubObject):

Callers 1

encryptMethod · 0.85

Calls 2

encodeMethod · 0.80
encryptMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…