Skip to content

Instantly share code, notes, and snippets.

@chrisdl
Created January 23, 2017 16:29
Show Gist options
  • Save chrisdl/eeed99d7a9edc4f1b2e0df60d00d6fca to your computer and use it in GitHub Desktop.
Save chrisdl/eeed99d7a9edc4f1b2e0df60d00d6fca to your computer and use it in GitHub Desktop.
Where art thou verify?
(py27) ubuntu@ubuntu-xenial:/vagrant$ bpython
bpython version 0.16 on top of Python 2.7.12 /home/ubuntu/.virtualenvs/py27/bin/python
>>> from Crypto.Hash import HMAC
>>> import os
>>> import binascii
>>> key = binascii.hexlify(os.urandom(32))
>>> msg = 'Hello World'
>>> my_hmac = HMAC.new(key=key, msg=msg)
>>> import Crypto
>>> Crypto.version_info
(2, 6, 1, 'final', 0)
>>> dir(my_hmac)
['__doc__', '__init__', '__module__', 'copy', 'digest', 'digest_size', 'digestmod', 'hexdigest', 'inner', 'outer', 'update']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment