05-27-2006, 02:32 AM
(ironically zach just created an encryption thread)
i'm working on a picture encryption program where all of the pixels would be jumbled. i'm not to sure how original my little idea is, but the program would work like this:
you load a picture and enter a password (well, passnumber) and that number would get plugged into the random number generator like this:
RANDOMIZE (number)
then the program would go pixel by pixel:
and pick a random number between 0 and the max x/y of the picture. and swap the x,y with the "random" rx,ry.
now this isn't truly random, because you would know the seed number. so going backwards you could re-organize the original order of the pixels. if you don't understand (i don't blame you) look at what i have here: (and yes i'm aware i have a FOR...NEXT delay in there but i swear it's for debugging purpose only!)
The problem is the pixels arenât getting swapped. and i just know the answer is right under my nose
i'm working on a picture encryption program where all of the pixels would be jumbled. i'm not to sure how original my little idea is, but the program would work like this:
you load a picture and enter a password (well, passnumber) and that number would get plugged into the random number generator like this:
RANDOMIZE (number)
then the program would go pixel by pixel:
Code:
for y = 0 to ymax
for x = 0 to xmax
and pick a random number between 0 and the max x/y of the picture. and swap the x,y with the "random" rx,ry.
now this isn't truly random, because you would know the seed number. so going backwards you could re-organize the original order of the pixels. if you don't understand (i don't blame you) look at what i have here: (and yes i'm aware i have a FOR...NEXT delay in there but i swear it's for debugging purpose only!)
Code:
screenres 320,200,32,2,1
input "Pass "; p#
for y = 0 to 99
for x = 0 to 99
c = c + int(16777216 / (100*100))
pset (x,y),c
next
next
sleep
ymax = 99
xmax = 99
randomize p#
for y = 0 to ymax
for x = 0 to xmax
rx = int(rnd*xmax)
ry = int(rnd*ymax)
pa = point(x ,y )
pb = point(rx,ry)
swap pa, pb
pset (x ,y ),pb
pset (rx ,ry ),pa
line (-1 ,-1 )-(100,100),0,b
pset (100,y ),16777215
pset (x ,100),16777215
for sa = 0 to 2000000:next
next
next
sleep
end
The problem is the pixels arenât getting swapped. and i just know the answer is right under my nose