Well, I thought I had a method for encrypting images, using a smaller image as the key. But it's not working and I'm not sure why.
I attached the image I'm using for the key. I feel as though it's something painfully obvious.
img = loadImage("zelda.png")
`img = loadImage("zelda-watermark.png")
imgKey = loadImage("watermark.jpg")
mem = createMemblockFromImage(img)
memKey = createMemblockFromImage(imgKey)
width = getMemblockInt(mem, 0)
height = getMemblockInt(mem, 4)
width2 = getMemblockInt(memKey, 0)
height2 = getMemblockInt(memKey, 4)
for y = 0 to height-1
for x = 0 to width-1
pos = y*width*4 + x*4 + 12
keyPos = ((y mod height2)*width2 + (x mod width2))*4 + 12
i = getMemblockInt(mem, pos)
k = getMemblockInt(mem, keyPos)
c = i xor k
setMemblockInt(mem, pos, c)
next x
next y
keyedImage = createImageFromMemblock(mem)
saveImage(keyedImage, "zelda-watermark.png")
`saveImage(keyedImage, "zelda-unwatermark.png")
end
"You're all wrong. You're all idiots." ~Fluffy Rabbit