Exemplo n.º 1
0
def test_padding_remove():
    ''' Assert that the surrounding whitespace is successfully stripped from
        string '''
    teststr = u'Oh Romeo!'
    padded = padding_add(teststr)
    assert len(padding_remove(padded)) == len(teststr)
    assert padding_remove(padded) == teststr
Exemplo n.º 2
0
def decrypt(key, iv, ciphertext):
    plaintext = padding_remove(aes_decrypt(key, iv, ciphertext).decode('utf-8'))
    if sys.version_info < (3, 0):
        return unicode(plaintext)
    else:
        return plaintext
Exemplo n.º 3
0
def decrypt(key, iv, ciphertext):
    plaintext = padding_remove(aes_decrypt(key, iv, ciphertext).decode('utf-8'))
    if sys.version_info < (3, 0):
        return unicode(plaintext)
    else:
        return plaintext