I have retrieve a code file related to security topic, that contains a piece of code to protect harcoded value of RSA key against static analysis:

 // Byte values of encrypted key
 //121, 217, 79, 9, 233, 193, [...]

void GenerateKey(char *X){

I want to know if it exists tools to generate automatically such of code from a key value (or other kind of static buffer data) ? Or what is the 'algorithm' to write it manually ?

My question is more for my own culture than for use in a production project.

  • Hi and welcome to RE.SE. For starters this is borderline off-topic, but this venue sort of makes sense for the topic. Do you mean something like this but for arbitrary buffers? It's security by obscurity for sure, because once - as a reverse engineer - I have figured out the the function (fingerprints exist for the usual libraries) taking the key as input I'll instrument/patch/break at this location to get the RSA key proper.
    – 0xC0000022L
    Sep 30 '21 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.