Skip to content

Instantly share code, notes, and snippets.

View lynnporu's full-sized avatar
🦦
Кормлю бобрів

Pavlo Tymoshenko lynnporu

🦦
Кормлю бобрів
View GitHub Profile
@lynnporu
lynnporu / rc5.c
Last active October 18, 2022 20:40
RC5-32/20/32 CBC Pad implementation in C for Linux using file mapping and generating key from user passphrase
/*
This is C implementation of RC5-32/20/32 CBC Pad. You can change
algorithm macroses W, R and B in order to create RC5 variations.
R and B parameters can be chosen freely (but with RFC 2040
limitations), but only W=32 is implemented in this code fully.
Those lines where W changing can occure errors is commented.
You can compile this file using the following directive:
gcc rc5.c md5.c rand.c io.c \
@lynnporu
lynnporu / rand.c
Last active November 21, 2020 00:35
Linear congruence pseudorandom generator aka Lehmer generator implementation in C for Linux
/*
This is C implementation of pseudorandom numbers generator. It
contains just one type of generators (linear congruence generator
aka Lehmer generator), but you can add your own generators as
well.
This file can be compiled as main with the following directive:
gcc -Wall rand.c -o bin/rand
Following flags are available:
@lynnporu
lynnporu / md5.c
Last active November 11, 2020 13:42
MD5 implementation in C using Linux file mapping
/*
This is MD5 C implementation using Linux file mapping. You can compile this
as main using following directive:
gcc -Wall md5.c io.c -o bin/md5
Having this .c file is also mandatory when you're including md5.h somewhere
in your program. In that case just delete main() from this file or use
-DOMIT_MD5_MAIN flag when compiling.
@lynnporu
lynnporu / io.c
Last active November 11, 2020 13:38
Linux file mapping
/*
Does not supposed to be compiled as main.
Contains methods for dealing with Linux file mappings.
*/
#include "io.h"
extern int errno;
import re
import requests
import json
from bs4 import BeautifulSoup
class Station(object):
# Destinations cache is dict, where key is ID and value is list of Station
CACHE = dict()