Skip to content

Instantly share code, notes, and snippets.

View ay0ks's full-sized avatar

Dymitr ay0ks

View GitHub Profile
@ay0ks
ay0ks / otp.py
Last active March 25, 2025 10:30
PoC One-Time Pad encryption in Python
otp = lambda *args: [a ^ b for a, b in zip(*args)]
@Killeroid
Killeroid / gpg-import-and-export-instructions.md
Created October 18, 2017 11:51
How to export and import gpg keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Gotten from the RedHat GPG migration manual

Backup the public and secret keyrings and trust database

## Export all public keys

gpg -a --export >mypubkeys.asc

@Painezor
Painezor / Checks.py
Last active April 20, 2025 16:07
Built-in Checks for the commands extension of discord py
@commands.guild_only()
# Command cannot be used in private messages.
@commands.dm_only()
# Command can only be used in private messages.
@commands.is_owner()
# Command can only be used by the bot owner.
@commands.is_nsfw()
@mimoo
mimoo / RDRAND.c
Created July 13, 2017 14:57
mirror from @DefuseSec analysis of RDRAND's code
// This is a quick analysis of Linux's use of RDRAND. All double-slash (//)
// style comments are my own, all slash-star (/*) style comments are from the
// original code. This was written by Taylor Hornby (@DefuseSec).
// This is part of the drivers/char/random.c file.
// I have re-ordered the procedures for clarity. Everything inside them (except
// comments) is exactly as you will find it in linux-3.11.tar.xz
// This comment says it 'does not use' the hardware RNG. It actually does.
/*
@Sgeo
Sgeo / hsum.rs
Last active November 27, 2024 15:58
Anonymous sum type prototype
use std::marker::PhantomData;
pub enum Void {}
impl Void {
fn any(&self) -> ! {
match *self {}
}
}