Skip to content

Instantly share code, notes, and snippets.

View prokls's full-sized avatar

prokls

  • Some University in Graz, Austria
View GitHub Profile
#!/usr/bin/env python3
import struct
import binascii
BYTEORDER='big'
def _pad(msg):
n = len(msg)
@prokls
prokls / pysha2 sha2 sha256.py
Last active July 8, 2023 21:29
Pure python3 implementation of SHA256 based on @thomdixon's pysha2
#!/usr/bin/python3
__base__ = 'https://github.com/thomdixon/pysha2/blob/master/sha2/sha256.py'
__author__ = 'Lukas Prokop'
__license__ = 'MIT'
import copy
import struct
import binascii
@prokls
prokls / md4.py
Last active April 9, 2016 22:18 — forked from tristanwietsma/md4.py
MD4 in pure Python 3.4. Based on @tristanwietsma's MD4 implementation: https://gist.github.com/tristanwietsma/5937448
#!/usr/bin/env python3
import binascii
def _pad(msg):
n = len(msg)
bit_len = n * 8
index = n & 0x3f
pad_len = 120 - index
if index < 56: