mirror of
https://github.com/autistic-symposium/sec-pentesting-toolkit.git
synced 2025-05-02 06:46:07 -04:00
crypto modules
This commit is contained in:
parent
f211c1cbab
commit
5fcb5a5cb9
28 changed files with 122 additions and 7 deletions
17
Cryptography/Block_Ciphers/AES/aes_simple_example.py
Normal file
17
Cryptography/Block_Ciphers/AES/aes_simple_example.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
|
||||
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_aes()
|
Loading…
Add table
Add a link
Reference in a new issue