Skip to content

Instantly share code, notes, and snippets.

View jaybosamiya's full-sized avatar
🦊

Jay Bosamiya jaybosamiya

🦊
View GitHub Profile
@jaybosamiya
jaybosamiya / attack-repeating-key-xor.py
Created October 14, 2017 03:57
Attack repeating key xor
def attack_repeating_key_xor(ciphertext, keysize=None, score=None):
from itertools import cycle
def xor(enc, k):
return ''.join(chr(ord(a) ^ k) for a in enc)
def score_english(string):
freq = dict()
freq['a'] = 834
freq['b'] = 154
@jaybosamiya
jaybosamiya / fstar-indent.el
Last active March 22, 2018 00:25
[WIP] Provide the ability for Emacs to indent F-Star Code
(require 'subr-x)
(require 'fstar-mode)
(defun fstar-indent-file-to-string (file)
(string-trim
(with-temp-buffer (insert-file-contents file)
(buffer-string))))
(defun fstar-indent-string (str)
(let*
@jaybosamiya
jaybosamiya / fstar-profile-query
Last active June 19, 2018 21:20
A quick script to point out the parts that are slowing down the proof; Find updated script at https://github.com/jaybosamiya/dotfiles/blob/master/random-localbin-scripts/.local/bin/fstar-profile-queries
#! /bin/bash
# Updated script at https://github.com/jaybosamiya/dotfiles/blob/master/random-localbin-scripts/.local/bin/fstar-profile-queries
set -o pipefail
function usage() {
echo "Usage:" 1>&2
echo " $0 {filename.fst} [queryname]" 1>&2
echo "" 1>&2
echo "Useful Environment Variables:" 1>&2
@jaybosamiya
jaybosamiya / hacky-interp.py
Created April 8, 2018 04:12
Hacky interpreter for a subset of brainfuck
#######################################################
# A hacky interpreter for the ><+-[] language
# 2018 (c) Jay Bosamiya
#######################################################
#######################################################
# Update "program" and "cells" to whatever you chose
#######################################################
program = "INPUT PROGRAM HERE" # For example, try "+>+"
@jaybosamiya
jaybosamiya / pdf-un-poster4.sh
Created April 15, 2018 04:55
Split a 2x2 "poster" pdf
#!/bin/bash
function usage() {
echo "Usage:"
echo " pdf-un-poster4 {in.pdf} [out.pdf]"
}
if [ -z "$1" ]; then
usage
exit 1
@jaybosamiya
jaybosamiya / Makefile-for-codeblue.mk
Created November 5, 2018 20:49
CODE BLUE CTF '18
# Makefile to simplify Docker stuff for CODE BLUE CTF
# Author: Jay Bosamiya (f0xtr0t)
PROBLEM_NAME=todo
TEAM_USN=todo
TEAM_PASS=todo
TEST_FLAG="testing{flagtest}"
SUBMIT_TO_PROBLEM_NAME=$(PROBLEM_NAME)
all:
// Krautflare Solution
// Author: f0xtr0t
let early_object_only_for_addresses = [1,2,3,4,5.1];
// Server/Local differences
const SERVER = true;
const FPUTC_OFFSET = SERVER ? 0x877e0n : 0x6ef10n;
const PRINTF_OFFSET = SERVER ? 0x64e80n : 0x4f190n;
# Drop this into ~/.local/share/nautilus-python/extensions
# (creating the directory if needed) and restart nautilus.
#
# Provides a new option to "Download from Clipboard" in the
# context menu of folders, which uses `wget` to download
# whatever is in the clipboard.
import gi
from gi import require_version
require_version('Gtk', '3.0')