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
Logs of simulations of different crypto algorithms integrated in Contiki | |
* Github repo with simulation code: https://github.com/kezzyhko/Contiki_EA_comparison | |
* Comparison table: https://docs.google.com/spreadsheets/d/1QjzWGqsHzynjnElhdrYRoawbSOMHYTp6z6I9W2rAc4Y | |
* `log_parser.py` is the python script used for parsing logs and getting the raw data | |
* Names of the log files are in form of `logs_ALG_BL_KL`, where `ALG` is the name of the algorithm, `BL` is a block length and `KL` is the key length |
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 socket | |
import sys | |
import os | |
# check arguments | |
def assert_(cond, message = None, print_help=True): | |
if (not cond): | |
if (message): | |
print() |
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
# This code is compilation of | |
# 1) code from | |
# https://0day.work/how-i-recovered-your-private-key-or-why-small-keys-are-bad/ | |
# 2) modified version of code snippet from crypto stackexchange | |
# https://crypto.stackexchange.com/a/25499 | |
# This code does not perform any checks on p, q and e and can give wrong result | |
# or throw not informative exception if p, q and/or e are not valid. | |
import pyasn1.codec.der.encoder |
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
# Some parts of this code is taken from | |
# https://0day.work/how-i-recovered-your-private-key-or-why-small-keys-are-bad/ | |
from Crypto.PublicKey import RSA | |
from base64 import b64decode | |
from binascii import unhexlify | |
# load keys (n, e1, e2) |
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
<?php | |
// constants | |
define('WEBHOOK_SECRET', 'https://youtu.be/dQw4w9WgXcQ'); | |
define('REPOSITORY_FULL_NAME', 'user/repo'); | |
define('SSH_HOST', 'github_key1'); # see https://gist.github.com/kezzyhko/734b83a763c1feb6f38fdf096800718f | |
define('WEBROOT_SYMLINC', '/home/user/app'); |
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
# An example of git ssh configuration for using different keys with the same host | |
# You should put this file in ~/.ssh/config | |
# And change IdentityFile to the paths to your keys | |
# After that, you can use the keys like that: | |
# git clone ssh://github_key1/user/repo1.git | |
# git clone ssh://github_key2/user/repo2.git | |
Host github_key1 | |
HostName github.com | |
User git |
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
<?php | |
echo '<pre>'; | |
define('start_num', 100); | |
define('end_num', 101); | |
define('moves', 5); | |
define('functions', explode(' ', '0 x2 2=>10 0=>1 Reverse')); | |
function check($current_num, $moves_left=moves, $history='') { | |
if ($current_num == end_num) { | |
echo $history; |
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
<?php | |
//$s1 = 'sw5mb3jtyxrpb24gd2fudhmgdg8gymugsw5ub0nurntmcjmzxzfuzjbybtq3mtbufsbmcmvlica='; | |
//$s2 = 'u1c1bwizsnrzwfjwyji0z2qyrnvkse1nzec4z1ltvwdtvzv1yjbovvjudg1jak16whpgdvpqqnlivfeztvrcdwztqm1jbvzssunbpq=='; | |
//$s1 == strtolower(base64_encode($secret)) | |
//$s2 == strtolower(base64_encode(base64_encode($secret))) | |
//return $secret | |
function restore_base64($s1, $s2) { |
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
<?php | |
set_time_limit(0); | |
define('COOKIES', [ | |
'MoodleSession' => 'lz7udac381k24ot9i6d7e7zdmf' //of course, you need to change this to you auth token | |
]); | |
define('URL', 'https://moodle.example.com/user/profile.php?id=%d'); //and change this to your moodle address | |
$context = stream_context_create(['http' => [ | |
'method' => 'GET', |
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
<pre><?php | |
ini_set('max_execution_time', '0'); | |
$sock = fsockopen("olymp.hackforces.com:9000"); | |
while ($in = fgets($sock)) { | |
echo "$in"; | |
$out = strrev($in); | |
//fwrite($sock, "$out\n"); |
OlderNewer