The ISAAC cipher: Difference between revisions

Content added Content deleted
Line 2,916: Line 2,916:
end
end


function main(noprint)
function main()
local msg = "a Top Secret secret";
local msg = "a Top Secret secret";
local key = "this is my secret key";
local key = "this is my secret key";
Line 2,935: Line 2,935:
modPlainText = vigenere(modCipherText, DECRYPT);
modPlainText = vigenere(modCipherText, DECRYPT);
-- Program output
-- Program output
print("Message: " .. msg);
if not noprint then
print("Message: " .. msg);
print("Key : " .. key);
print("Key : " .. key);
print("XOR : " .. ascii2hex(xorCipherText));
print("XOR : " .. ascii2hex(xorCipherText));
print("XOR dcr: " .. xorPlainText);
print("XOR dcr: " .. xorPlainText);
print("MOD : " .. ascii2hex(modCipherText));
print("MOD : " .. ascii2hex(modCipherText));
print("MOD dcr: " .. modPlainText);
print("MOD dcr: " .. modPlainText);
end


end
end

main()
</lang>
</lang>
{{out}}
{{out}}