From: "Andreas Filsinger" To: Subject: Computer Lab Feedback, "Image encrytion" Date: Tuesday, October 31, 2000 8:42 AM Earl, i used the published "Image encryption"-Code to shrink it down to a "form"-less simple all purpose Routine. I hope this helps others. Thanks a lot for your unbelieveable Web-Output. Mfg.A.Filsinger (GERMANY) procedure BMPScramble(b : TBitMap; Key : integer); // // (c)'00 by http://www.efg2.com/Lab // // scrambles (encrypt) a bitmap before you save it to // disk (for example) or before post it to a database-field. // Scramble it again before you want to view it. // Ensure to use the same key-value, for each pic, but // different values for different pictures. // var i,j : integer; row : pByteArray; ScanlineByteCount : integer; begin with b do begin dormant; // ensure, that the image is a DIB // there where problems on monoChrome-BMPs, // the memory-image was not really what i expected // "dormant" seems to clear this. RandSeed := key; ScanlineByteCount := ABS(Integer(Scanline[1]) - Integer(Scanline[0])); FOR j := 0 TO pred(Height) DO BEGIN Row := Scanline[j]; FOR i := 0 TO pred(ScanlineByteCount) DO Row[i]:= Row[i] XOR Random(256); END; end; randomize; // ensure, that future random-calls have true // random results end; _______________________________________________________ / Tel. +49 7251 966100 | Andreas Filsinger \ | Mob. +49 175 5913758 | Softwareentwicklung | | Fax. +49 7251 966101 | Stettfelder Strasse 44 | | mailto:Andreas@Filsinger.de | 76698 Ubstadt | | http://www.CargoBay.de | GERMANY | \_______________________________________________________/