mirror of
https://github.com/autistic-symposium/sec-pentesting-toolkit.git
synced 2025-04-26 02:29:07 -04:00
23 lines
402 B
Python
23 lines
402 B
Python
#!/usr/bin/env python
|
|
|
|
__author__ = "Mia Stein"
|
|
|
|
|
|
from Crypto.Cipher import DES
|
|
|
|
def decrypt(key, text):
|
|
des = DES.new(key, DES.MODE_ECB)
|
|
return des.decrypt(text)
|
|
|
|
def encrypt(key, text):
|
|
des = DES.new(key, DES.MODE_ECB)
|
|
return des.encrypt(text)
|
|
|
|
if __name__ == '__main__':
|
|
text = "01234567"
|
|
key = 'abcdefgh'
|
|
print encrypt(key, text)
|
|
print
|
|
print decrypt(key, text)
|
|
|