Skip to content

Instantly share code, notes, and snippets.

View joakibj's full-sized avatar

Joakim Bjørnstad joakibj

View GitHub Profile
@joakibj
joakibj / BucketStorage.java
Last active April 7, 2022 18:46
Klientkryptering med Google Tink, Google Cloud JMS integrasjon med lagring i Google Cloud Storage
package storage;
/**
* Ekstern lagring i bucket
*
* @author Joakim Bjørnstad
*/
public interface BucketStorage {
/**
* Krypterer og laster opp objekt til Cloud Storage.
@joakibj
joakibj / gist:b610bca401389342319a
Created November 22, 2015 07:27
55.14 - 100.3 / ( EXP( critical rating / 790.3 ) + 1 )
{4.99, 5.02173, 5.05346, 5.08519, 5.11691, 5.14864, 5.18037, 5.2121, 5.24383, 5.27555, 5.30728, 5.33901, 5.37073, 5.40246, 5.43419, 5.46591, 5.49764, 5.52936, 5.56109, 5.59281, 5.62454, 5.65626, 5.68798, 5.7197, 5.75142, 5.78315, 5.81487, 5.84659, 5.8783, 5.91002, 5.94174, 5.97346, 6.00517, 6.03689, 6.0686, 6.10031, 6.13203, 6.16374, 6.19545, 6.22716, 6.25887, 6.29058, 6.32228, 6.35399, 6.38569, 6.41739, 6.4491, 6.4808, 6.5125, 6.5442, 6.57589, 6.60759, 6.63928, 6.67098, 6.70267, 6.73436, 6.76605, 6.79774, 6.82943, 6.86111, 6.89279, 6.92448, 6.95616, 6.98783, 7.01951, 7.05119, 7.08286, 7.11453, 7.1462, 7.17787, 7.20954, 7.24121, 7.27287, 7.30453, 7.33619, 7.36785, 7.39951, 7.43116, 7.46281, 7.49446, 7.52611, 7.55776, 7.5894, 7.62104, 7.65268, 7.68432, 7.71596, 7.74759, 7.77922, 7.81085, 7.84248, 7.8741, 7.90573, 7.93735, 7.96896, 8.00058, 8.03219, 8.0638, 8.09541, 8.12702, 8.15862, 8.19022, 8.22182, 8.25341, 8.28501, 8.3166, 8.34818, 8.37977, 8.41135, 8.44293, 8.47451, 8.50608, 8.53765, 8.56922, 8.60079, 8.63
@joakibj
joakibj / steganography-png.py
Created August 24, 2013 19:42
Made this into a gist instead. Contains an implementation of the Least Significant Bit algorithm for steganography. Hides a png image (payload) in the n lowest bits of another png image(carrier), resulting in contaminated image called the package. This program was created for the Ukens Nøtt (nut of the week) newsmail, security group, Visma Consu…
import os, sys, png, argparse
#coding: utf-8
"""
Contains an implementation of the Least Significant Bit algorithm for steganography.
Hides a png image (payload) in the n lowest bits of another png image(carrier), resulting in contaminated image called the package.
"""
@joakibj
joakibj / unknown_cipher.py
Last active December 16, 2015 17:50
Newsmail #4 , Ukens nøtt #2
#coding: utf-8
import string
from collections import Counter
from pprint import pprint
def split_word_by_length(word, length):
return [word[i:i+length] for i in range(0, len(word), length)]
def create_bigrams(sentence):
@joakibj
joakibj / cipher_to_ascii.py
Last active December 16, 2015 02:39
Ukens nøtt #2 , Cipher 1
import re
def to_ascii(string):
return chr(int(string))
def main():
cipher = '83766567758765826932767378858832738332658769837977693265786832837932738332786984668368'
matches = re.findall('..?', cipher)
chars = map(to_ascii, matches)
@joakibj
joakibj / caesar_decode.py
Created April 5, 2013 11:07
Here is a more general simple caesar decode solution, using brute force through lookup tables. Both upper and lower case. Ukas nøtt #1
import sys, string
def caesar_decode(x, substitution):
transtable = string.maketrans('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', ''.join(substitution))
return x.translate(transtable)
def rotateRight(substitution):
return (substitution[0][-1] + substitution[0][:-1], substitution[1][-1] + substitution[1][:-1])
def main():
@joakibj
joakibj / rot13.py
Created April 5, 2013 09:07
Basic ROT13 cipher solved in Python using a simple lookup table. Ukas nøtt #1
import sys, string
def rot13(x):
transtable = string.maketrans('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz','NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm')
return x.translate(transtable)
def main():
cipher = 'Qh re xnafxwr zhyvtraf ra ivaare'
print rot13(cipher)