added lab2 q1

This commit is contained in:
Student 2025-08-05 09:25:24 +05:30
parent 933a52b3a8
commit 857ebf4a77
3 changed files with 70 additions and 6 deletions

View file

@ -0,0 +1,33 @@
from crypto.Cipher import DES3
def des_pad(text):
n = len(text) % 8
return text + (b' ' * n)
def des_128(ptext, key):
cipher=DES.new(key, DES.MODE_ECB)
def des_192(ptext, key):
def des_256(ptext, key):
def aes_128(ptext, key):
def aes_192(ptext, key):
def aes_256(ptext, key):
def bokeh_graph():
def main():
print("The AES/DES Encryptor")
ptext = input("Enter plaintext: ")
key = b'input("Enter key: ")'
print("DES 128 Bit Cyphertext: ", des_128(ptext, key))
print("DES 192 Bit Cyphertext: ", des_192(ptext, key))
print("DES 256 Bit Cyphertext: ", des_256(ptext, key))
print("AES 128 Bit Cyphertext: ", aes_128(ptext, key))
print("AES 192 Bit Cyphertext: ", aes_192(ptext, key))
print("AES 256 Bit Cyphertext: ", aes_256(ptext, key))
if __name__ == '__main__':
main()