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 absolute_import, division, print_function | |
import hashlib | |
from Crypto import Random | |
def myhash(data, iv_length=8, hash_length=16): | |
''' | |
my hash scheme made to behave somewhat like bcrypt by having an IV | |
this is randomly generated and attached to the front of the hash, it is also injected into the sha256 hash | |
this ensures the hash is generated different | |
the hash is designed to obscure some operating information of my covert software where bcrypt would be the best choice but is too long |
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
''' | |
pip install pycrypto | |
''' | |
from Crypto.PublicKey import RSA | |
from Crypto import Random | |
import ast |
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
def calculate_rsa_nedpq(p=1090660992520643446103273789680343, q=1162435056374824133712043309728653): | |
""" | |
input large primes p and q, returns the 5 components in a tuple (n, e, d, p, q) which can be used to construct private keys like: | |
RSA.construct() | |
https://crypto.stackexchange.com/questions/19444/rsa-given-q-p-and-e?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa | |
""" | |
def egcd(a, b): | |
x, y, u, v = 0, 1, 1, 0 | |
while a != 0: |
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 absolute_import, division, print_function | |
from Cryptodome.PublicKey import RSA | |
from Cryptodome.Random import get_random_bytes | |
from Cryptodome.Cipher import AES, PKCS1_OAEP | |
data = "I met aliens in UFO. Here is the map.".encode("utf-8") | |
recipient_key = RSA.import_key(open("shroomery_encrypt_key_cache/1024.public.pem").read()) | |
session_key = get_random_bytes(16) |
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 | |
s = '' | |
for n in range(10): | |
s += random.choice('abc') | |
print(s) |
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 sys | |
filename = sys.argv[1] # first argument | |
string_to_count = sys.argv[2] # second argument | |
with open(filename) as f: # opens a file, f becomes the file object, this is the official PEP8 style for reading files | |
text = f.read() # we need to read the data from that file | |
print(text.count(string_to_count)) # strings have a special function in python that can count the occurrences of a string within them |
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
if pcall(function () | |
print('test1') | |
error() | |
end)then | |
print('test2') | |
else | |
print('test3') | |
end |
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
if pcall(function () | |
print('test1') | |
error() | |
end)then | |
print('test2') | |
else | |
print('test3') | |
end |
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
mat3 GetTBN(); | |
vec3 GetBumpedNormal(mat3 tbn, vec2 texcoord); | |
vec2 ParallaxMap(mat3 tbn); | |
Material ProcessMaterial() | |
{ | |
mat3 tbn = GetTBN(); | |
vec2 texCoord = ParallaxMap(tbn); | |
Material material; |
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
var coll_dict_data1 = [ | |
["player", | |
"1000000000000000", "0000111111111111"], | |
["playerbullet", | |
"0100000000000000", "0000101110111011"], | |
["playerbulletclash", | |
"0010000000000000", "0000111111111111"], | |
["enemy", | |
"0000100000000000", "1111000011111111"], | |
["enemybullet", |
OlderNewer