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 random | |
import binascii | |
def plus(x, y): | |
return (x + y) & 0xffffffff | |
#return (x + y) % 2^32 | |
def lrotate(x, n): | |
l = (x << n) & 0xffffffff | |
r = (x >> (32-n)) & 0xffffffff |
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 cv2 | |
import numpy as np | |
from PIL import Image | |
import re | |
import argparse | |
def create_rot_image(img_file, angle=-15, duration=40): | |
size = (128, 128) | |
center = (128//2, 128//2) |
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 zlib | |
import string | |
SECRET = "mugimugi_suko" | |
def check(pad : str): | |
data = SECRET + pad*20 | |
comp_data = zlib.compress(data.encode()) | |
return len(comp_data) |
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 Crypto.Cipher import AES | |
import string | |
import os | |
key = os.urandom(16) | |
# For brute-force | |
chars = string.ascii_uppercase + string.ascii_lowercase + string.digits | |
SECRET = b'IenagaMugiKawaii' | |
def pad(m): |
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 useless.math import * | |
from Crypto.Util.number import * | |
import random | |
def gen_key(bits): | |
p = getPrime(bits); q = getPrime(bits) | |
n = p*q | |
k = random.randint(2, n) | |
g = (1 + k*n) % (n**2) |
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 useless.math import * | |
from Crypto.Util.number import * | |
import random | |
def gen_key(bits): | |
p = getPrime(bits) | |
g = random.randint(1, p-1) | |
x = random.randint(1, p-1) |
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 chacha20 import * | |
from poly1305 import * | |
from utils import * | |
from calc import * | |
import struct | |
def chacha20_aead_encrypt(aad, key, iv, constant, plaintext): | |
""" |
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
package main | |
import ( | |
"fmt" | |
"net" | |
"os" | |
"time" | |
"./utils" |
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
package main | |
import ( | |
"fmt" | |
"net" | |
"os" | |
"time" | |
"./utils" | |
"./encryption" |
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 sage.all import * | |
def get_C2_prime(): | |
while True: | |
p = random_prime(2^256-1,False,2^255) | |
if p % 3 == 2: | |
return p | |
### KEY GEN ### |
OlderNewer