picture encryption - Printable Version +- Qbasicnews.com (http://qbasicnews.com/newforum) +-- Forum: Qbasic "like" compilers/interpreters (http://qbasicnews.com/newforum/forum-5.html) +--- Forum: FB Discussion & Programming Help (http://qbasicnews.com/newforum/forum-15.html) +--- Thread: picture encryption (/thread-9326.html) |
picture encryption - Dio - 05-27-2006 (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: Code: for y = 0 to ymax 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 The problem is the pixels arenât getting swapped. and i just know the answer is right under my nose picture encryption - Neo - 05-27-2006 You have: Code: pa = point(x ,y ) Use: Code: pa = point(x,y) It might work... ^^ Yours, - Neo picture encryption - Dio - 05-27-2006 well actully, i just did that (i rembered seeing a swap function and i just now figured out how to use it) but still no avail. thanks though! picture encryption - Neo - 05-27-2006 I will post the differences again, fat code is changed code. Quote:pa = point(x,y)I should've done this before. (And you might have done better by copying my code next time ) Looking at this for a second time, you could even have done Code: pa = Point(x, y) Yours, - Neo picture encryption - Dio - 05-27-2006 wow. just wow. i have got to be the absolute worst programmer on the face of the earth. why did i think i needed to swap the variables? jesus christ. thanks man. i am such a dumbass. honestly. ok. i'll need help later with some other shit i just know it. thanks. edit: hmm, looks like sumo put the censors back on...should i bypass them? risky business... picture encryption - Neo - 05-27-2006 It's alright, no need to start swearing at yourself. I'm the one who's a newb here anyway :^_^: Glad to have been of service, - Neo. picture encryption - Dio - 05-29-2006 success! i finished coding the encrypt/decrypt it was kinda hard. but now i need to know how to upload Bitmaps and save them. anybody know any good sites? thanks. Code: screenres 1024,768,32,2,1 picture encryption - Zack - 05-29-2006 Register at fileanchor.com for free file hosting. Or do you need to know how to bload .bmp's into an FB program? picture encryption - Dio - 05-30-2006 oh, sorry, i meant it in fb. picture encryption - Anonymous - 05-30-2006 do you mean upload a file to the internet using FB? if so, you could probably do that with winsock. and i think fb comes with an example called wshelper.bas (winsock helper), let me know if that's what you mean |