Esempio n. 1
0
def AES_CTR_Decrypt(key: bytes) -> AES:
    """
    Create AES decryption context in CTR mode
    """
    return AES(AES.CTR | AES.Decrypt, key)
Esempio n. 2
0
def AES_CFB_Encrypt(key: bytes, iv: bytes) -> AES:
    """
    Create AES encryption context in CFB mode
    """
    return AES(AES.CFB | AES.Encrypt, key, iv)
Esempio n. 3
0
def AES_OFB_Decrypt(key: bytes, iv: bytes) -> AES:
    """
    Create AES decryption context in OFB mode
    """
    return AES(AES.OFB | AES.Decrypt, key, iv)
Esempio n. 4
0
def AES_CBC_Decrypt(key: bytes, iv: bytes) -> AES:
    """
    Create AES decryption context in CBC mode
    """
    return AES(AES.CBC | AES.Decrypt, key, iv)
Esempio n. 5
0
def AES_ECB_Encrypt(key: bytes) -> AES:
    """
    Create AES encryption context in ECB mode
    """
    return AES(AES.ECB | AES.Encrypt, key)
Esempio n. 6
0
def AES_CTR_Encrypt(key: bytes) -> AES:
    '''
    Create AES encryption context in CTR mode
    '''
    return AES(AES.CTR | AES.Encrypt, key)
Esempio n. 7
0
def AES_OFB_Encrypt(key: bytes, iv: bytes) -> AES:
    '''
    Create AES encryption context in OFB mode
    '''
    return AES(AES.OFB | AES.Encrypt, key, iv)
Esempio n. 8
0
def AES_CFB_Decrypt(key: bytes, iv: bytes) -> AES:
    '''
    Create AES decryption context in CFB mode
    '''
    return AES(AES.CFB | AES.Decrypt, key, iv)
Esempio n. 9
0
def AES_CBC_Encrypt(key: bytes, iv: bytes) -> AES:
    '''
    Create AES encryption context in CBC mode
    '''
    return AES(AES.CBC | AES.Encrypt, key, iv)
Esempio n. 10
0
def AES_ECB_Decrypt(key: bytes) -> AES:
    '''
    Create AES decryption context in ECB mode
    '''
    return AES(AES.ECB | AES.Decrypt, key)