added lab2 q1
This commit is contained in:
parent
933a52b3a8
commit
857ebf4a77
3 changed files with 70 additions and 6 deletions
33
IS/Lab/Lab2/aes_des_bit.py
Normal file
33
IS/Lab/Lab2/aes_des_bit.py
Normal 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()
|
Loading…
Add table
Add a link
Reference in a new issue