Closed rsoultanaev closed 6 years ago
Example (quick_gcm_enc uses get_tag and in here tag is the return value of get_tag):
quick_gcm_enc
get_tag
tag
>>> from os import urandom >>> from petlib.cipher import Cipher >>> message = "hello" >>> plaintext = message.encode("utf8") >>> aes = Cipher("aes-128-gcm") >>> iv = urandom(16) >>> key = urandom(16) >>> ciphertext, tag = aes.quick_gcm_enc(key, iv, plaintext) >>> type(tag) <type '_cffi_backend.CDataOwn'> >>> tag is str False >>> tag is bytes False
Example (
quick_gcm_enc
usesget_tag
and in heretag
is the return value ofget_tag
):