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 math | |
import time | |
from cryptography.hazmat.primitives.asymmetric import rsa | |
def main(): | |
key_sizes_to_test = [512, 640, 768, 896] | |
number_of_keys_per_size_to_generate = 10000 |
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
I had a chat with a buddy of mine (Topi Talvitie) who's a postdoc researcher here at Helsinki Uni. | |
He reverse engineered the logic on how a fake solver algorithm, such as the one by Grant's, can be created. | |
I've tried to to translate it the best I can: | |
------------- | |
The goal is to find integers p and q so that pq = N [N being the public key]. | |
The problem is then rephrased so that the goal is to find a single integer C = (p+q) / 2. | |
This is because finding the value of a single variable appears easier than solving an equation with two variables. |
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
#!/usr/bin/env python3.7 | |
# -*- coding: utf-8 -*- | |
import math | |
import multiprocessing | |
import random | |
import time | |
from multiprocessing import Queue, Process | |
from typing import Tuple |
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
# Server authentication | |
Protocol 2 | |
HostKey /etc/ssh/ssh_host_ed25519_key | |
# Client authentication (Public key of client goes to ~/.ssh/authorized_keys) | |
PermitEmptyPasswords no | |
PasswordAuthentication yes | |
ChallengeResponseAuthentication no | |
PubkeyAuthentication yes |
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 math | |
import random | |
from typing import List | |
# Let's meet our contestants | |
def trial_division(semiprime: int): | |
"""The Faster brute force variant, from Wikipedia: |
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
#!/usr/bin/env python3 | |
import subprocess | |
import sys | |
# defining keys & strings to be used | |
key = "org.gnome.settings-daemon.plugins.media-keys custom-keybindings" | |
subkey1 = key.replace(" ", ".")[:-1]+":" | |
item_s = "/"+key.replace(" ", "/").replace(".", "/")+"/" | |
firstname = "custom" | |
# get the current list of custom shortcuts |
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
#!/usr/bin/env python3.7 | |
# -*- coding: utf-8 -*- | |
import shutil | |
import subprocess | |
import os | |
from typing import List, NoReturn, Tuple | |
debug = True |
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
#!/usr/bin/env bash | |
create_install_dir () { | |
if [ -d "$HOME/stemtest" ]; then | |
mv $HOME/stemtest stemtest_backup_at_$(date +%Y-%m-%d_%H-%M-%S) | |
fi | |
mkdir -p $HOME/stemtest 2>/dev/null | |
} | |
# Install dependencies |
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
#!/usr/bin/env python3.6 | |
# -*- coding: utf-8 -*- | |
import base64 | |
import hashlib | |
import os | |
import random | |
import shlex | |
import socket | |
import subprocess |
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 base64 | |
import os | |
# The durations floats are durations in seconds it took to have Google | |
# translate pronounce each word. These samples were recorded and the | |
# duration was measured using Audacity to best of ability. | |
b10_table = {'0': ('zero ', 0.882), | |
'1': ('one ', 0.699), | |
'2': ('two ', 0.718), |
NewerOlder