This combined with this quote from Anton: I'm trying to avoid people looking at the data without proper access
sounds like he is wanting to do some really simplistic encryption of his data that will be stored in a database accessible by others. Anton, this will be incredibly easy to decipher. Maybe you should look into the real Crypt::* modules to significantly increase your security. Of course, this depends on you not storing your keys in the clear either (and a list of other concerns). -- Mike Arms > -----Original Message----- > From: Anton Ganeshalingam > [mailto:[EMAIL PROTECTED] > Sent: Monday, March 29, 2004 2:19 PM > To: 'Mike Jackson'; Anton Ganeshalingam > Cc: [EMAIL PROTECTED] > Subject: RE: shifting bits > > Let's say my data is the following phrase 'Hello World'. This > phrase is represented in machine language in bits (assuming > I'm right). So this was the reason I thought I could insert > the data into MS db after shifting a bit. > > tks > Anton > > -----Original Message----- > From: Mike Jackson [mailto:[EMAIL PROTECTED] > Sent: Monday, March 29, 2004 12:49 PM > To: Anton Ganeshalingam > Cc: [EMAIL PROTECTED] > Subject: Re: shifting bits > > > it sounds like you weren't talking about bit-shifting > integers... What do you mean by shifting a byte of > data by any number? > > On Mon, 29 Mar 2004 12:23:21 -0800, Anton Ganeshalingam > <[EMAIL PROTECTED]> wrote: > > > Mike, > > Thanks for your reply. But I'm confused not by your > answer but my > > lack of knowledge on this matter. How would I convert the data like > > "Hello > > World". Should I convert to acssii first ? > > > > tks > > Anton > > > > -----Original Message----- > > From: Mike Jackson [mailto:[EMAIL PROTECTED] > > Sent: Monday, March 29, 2004 12:16 PM > > To: Anton Ganeshalingam; '[EMAIL PROTECTED]' > > Subject: Re: shifting bits > > > > > > from perlop: > > > > Shift Operators > > > > Binary ``<<'' returns the value of its left argument > shifted left by the > > number of bits specified by the right argument. Arguments should be > > integers. (See also Integer Arithmetic.) > > > > Binary ``>>'' returns the value of its left argument > shifted right by the > > number of bits specified by the right argument. Arguments should be > > integers. (See also Integer Arithmetic.) > > > > so, > > > > use Win32::ODBC; > > $db = new Win32::ODBC('DBQ=myDB.mdb;Driver={Microsoft Access Driver > > (*.mdb)};') or die "can't open database"; > > $db->Sql "SELECT * FROM myTable WHERE someVal=$myConditionalVal"; > > if ($db->FetchRow) { > > my %datahash = $db->DataHash; > > $datahash{myVal} <<= $datahash{shiftAmt}; > > $db->Sql "UPDATE myTable SET myVal=$datahash{myVal} WHERE > > someVal=$datahash{someVal}"; > > } > > $db->Close(); > > > > would retrieve a row from myTable where someVal equals > $myConditionalVal, > > shift myVal left by shiftAmt bits, and re-write... if you > wanna do the > > whole table, just push all the result hashes onto an array, > and when > > done, > > go through the array, pop each one, do the shift and re-write... > > > > which would be even easier with a tied hash - but I havent > yet played > > with > > tied hashes... > > > > > > > > On Mon, 29 Mar 2004 11:54:43 -0800, Anton Ganeshalingam > > <[EMAIL PROTECTED]> wrote: > > > >> > >> > >>> Hello to all, > >>> I'm writing a perl program that will take a byte of > data and shift > >>> (right or left) it by any number and write it to a MS > access DB. Since > >>> Perl is free type language how would you accomplish this on perl. > >>> > >>> Please help. > >>> > >>> tks > >>> Anton _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs