Skip to content

Instantly share code, notes, and snippets.

@hutt
hutt / rsa.md
Last active February 2, 2020 13:04
Beispiel: Verschlüsselung mit RSA

Beispiel: Verschlüsselung mit RSA

Im Folgenden verschlüssle ich meinen Namen, die Zeichenkette jannis mittels RSA.

Funktionsweise

  1. Es werden zwei verschiedene, große Primzahlen p und q zufällig gewählt, wobei die Differenz nicht zu klein sein sollte, und das Produkt der beiden berechnet: n = p * q

  2. Dann wird ein zufälliger Wert e ermittelt, der teilerfremd (relativ prim) und kleiner als (p-1) * (q-1) ist. Zu diesem wird das modular Inverse d berechnet, so dass gilt: (e * d) mod ((p-1) * (q-1)) = 1

  3. Als öffentlicher Schlüssel gilt dann: e, n und der private Schlüssel ist: d und n. Die Primzahlen p und q können vergessen werden, aber sie sollten niemals bekannt werden.

@hutt
hutt / pushover.sh
Created April 5, 2016 16:07
get notified easily by using pushover on your server.
#!/bin/bash
# Pushover settings
api_key="YOUR_API_KEY"
user_key="YOUR_USER_KEY"
# Logic
if [ -t 0 ]; then
# check for parameters
@hutt
hutt / bot.py
Last active September 11, 2016 23:21
Das Maß ist voll
#!/usr/bin/env python
#coding=UTF-8
#file: bot.py
#
#requirements:
#keys.py
#tweeps ("pip install tweeps")
#
import tweepy, time, sys, random
#from our keys module (keys.py), import the keys dictionary
@hutt
hutt / vorlage_textzusammenfassung.tex
Last active February 2, 2020 13:02
Vorlage für Textzusammenfassungen (Harvard-Zitierstil)
\documentclass[a4paper, 11pt]{article}
\usepackage{comment}
\usepackage{blindtext}
\usepackage{fullpage}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
@hutt
hutt / plainnat.bst
Last active February 2, 2020 12:58
plainnat.bst LaTeX bibliography template for german publications in social sciences
%% File: `plainnat.bst'
%% A modification of `plainnat.bst' by Patrick W Daly for use with natbib package
%%
%% Modified in 2019 by Jannis Hutt
%% E-mail: jhutt@uni-potsdam.de
%%
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN
%% archives in directory macros/latex/base/lppl.txt; either
%% version 1 of the License, or any later version.
@hutt
hutt / bt-to.js
Last active May 18, 2024 16:31
Bundestags-Tagesordnung API: BT-TO als iCal, JSON & XML verfügbar machen. Alles mit einem Cloudflare-Worker. Web: https://api.hutt.io/bt-to/
/* *
* bt-to api
* hutt
* 2024-05-17
*
*/
import cheerio from "cheerio";
addEventListener("fetch", (event) => {