Skip to content

Instantly share code, notes, and snippets.

View keybase.md

Keybase proof

I hereby claim:

  • I am stribika on github.
  • I am stribika (https://keybase.io/stribika) on keybase.
  • I have a public key whose fingerprint is 3E97 B86C F08C BA60 38D5 4FD8 6700 09C5 8D4D 6CAF

To claim this, I am signing this object:

@stribika
stribika / montgomery_ladder.py
Created Feb 14, 2016
Basic Montgomery ladder implementation. In the test it works with just numbers, but you can plug in any operation.
View montgomery_ladder.py
#!/usr/bin/python3 -O
from math import floor, log
def montgomery_ladder(x, n, op, select):
k = floor(log(n, 2)) + 1
x1 = x
x2 = op(x, x)
for i in range(k - 2, -1, -1):
bit = 1 if n & (1 << i) else 0
@stribika
stribika / correcthorsebatterystaple
Created Mar 29, 2015
Generate easy to remember passwords
View correcthorsebatterystaple
#!/usr/bin/python3 -O
from Crypto.Random import get_random_bytes
from math import ceil, log2
from struct import unpack
from sys import argv, exit
if __name__ == "__main__":
with open("/usr/share/dict/cracklib-small") as wordlist:
words = wordlist.readlines()
@stribika
stribika / mmap.cc
Last active Aug 29, 2015
Copy a function between processes using RW and RX mappings.
View mmap.cc
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
View keybase.md

Keybase proof

I hereby claim:

  • I am stribika on github.
  • I am stribika (https://keybase.io/stribika) on keybase.
  • I have a public key whose fingerprint is 0406 629F F94F 92BF DEE5 FDA7 A11E 98D6 4B0F C61E

To claim this, I am signing this object:

You can’t perform that action at this time.