mirror of
https://github.com/autistic-symposium/sec-pentesting-toolkit.git
synced 2025-04-27 11:09:09 -04:00
23 lines
534 B
Python
23 lines
534 B
Python
#!/usr/bin/env python
|
|
|
|
def example_sha():
|
|
from Crypto.Hash import SHA256
|
|
hash = SHA256.new()
|
|
hash.update('message')
|
|
print hash.digest()
|
|
|
|
def example_aes():
|
|
from Crypto.Cipher import AES
|
|
IV = '1234567890123456'
|
|
KEY = 'Hello There!'
|
|
obj = AES.new(KEY, AES.MODE_CBC, IV)
|
|
message = "The answer is no"
|
|
ciphertext = obj.encrypt(message)
|
|
print ciphertext
|
|
obj2 = AES.new(KEY, AES.MODE_CBC, IV)
|
|
print obj2.decrypt(ciphertext)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
example_sha()
|
|
#example_aes() |