Skip to content

Instantly share code, notes, and snippets.

@afonya2
afonya2 / AES.lua
Last active May 29, 2024 12:56
an AES implementation for CC: Tweaked
-- Advanced Encryption Standard (AES) libary for CC: Tweaked
-- ©️ 2024 afonya All rights reserved.
-- MIT License
-- Link: https://gist.github.com/afonya2/489c3306a7d85f8f9512df321d904dbb
-- Documentation: https://gist.github.com/afonya2/489c3306a7d85f8f9512df321d904dbb#file-docs-md
-- Last updated: February 25 2024
local SBox = {[0]=99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118,
202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192,
183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21,
4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117,
@afonya2
afonya2 / secureTunnel.lua
Created August 11, 2023 20:26
A secure tunnel for CC modems
local st = {}
local modem = peripheral.find("modem")
function modexp(base, exponent, modulus)
if modulus == 1 then
return 0
end
local result = 1
base = base % modulus
@afonya2
afonya2 / kristapi.lua
Last active August 14, 2023 19:01
Krist api for CC
--[[
Kristapi
Made by: afonya2@github
]]
local api = {}
local server = "https://krist.dev"
function api.getAddress(address)
local requ = http.get(server.."/addresses/"..address)
local out = textutils.unserialiseJSON(requ.readAll())
@afonya2
afonya2 / BIL.lua
Last active August 9, 2023 20:27
inventory lib for CC
--[[
Bagi's Inventory Libary (BIL)
Made by: afonya2@github
]]
local BIL = {}
function mysplit (inputstr, sep)
if sep == nil then
sep = "%s"
end
@afonya2
afonya2 / bmpapi.lua
Last active August 11, 2023 21:29
Bmp image render for CC
--[[
BMP Api
Made by: afonya2@github
]]
local bmpapi = {}
bmpapi.monitors = {}
local function loadCache(filename)
local fa = fs.open(filename, "r")
local fi = fa.readAll()