Skip to content

Instantly share code, notes, and snippets.

@fionn
fionn / 57.txt
Last active January 6, 2025 01:51
Cryptopals problems 57 to 66
// ------------------------------------------------------------
57. Diffie-Hellman Revisited: Subgroup-Confinement Attacks
This set is going to focus on elliptic curves. But before we get to
that, we're going to kick things off with some classic Diffie-Hellman.
Trust me, it's gonna make sense later.
@MartinEesmaa
MartinEesmaa / youtube_formats.md
Last active January 6, 2025 01:51 — forked from AgentOak/youtube_formats.md
Youtube Format IDs

Note: This is all almost full YouTube ID informations. Original owner goes to AgentOak, modified version by Martin Eesmaa.

See the credits and also special thanks in below.

Last updated: December 2024

Also known as itag or format codes and way back they could be specified with the fmt parameter (e.g. &fmt=22). Depending on the age and/or popularity of the video, not all formats will be available.

DASH video

@natmchugh
natmchugh / Montgomery.py
Created January 12, 2016 21:08
Montgomery Ladder
import random
class Montgomery:
# B*v^2 = u^3 + A*u^2 + u
def __init__(self, A, B, p):
self.A = A
self.B = B
self.p = p
@petelacey
petelacey / Dockerfile
Last active January 6, 2025 01:46
Docker Compose setup for Elixir, Phoenix, and Postgres
FROM elixir:latest
# Install debian packages
RUN apt-get update && \
apt-get install --yes build-essential inotify-tools postgresql-client git && \
apt-get clean
ADD . /app
# Install Phoenix packages
@dneumann42
dneumann42 / pretty.lua
Last active January 6, 2025 01:46
pretty.lua
local function tostring_pretty(value, cache, ident)
if type(value) ~= "table" then
if type(value) == "string" then
return '"' .. tostring(value) .. '"'
end
return tostring(value)
end
cache = cache or {}
ident = ident or " "
# This is an example of hash length extension attacks (and why you don't roll your own crypto!!!)
# In this case, an attacker, Malice, intercepts a message ("to=12345&amt=103.53&note=Thanks!")
# that has been "authenticated" using a poorly constructed MAC (message authentication code).
# This MAC has been created using the following method: md5(secret | message).
# Ideally, since the attacker, Malice, doesn't have the secret, he should be unable to craft a new
# message that is also authenticated. However, because of how the mac was created, we can use
# Hash Length Extensions. We'll be using the pymd5 library as found on upenn's website via google cache:
# https://webcache.googleusercontent.com/search?q=cache:yyvXXyVKuYYJ:https://www.cis.upenn.edu/~cis331/project1/pymd5.py+&cd=3&hl=en&ct=clnk&gl=us
import urllib
@esparta
esparta / 01-no-silver-bullet-es.md
Created May 14, 2014 17:32
No hay balas de plata

No hay balas de plata: Lo esencial y lo accidental en la Ingeniería del Software

by Frederick P. Brooks, Jr.

De todos los monstruos que pueblan nuestras pesadillas, ninguno es tan terrorífico como el hombre lobo, porque pasa repentinamente de lo familiar al horror. Por eso, todos buscamos balas de plata que puedan acabar con ellos magicamente.

El familiar proyecto de software, al menos tal como lo ve un gestor no técnico, tiene algo de ese caracter: suele ser inocente y sencillo, pero es capaz de convertirse en un monstruo de plazos incumplidos, objetivos fallados y productos defectuosos. Por eso escuchamos lamentos clamando por una bala de plata -- algo que haga que los costes del software caigan tan rapidamente como lo han hecho los del hardware.

Pero no se ve en ningún lugar una bala de plata. No hay ningún desarrollo, ni en tecnología ni en técnicas de gestión, que por si sólo prometa ni siquiera una mejora en un orden de magnigud en productividad, en fiabilidad, en simplicidad. En este artículo,

@AlexanderKud
AlexanderKud / kangaroo.rs
Created January 6, 2025 01:44 — forked from d0nutptr/kangaroo.rs
Pollard's Kangaroo Method Algorithm
extern crate rand;
extern crate num;
use kangaroo::rand::Rng;
use num::ToPrimitive;
use num::{Integer, Zero, One};
use std::collections::HashMap;
use std::sync::Mutex;
#[derive(Debug)]
@AlexanderKud
AlexanderKud / pol.py
Created October 22, 2024 05:44 — forked from err4o4/pol.py
pol.py
#!/usr/bin/python
#import sys
#sys.path.insert(0, "/polusfs/modules/anaconda/anaconda-3/pkgs/gmpy2-2.0.8-py37h10f8cd9_2")
# based on code by 57fe, 2019
# fe57.org/forum/thread.php?board=4&thema=1#1
#######################
# print() compatibility python 2/3
@KeyMaster-
KeyMaster- / spriteGlitch.shader
Last active January 6, 2025 01:41
A glitch effect shader for Sprites in Unity3D
//Copyright (c) 2014 Tilman Schmidt (@KeyMaster_)
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
//The above copyright notice and this permission notice shall be included in