Hello, I’m doing some en-/de-cryptions based on DES on String data.
For this, I everytime need 64-Bit blocks XOR’ed together.
But there is no XOR-operation on String data.
Before I start building a C-Extension for String here, I just want to
ask if there is any slightly effective possibility to do this better
than:
0.upto(7){|i| a[i] = (a[i].to_i ^ s[i+ofs].to_i).chr}
I’ve already considered converting int array of longs or into bignum,
but I’m looking for a more elegant solution.
Btw. Bignum is not to be seen in the list of directives for pack/unpack,
wouldn’t it be nice to have such an conversion?
Michael B.