Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
solo artist

Jacob Gardner operator-DD3

:octocat:
solo artist
  • banishing dirgist
View GitHub Profile
@operator-DD3
operator-DD3 / spritz.lua
Created Dec 12, 2017
Spritz Encryption Routines
View spritz.lua
S = {}
i,j,k,z,a,v=0,0,0,0,0,0
w=1
N=2^9 --2^8 or 8bits
D=math.ceil(math.sqrt(N))
print("N:",N)
print("D:",D)
function InitializeState(N)
View block.lua
function log2 (x) return math.log(x) / math.log(2) end
function entropy (X)
local N, count, sum, i = X:len(), {}, 0
for char = 1, N do
i = X:sub(char, char)
if count[i] then
count[i] = count[i] + 1
else
count[i] = 1
@operator-DD3
operator-DD3 / MARSclock.lua
Created Aug 6, 2016
A simple function to calculate the Mars Sol Date (MSD) and the Coordinated Mars Time (MTC) from the current number of seconds since the UNIX epoch.
View MARSclock.lua
function mars_time()
local ms = os.time()*1000
local JDut = 2440587.5 + (ms /86400000)
local JDtt = JDut + (35 + 32.184) / 86400
local J2000 = JDtt - 2451545.0
local MSD = ((J2000 - 4.5)/1.027491252) + 44796 - 0.00096
local MTC = (24 * MSD) % 24
local h = math.floor(MTC)
local m = math.floor((MTC - h)*60)
local s = math.floor((MTC - h - (m/60))*60*60)
@operator-DD3
operator-DD3 / antivirus.lua
Last active Aug 4, 2016
A simple antivirus script that generates the md5 hash of a file and sends the hash to the malware hash database at cymru.com This depends on 'openssl'
View antivirus.lua
function os.capture(cmd, raw)
local f = assert(io.popen(cmd, 'r'))
local s = assert(f:read('*a'))
f:close()
if raw then return s end
s = string.gsub(s, '^%s+', '')
s = string.gsub(s, '%s+$', '')
s = string.gsub(s, '[\n\r]+', ' ')
return s
end
@operator-DD3
operator-DD3 / 5-3.lua
Last active Mar 10, 2016
A concatenative programming language inspired by FORTH and implemented in Lua.
View 5-3.lua
pc=1 --program counter
program = {} --array of words in program
dict = {} --dictionary of user defined words
prim = {} --language keywords
stack= {} --working stack
rstack = {} --2nd stack
mem = {} --memory
mode = "interpret"
alive = true --used for halting and error
c_word = ""
View keybase.md

Keybase proof

I hereby claim:

  • I am operator-dd3 on github.
  • I am operatordd3 (https://keybase.io/operatordd3) on keybase.
  • I have a public key whose fingerprint is B606 50B2 AADE 7DB0 FE0A 840F F2A7 2DC0 2E8A 66CB

To claim this, I am signing this object:

@operator-DD3
operator-DD3 / noise.html
Created Sep 28, 2015
Noisy Television Screen Simulation. Tested on mobile.
View noise.html
<style type="text/css">
html, body, canvas {
height: 100%;
width: 100%;
border-radius: 16px;
}
body {
display: flex;
background: black;
}
@operator-DD3
operator-DD3 / matasano.lua
Created Aug 29, 2015
[Lua] CryptoPals 1st attempt
View matasano.lua
-- Matasano Crypto Challenge
--
-- Jacob Gardner 2014
-- Challenge 1 (Convert hex to base64)
test1 = "49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d"
real1 = "SSdtIGtpbGxpbmcgeW91ciBicmFpbiBsaWtlIGEgcG9pc29ub3VzIG11c2hyb29t"
@operator-DD3
operator-DD3 / Set1-2.lua
Created Aug 26, 2015
[Lua] CryptoPals Cipher Challenge 1-2
View Set1-2.lua
local index_table = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
function to_binary(integer)
local remaining = tonumber(integer)
local bin_bits = ''
for i = 7, 0, -1 do
local current_power = math.pow(2, i)
@operator-DD3
operator-DD3 / Set1-1.lua
Created Aug 26, 2015
[Lua] CryptoPals Cipher Challenge
View Set1-1.lua
local index_table = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
function to_binary(integer)
local remaining = tonumber(integer)
local bin_bits = ''
for i = 7, 0, -1 do
local current_power = math.pow(2, i)