This commit is contained in:
Mari Wahl 2014-12-30 18:56:44 -05:00
parent c5796321ce
commit 623c013018
2 changed files with 31 additions and 8 deletions

View file

@ -0,0 +1,23 @@
#!/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()