コード例 #1
0
ファイル: client.py プロジェクト: nickedes/Crypteda
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)
コード例 #2
0
ファイル: client.py プロジェクト: nickedes/Crypteda
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)
コード例 #3
0
ファイル: run.py プロジェクト: nickedes/Crypteda
# print("Plain Text: ", plain)
# print("Key: ", key)

print("\n-------------------- Encryption ----------------------\n")

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 = ""