http://www.computerc...sed-encryption/
For some reason, I can't get line numbers to show up. If you want to see which print commans I am talking about, click here.
local bool rep = false
local label = os.getComputerLabel()
local id = os.getComputerID()
local h = fs.open("/disk/data", "a")
local b = fs.open("/disk/data", "r")
local r = b.readAll()
local r2 = b.readLine()
local bool existing = false
local elabel = encrypt(label,"rofl")
local eid = encrypt(id,"rofl")
local encrypted = eid..elabel
local idlabel = id.." "..label
print("[1] Normal Usage")
print("[2] Decryption")
input2 = read()
if input2 == "1" then
print("Warning! Do not use numbers in labels!")
print("Continue? Y/N")
input = read()
if input == "Y" or input == "y" then
if string.find (r, encrypt(label,"rofl")) or string.find (r, encrypt(id,"rofl")) then
existing = true
end
if label ~= nil and existing ~= true then
local text = encrypted
h.writeLine(text)
h.close()
elseif label == nil then
print("Please add a label.")
elseif existing == true then
print("Computer already on file.")
else
print ("Unknown Error")
end
end
if input2 ~= "1" then
print("Unknown Error")
-- This error code never triggers, so the if statement always fails. Why?
printdec()
end
if decrypt(r,"rofl") == encrypted then
print("Error Decrypting")
-- This dosen't trigger either.
end
end
function printdec()
-- This message dosen't print.
print("Decrypting..")
while rep == true do
local t = r2
if t == nil then
rep = false
else
print(decrypt(t,"rofl"))
end
end
end
-- Had to do all this because print(decrypt(r,"rofl")) wouldn't decrypt properly.
Edited by schwem00, 11 January 2015 - 04:14 PM.











