MCPcopy
hub / github.com/pyca/cryptography / encrypt

Function encrypt

docs/development/custom-vectors/cast5/generate_cast5.py:10–18  ·  view source on GitHub ↗
(mode, key, iv, plaintext)

Source from the content-addressed store, hash-verified

8
9
10def encrypt(mode, key, iv, plaintext):
11 cipher = base.Cipher(
12 algorithms.CAST5(binascii.unhexlify(key)),
13 mode(binascii.unhexlify(iv)),
14 )
15 encryptor = cipher.encryptor()
16 ct = encryptor.update(binascii.unhexlify(plaintext))
17 ct += encryptor.finalize()
18 return binascii.hexlify(ct)
19
20
21def build_vectors(mode, filename):

Callers 1

build_vectorsFunction · 0.70

Calls 4

encryptorMethod · 0.95
unhexlifyMethod · 0.80
updateMethod · 0.45
finalizeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…