From 65761499c3034d28ff9d9d166277715f8d1b47e0 Mon Sep 17 00:00:00 2001 From: TiagoRG <35657250+TiagoRG@users.noreply.github.com> Date: Tue, 28 Feb 2023 18:40:23 +0000 Subject: [PATCH] Removed stream ciphers --- 1ano/2semestre/labi/tema01/criptograma | 0 .../labi/tema01/src/stream_cyphers.py | 22 ------------------- 2 files changed, 22 deletions(-) delete mode 100644 1ano/2semestre/labi/tema01/criptograma delete mode 100644 1ano/2semestre/labi/tema01/src/stream_cyphers.py diff --git a/1ano/2semestre/labi/tema01/criptograma b/1ano/2semestre/labi/tema01/criptograma deleted file mode 100644 index e69de29..0000000 diff --git a/1ano/2semestre/labi/tema01/src/stream_cyphers.py b/1ano/2semestre/labi/tema01/src/stream_cyphers.py deleted file mode 100644 index d1919b1..0000000 --- a/1ano/2semestre/labi/tema01/src/stream_cyphers.py +++ /dev/null @@ -1,22 +0,0 @@ -# Screw 1.4 :skull: -import codecs -import os -import sys -from Crypto.Cipher import ARC4 - - -def main(args=None): - with open(args[0], 'r') as f: - text = f.read(2048) - cipher = ARC4.new(bit_array_from_str(args[1])) - cryptogram = cipher.encrypt(text) - os.write(1, cryptogram) - print() - - -def bit_array_from_str(s): - return [codecs.encode("hex") for elem in s] - - -if __name__ == '__main__': - main(sys.argv[1:])