PDA

View Full Version : manager safe keys & thread with different functions ?


felix
11-16-2004, 09:06 PM
Hi,

1 - Someone know a good way to store a key (password) in a binary? I need to store this key in the binary with use simetric encription.

So I tested to create a array or define and put the key in it, but if I do a "$strings mybinary" i can see the key in plaintext :cry:

I tryed to store it in hexa "\xhex-number" in arrays or defines, but i yet can see it with strings... :cry:

What is a good way to safe store this constant in a way will not easy to see with strings command or similar?

2 - If i create a thread or a fork() this will always execute the some routine code. I need to create a thread (or something like) that will "open" 2 instances, and each of this instances will execute a different code. For example a kind of createdifferentthread(routineone, routinetwo);

The two routines are completilly different and should be processed in parallel...

Exist a way to do it ? How ?

Thks,

Regards,

RobSeace
11-17-2004, 01:22 PM
1. Well, anything you do will fall into the category of "security through
obscurity"... Because, no matter what, your app will need to have
access to the actual key stored within it, and so someone that knows
how you obscured it would be able to extract it as well... However,
if you're set on doing it, then you probably want to just adopt some
scheme, whereby you store a reversably mangled version of the key,
and then de-mangle it on the fly, before use... Eg: you might take the
real key, and XOR it with some other unrelated string, and store the
resulting value; then, XORing again will restore the original key... Or,
you might apply various other more complicated measures, but it all
boils down to the same basic thing... You're just hiding it from casual
browsers of "strings" output, not from anyone determined to break
your program...

2. I'm not sure I quite grasp what you're saying here... What's wrong
with simply making two consecutive calls to pthread_create() or
fork() or whatever?

felix
11-20-2004, 05:18 PM
Hello RobSeace,

Thks, I done it and worked! :lol:

Regards,