Skip to content

Instantly share code, notes, and snippets.

View PaluMacil's full-sized avatar

Dan Wolf PaluMacil

View GitHub Profile
@PaluMacil
PaluMacil / greeter_client_main.go
Created June 30, 2023 00:55
ALTS modified GRPC helloworld example (grpc-go/examples/helloworld from https://grpc.io/docs/languages/go/quickstart/)
// Package main implements a client for Greeter service.
package main
import (
"context"
"flag"
"log"
"time"
"google.golang.org/grpc"
package main
import (
"crypto/rand"
"encoding/base64"
"fmt"
)
type UUID []byte
@PaluMacil
PaluMacil / reduce-proppy.py
Created April 26, 2022 23:34
deduplicate by object field
from itertools import groupby
from typing import Union
Registration = dict[str, Union[int, str]]
ALL_REGISTRATIONS = [
{'id': 0,
'hostname': 'lappytoppy',
'last_seen': '2021-09-27T18:00'},
{'id': 1,
@PaluMacil
PaluMacil / CMakeLists.txt
Created April 26, 2022 23:09
output process info linux
cmake_minimum_required(VERSION 3.16)
project(process_list)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/bin")
file(GLOB_RECURSE fileCollection "src/*.cpp")
add_executable(${PROJECT_NAME} ${fileCollection})
find_package(nlohmann_json CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME}
from itertools import groupby
from typing import Union
Registration = dict[str, Union[int, str]]
ALL_REGISTRATIONS = [
{'id': 0,
'hostname': 'lappytoppy',
'last_seen': '2021-09-27T18:00'},
{'id': 1,
@PaluMacil
PaluMacil / Miller-Rabin.ipynb
Created March 28, 2021 17:45
A notebook in SAGE Math showing prime number calculation via Miller Rabin, based upon example in Stallings' "Cryptography and Network Security"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@PaluMacil
PaluMacil / smallrsa.go
Created March 28, 2021 17:41
An inefficient/insecure implementation of RSA using very small numbers. Meant for demonstration of the underlying math and using the same variable names as in Stalling's "Cryptography and Network Security" 6th edition.
package main
import (
"fmt"
)
type RSA struct {
p int
q int
e int
@PaluMacil
PaluMacil / index.js
Created March 28, 2021 17:31
MD5 password file generator for demonstrating john the ripper
import { cryptMD5 } from 'cryptmd5';
import { appendFile } from 'fs';
const pwPerFile = 5;
function writeFile(pwSize) {
const filename = `pwLen${pwSize}.txt`;
console.log(`starting ${filename}`);
for (let i = 0; i < pwPerFile; i++) {
const password = passwordOf(pwSize);
@PaluMacil
PaluMacil / round.c
Created November 26, 2020 16:48
"round" is an OpenMPI ring ping to demonstrate a message getting passed between each node and modified one at a time
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <mpi.h>
#define MASTER 0
#define TAG 0
#define MSGSIZE 100000
#define MAX 25
package main
import (
"fmt"
"math"
)
type AttributeValue struct {
Entropy float64
PofValue float64