Skip to content

Instantly share code, notes, and snippets.

View myrsnipe's full-sized avatar

Steffen Nilsen myrsnipe

View GitHub Profile
@myrsnipe
myrsnipe / b94pw.py
Created December 6, 2025 16:52
base94 encoded scrypt password generator for physical printed backup
#!/usr/bin/python3
import sys,hashlib;_,s,r,p,l=sys.argv[:5]
k=hashlib.scrypt(
sys.stdin.read().strip().encode(),
salt=s.encode(),n=2**20,r=int(r),
p=int(p),dklen=512,maxmem=((2**31)-1))
print("".join(chr(33+b%94)
for b in k if b<188)[:int(l)],end='')