This file contains 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
from __future__ import unicode_literals, print_function | |
import re | |
import colorama | |
header_regex = re.compile('^HTTP_') | |
def print_header(key, value): |
This file contains 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 | |
class FeistelSHA1: | |
rounds = 4 # 4 rounds is sufficient as long as the round function is cryptographically secure | |
split = 1 / 2 | |
def __init__(self, key, rounds=rounds): | |
self.subkeys = [hashlib.sha1(bytes((i,)) + key).digest() for i in range(rounds)] |