Long data information

Hi there,

I am trying to create a decryption algorithm in monkey c. 

This require a 96-bit key. I would like to have some ideas of how I can put that long key as an entry parameter in a function. 

Thanks in advance

Regards,

Top Replies

All Replies

  • So how this 96-bit number come up on cig as ciq doesn't support such numbers? Hard coded?

    Maybe it's hardcoded. Who knows?

    Like I said, even if the key originally comes from a string, it still has to be represented as numbers eventually, so the question of how to represent a 96-bit integer is relevant.

    I feel OP has c/java function that require 96b value and want to use it.

    128-bit integers aren't standard in C. Java does support arbitrarily large integers with BigInteger tho. Perhaps using multiple normal-sized integers would still be faster in Java.

    So it means function has to be rewritten as there is no 96b int in ciq so parameters can be change also. And no problem with parameter but with rewrite func.

    IMO, focusing on the literal question of passing it in as a function parameter is missing the point. The spirit of the question is "how do I represent a 96-bit key in Monkey C". And if you're going to do some mathematical operations with the key, such as using it to decrypt data, you need the key to be in the form of numerical data.

    And of course, this problem isn't really specific to CIQ/Monkey C. If this was a C question, I would give a similar answer (except I'd say "array of uint8" instead of "array of numbers").

  • If it's hard coded it has to be converted to any accepted type by MC so the best is what Jim said arrays of 96 bytes. But it depended on code inside the function.

  • If it's hard coded it has to be converted to any accepted type by MC so the best is what Jim said arrays of 96 bytes. But it depended on code inside the function.

    - It's 96 bits, not 96 bytes

    - ByteArray is only supported in CIQ 3.0 or higher

    - If you want to use an array, an array of numbers would be the compatible solution (if you care about CIQ < 3). Up to you whether you want each element to represent 8 bits or 32 bits of of your key, although I would probably choose the latter.

    - Passing in three numbers is also a possibility, but come to think of it, that might be a bit clunky, especially if the key is passed to more than one function. There probably isn't much advantage to this solution except tiny memory savings and avoiding bugs due to accidentally passing in an array that's too small.

  • 96bits... typo Slight smile

    but array of chars from 1.3 :)