Example #1
0
def decryption(cipher, key):
    dt = []
    key = to_hex(pad(key))[0]

    for block in cipher:
        dt.append(decrypt(block, key))
    final = ""
    for block in dt:
        final += to_str(block)
    return rmpad(final)
Example #2
0
def decryption(cipher, key):
    dt = []
    key = to_hex(pad(key))[0]

    for block in cipher:
        dt.append(decrypt(block, key))
    final = ""
    for block in dt:
        final += to_str(block)
    return rmpad(final)
Example #3
0
inp = to_hex(pad(plain))
key = to_hex(pad(key))[0]

ct = []
for block in inp:
    ct.append(encrypt(block, key))

encrypted_text = ""
for block in ct:
    encrypted_text += to_str(block)

print("\n")
print("Encrypted Text: ", encrypted_text)
print("\n")

print("\n-------------------- Decryption ----------------------\n")

dt = []
for block in ct:
    dt.append(decrypt(block, key))
    print()

print("\n---------------------- Result ------------------------\n")

final = ""
for block in dt:
    final += to_str(block)

print("Decrypted Text: ", rmpad(final))