Created
July 25, 2014 20:28
-
-
Save jujum4n/9400c4d61fa17db98f1a to your computer and use it in GitHub Desktop.
Hashlibfun.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import hashlib | |
| def chaincrypt(plaintext): | |
| #CIPHERTEXT=hashlib.md5(plaintext) | |
| #CIPHERTEXT=hashlib.sha1(plaintext) | |
| CIPHERTEXT=hashlib.sha512(plaintext) | |
| CIPHERTEXT=hashlib.sha224(CIPHERTEXT.hexdigest()) | |
| CIPHERTEXT=hashlib.sha256(CIPHERTEXT.hexdigest()) | |
| CIPHERTEXT=hashlib.sha384(CIPHERTEXT.hexdigest()) | |
| print CIPHERTEXT.hexdigest() | |
| def multicrypt(plaintext): | |
| #CIPHERTEXT=hashlib.md5(plaintext) | |
| #sprint "md5: " + CIPHERTEXT.hexdigest() | |
| CIPHERTEXT=hashlib.sha1(plaintext) | |
| print "sha1: " + CIPHERTEXT.hexdigest() | |
| CIPHERTEXT=hashlib.sha224(plaintext) | |
| print "sha224: " + CIPHERTEXT.hexdigest() | |
| CIPHERTEXT=hashlib.sha256(plaintext) | |
| print "sha256: " + CIPHERTEXT.hexdigest() | |
| CIPHERTEXT=hashlib.sha384(plaintext) | |
| print "sha384: " + CIPHERTEXT.hexdigest() | |
| CIPHERTEXT=hashlib.sha512(plaintext) | |
| print "sha512: " + CIPHERTEXT.hexdigest() | |
| h = hashlib.new('ripemd160') | |
| h.update(plaintext) | |
| print "ripemd160: " + h.hexdigest() | |
| def main(): | |
| print "-----------------------------" | |
| plaintext="encrypt me" | |
| print plaintext | |
| print "-----------------------------" | |
| multicrypt(plaintext) | |
| print "-----------------------------" | |
| chaincrypt(plaintext) | |
| if __name__ == '__main__': | |
| main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment