in reply to Re: How to read encrypted data from informix database into a single variable
in thread How to read encrypted data from informix database into a single variable

@jettero : I am working with archaic system and new to Perl :) Yes, i thing i will try to dump a hex and work on it. It sounds better. I will give it a shot.

I have taken, hex unload to a file. It contains around 25,000 records. It is not possible to extract a single record (unique keys are such, that i cannot use them at runtime). So now i want to read , 32 bytes of this file ( the hex dump) at a time (in an scalar variable) and skip 2 bytes after - each 32 byte read. can you suggest me a way to do this!

  • Comment on Re^2: How to read encrypted data from informix database into a single variable

Replies are listed 'Best First'.
Re^3: How to read encrypted data from informix database into a single variable
by jettero (Monsignor) on May 15, 2007 at 13:44 UTC
    You generate the output file yourself, so I'd make sure to only write 32bytes per line — while simultaneously avoiding writing the two mystery bytes — and just read them back in that way. no?
    while(<$input>) { chomp; my $var = pack("H*", $_); die "holy smokes, my hex-dump file is bad" unless length $var == 3 +2; }

    -Paul

      Analysing hex dump, was good idea. It simplified lot of things. I took, unload of encrypted data in an file. And then from byte patterns and using simple read() and seek(), i was able to extract the actual encrypted data bytes as i intended to do. Thank you for your inputs :) . have a nice day