in reply to Re: Reading two (2) file in byte[] form and then XOring them
in thread Reading two (2) file in byte[] form and then XOring them

Thanx..

But the problem that arrive in Crypt::CTR (the counter is not be able to be transfer to another PC) limits me.. Could anyone here help me??

How can I used the same counter on other PC?? Its due change on every file running and how can I decrypt it back??
  • Comment on Re: Reading two (2) file in byte[] form and then XOring them

Replies are listed 'Best First'.
Re^2: Reading two (2) file in byte[] form and then XOring them
by sgifford (Prior) on Feb 25, 2005 at 05:49 UTC

    It looks like the counter is stored in the object's hashref, in register. So you can get it out as a string by using register, or as an integer by using unpack like this: my ($ctr, undef) = unpack "La*", $cipher->{register}. If you wanted to put it into a new object, you could probably just set that object's register property. Subclassing would be a slightly more elegant way to do this, but any way you slice it, this is a hack, and could change under your feet since it's not an official part of the interface. But, it should work well enough to test, and make the case to the module author that an interface to the counter should be exposed.

    Generally you shouldn't need to get the counter out. What are you doing that requires that?